# dsq - JSON,CSV,Excel,Parquet 등에 SQL쿼리 실행하는 CLI도구

> Clean Markdown view of GeekNews topic #5741. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=5741](https://news.hada.io/topic?id=5741)
- GeekNews Markdown: [https://news.hada.io/topic/5741.md](https://news.hada.io/topic/5741.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2022-01-14T10:19:31+09:00
- Updated: 2022-01-14T10:19:31+09:00
- Original source: [datastation.multiprocess.io](https://datastation.multiprocess.io/blog/2022-01-11-dsq.html)
- Points: 14
- Comments: 1

## Topic Body

- 오픈소스 데이터 IDE인 DataStation이 별도로 공개한 Go 기반 CLI 오픈소스

ㅤ→ 내부에서 Datastaion 라이브러리와 SQLite를 사용

$ dsq testdata.json "SELECT * FROM {} WHERE x > 10"

- 여러개의 파일을 넘기고 각각을 별도의 테이블로 하여 Join 가능

$ dsq users.csv ages.json "select {0}.name, {1}.age from {0} join {1} on {0}.id = {1}.id"

- 파이핑 지원

$ dsq users.csv "SELECT * FROM {} ORDER BY CAST(age AS INT) DESC" | jq

$ cat testdata.csv | dsq -s csv "SELECT * FROM {} LIMIT 1"

- CSV를 JSON으로 변환

$ dsq testdata.csv "SELECT * FROM {}"

- 지원포맷 : CSV, TSV, JSON, NDJSON, Parquet, Excel, ODS, Apache Error Logs, Apache Access Logs, Nginx Access Logs

## Comments



### Comment 8401

- Author: xguru
- Created: 2022-01-14T10:19:37+09:00
- Points: 1

- SQ - swiss-army knife for data https://news.hada.io/topic?id=3841

- q - CSV 파일에 SQL쿼리 하기 https://news.hada.io/topic?id=3000
