dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.52k stars 74 forks source link

Feature request: sqlite3 .output compatibility #115

Open t3h2mas opened 3 years ago

t3h2mas commented 3 years ago

It would be great to be able to save query results using litecli. Currently, my workflow involves copying a query from litecli and using sqlite3 to get a csv.

Similar to the following in sqlite3

.mode csv
.output results.csv
...
amjith commented 3 years ago

There is a tee command available that will write the query and the results to a specified file. Here's an equivalent workflow.

.mode csv
tee filename.csv

Unfortunately this won't save just the output it will also include the query itself.

You can turn off the output to file using notee command.