Use sqlite-utils to manipulate SQLite databases
mainsqlite-utils is a core building block in the ecosystem that provides a Python library and a command-line utility for managing SQLite databases. It is used to bridge the gap between raw data and a Datasette-ready database.
Key capabilities include:
- Data Ingestion: Inserting data from JSON, CSV, or TSV formats into SQLite. It can automatically create tables with correct schemas or alter existing tables to add missing columns.
- Full-Text Search (FTS) Configuration: Setting up tables for SQLite FTS, including the creation of triggers to maintain search index synchronization.
- Advanced Schema Modification: Performing operations not supported by standard SQLite
ALTER TABLEsyntax, such as changing column types or redefining primary keys. - Relationship Management: Adding foreign keys to existing tables and extracting columns into separate lookup tables.