noborus / trdsql

CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN. Can output to various formats.
https://noborus.github.io/trdsql/
MIT License
1.94k stars 73 forks source link

Multiple queries #184

Closed agguser closed 8 months ago

agguser commented 2 years ago

Please support multiple queries. Currently, it seems that only last query is output, e.g.

$ trdsql 'select 1; select 2,3'
2,3

Note: union is not used here because of different number of columns.

A workaround is to run multiple commands (e.g. trdsql 'select 1'; trdsql 'select 2,3'), but database will be created multiple times. And if input is from stdin, you have to save it first to share same input for each command.

noborus commented 2 years ago

Thank you for the issue. I hope this can be done, but I don't think it will be used much in practice, and simplicity may be sacrificed.

noborus commented 8 months ago

Implemented in v0.20.0. thank you.