Databases
SQLite
Use the CLI, query data and manage small transactional databases.
Updated Official documentation ↗
CLI
sqlite3 app.dbOpen or create a database.tablesList tables inside the SQLite shell.schema usersInspect a table definition.headers onDisplay result-column headingsQuery
SELECT id, name FROM users LIMIT 10;Read a bounded resultSELECT name, COUNT(*) FROM users GROUP BY name;Aggregate by a fieldPRAGMA table_info(users);Inspect column metadataEXPLAIN QUERY PLAN SELECT * FROM users WHERE id = 1;Inspect query strategyIntegrity and backup
PRAGMA foreign_keys = ON;Enable FK enforcement for the connectionBEGIN;Start an explicit transactionROLLBACK;Undo the current transaction.backup backup.dbCreate a consistent backup through the shell