Created
March 8, 2021 11:35
-
-
Save fish8/0410f433201b6c3a1b3605663d2ea054 to your computer and use it in GitHub Desktop.
sq usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#bash command completion | |
source <(sq completion bash) | |
#add source | |
sq add ./CBDB_20200528.db -h @cbdb_20200528 | |
#list source | |
sq ls | |
#inspecting, list table names | |
sq inspect -j @cbdb_20200528 |jq -r '.tables[] | .name' | |
#export all tables to csv | |
sq inspect -j | jq -r '.tables[] | .name' | xargs -I % sq .% --csv --output %.csv | |
#supported output formats | |
--table: Text/Table | |
--json: JSON | |
--jsona: JSON Array | |
--jsonl: JSON Lines | |
--csv / --tsv : CSV / TSV | |
--xlsx: XLSX (Microsoft Excel) | |
--html: HTML | |
--xml: XML | |
--markdown: Markdown | |
--raw: Raw (bytes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment