tursodatabase/turso-cli

Support CSV export of a query

avinassh opened this issue · 1 comments

I am trying to write a bash script to extract some data from the database in csv format and typically I would do this as

sqlite3 my.db ".mode csv" ".headers on" "$sql_query"

Unfortunately, this doesn't work using the turso CLI (Error: accepts between 1 and 2 arg(s), received 3)

turso db shell my-db ".mode csv" "$sql_query"

reported here: https://discord.com/channels/933071162680958986/1193507982076547082/1193507982076547082

Could this be done by adding a new flag?
Example like a --query-cmds flag followed by a list of strings/commands

turso db shell my-db --query-cmds ".mode csv" ".head on" "$sql_query"