Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CSV export of a query #769

Open
avinassh opened this issue Jan 8, 2024 · 1 comment
Open

Support CSV export of a query #769

avinassh opened this issue Jan 8, 2024 · 1 comment

Comments

@avinassh
Copy link
Member

avinassh commented Jan 8, 2024

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

@avinassh avinassh changed the title Enable CSV export of a query Suport CSV export of a query Jan 8, 2024
@avinassh avinassh changed the title Suport CSV export of a query Support CSV export of a query Jan 8, 2024
@Mr-Destructive
Copy link
Contributor

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants