No server, no configuration, full SQL.
Why¶
- No server — just file
- Zero configuration
- CTE, window functions
- Millions of rows OK
Usage¶
sqlite3 mydb.sqlite
CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT);
INSERT INTO users VALUES (1,'John');
SELECT * FROM users;
Python¶
import sqlite3
conn = sqlite3.connect('mydb.sqlite')
c = conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)')
WAL¶
PRAGMA journal_mode=WAL;
PRAGMA busy_timeout=5000;
- YES — prototypes, tests, embedded, cache
- NO — high concurrent writes, multi-server
SQLite = Simplicity¶
Perfect for getting started. Migration to PG simple.
sqlitesqlprototyping