Python utility functions for manipulating SQLite databases
This library and command-line utility helps create SQLite databases from an existing collection of data.
Most of the functionality is available as either a Python API or through the
sqlite-utils command-line tool.
sqlite-utils is not intended to be a full ORM: the focus is utility helpers to make creating the initial database and populating it with data as productive as possible.
It is designed as a useful complement to Datasette.
- sqlite-utils command-line tool
- Python API
- Connecting to or creating a database
- Listing tables
- Listing rows
- Creating tables
- Bulk inserts
- Upserting data
- Adding columns
- Adding foreign key constraints
- Setting an ID based on the hash of the row contents
- Creating views
- Storing JSON
- Enabling full-text search
- Optimizing a full-text search table
- Creating indexes
Take a look at this script for an example of this library in action.