Skip to content

Instantly share code, notes, and snippets.

@CodyKochmann
Created May 10, 2021 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodyKochmann/af67a9cd5baf6884be423485567dc933 to your computer and use it in GitHub Desktop.
Save CodyKochmann/af67a9cd5baf6884be423485567dc933 to your computer and use it in GitHub Desktop.
# by: Cody Kochmann
/t/u/1/tmp.1LQUz9KguH $ echo "CREATE TABLE test(col1 TEXT, col2 INTEGER);" | tee schema.sql
CREATE TABLE test(col1 TEXT, col2 INTEGER);
/t/u/1/tmp.1LQUz9KguH $ cat schema.sql | sqlite3 test.db
/t/u/1/tmp.1LQUz9KguH $ sqlite3 test.db '.tables'
test
/t/u/1/tmp.1LQUz9KguH $ printf "col1,col2\na,1\nb,2\n" | sqlite3 test.db ".import --csv /dev/stdin test"
/t/u/1/tmp.1LQUz9KguH $ sqlite3 test.db 'select * from test'
col1|col2
a|1
b|2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment