alex / alex/csv-sql

Batch mode

Aberta
#579 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Rust
Estrelas
213
Forks
19
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.