Skip to content

Instantly share code, notes, and snippets.

@fish8
Created March 8, 2021 11:35
Show Gist options
  • Save fish8/0410f433201b6c3a1b3605663d2ea054 to your computer and use it in GitHub Desktop.
Save fish8/0410f433201b6c3a1b3605663d2ea054 to your computer and use it in GitHub Desktop.
sq usage
#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