alex / alex/csv-sql

Batch mode

未關閉
#579 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
213
分支
19
PR 合併指標
30 天內沒有已合併 PR

描述

Thanks for this project; very useful.

I would be interested in running this in batch mode; i.e. specifying the query on `stdin` or in a file. I could then make `csv-sql` part of shell pipelines and run it in continuous integration.

Something like this syntax comes to mind:

```command
$ echo '.export(results.csv) SELECT COUNT(*) from t;' | csvsql file.csv
```

Alternatively, reading the query from a file would also be useful:

```command
$ echo '.export(results.csv) SELECT COUNT(*) from t;' > query.sql
$ csvsql file.csv --load-query-from query.sql
```

If `--load-query-from` would accept `-` as a symbol for `stdin`, the line would look like this:

```command
$ echo '.export(results.csv) SELECT COUNT(*) from t;' | csvsql file.csv --load-query-from -
```

Personally, the first option (read query from `stdin` if it's not a TTY) would be my preference.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。