
Sqlite-utils memory lets you import CSV or JSON data into an in-memory database and run SQL queries against it in a single command: $ cat dogs.csv | sqlite-utils memory - "select name, age from stdin"

Or for data in a CSV file: $ sqlite-utils insert dogs.db dogs dogs.csv -csv | sqlite-utils insert releases.db releases -pk id You can import JSON data into a new database table like this: $ curl \ $ sqlite-utils dogs.db "select * from dogs" -table $ sqlite-utils dogs.db "select * from dogs" -csv

$ sqlite-utils dogs.db "select id, name from dogs" $ sqlite-utils insert dogs.db dogs dogs.csv -csv Now you can do things with the CLI utility like this: $ sqlite-utils memory dogs.csv "select * from t"
#Sqlite import csv and create table install#
Or if you use Homebrew for macOS: brew install sqlite-utils Read more on my blog, in this series of posts on New features in sqlite-utils and other entries tagged sqliteutils.

Pipe JSON (or CSV or TSV) directly into a new SQLite database file, automatically creating a table with the appropriate schema.Python CLI utility and library for manipulating SQLite databases.
