Closed gedw99 closed 1 year ago
Ah interesting, the exec
sub-command was simply to execute SQLs without results (like updates). But I can add that. I usually use sling for that with sling run --src-conn SQLITE --src-stream 'select * from positions' --stdout
. Sling will detect your env connections as well the same way.
But makes sense to actually output the results as CSV or JSON from CLI. Will add that as well.
For now you can do that with sling or from the frontend, there is a button on the right side, that says Export to CSV
.
This is done. Feel free to try it!
$ ./dbnet exec
exec - execute a SQL query
Usage:
exec [conn]
Positional Variables:
conn The connection name (Required)
Flags:
--version Displays the program version string.
-h --help Displays help with available flag, subcommand, and positional value parameters.
--query The SQL query to execute
--file The SQL file to execute
--csv Output the results as CSV
--json Output the results as JSON Lines
Thanks @flarco
will try it .
At the moment i can't seem to run SQL and get an output to terminal of the actual data.
Whats your game plan / roadmap here if i may ask ?
here is my little test case:
select-sql is simply:
The CLI help does not show any way to add args to tell it i want CSV or JSON out to screen or file....