Cheat sheet

SQLite

Dot commands for the sqlite3 shell.

Schema

.schema variants
Action Command
DDL for everything .schema
DDL for one table .schema users
DDL by pattern LIKE pattern, so % matches anything .schema user%
Pretty-print the DDL .schema --indent
Hide internal tables skips sqlite_* objects .schema --nosys

Files

.read variants
Action Command
Run SQL from a file path is relative to the shell's cwd .read seed.sql
Run a command's output as SQL not available in --safe mode .read |gen-sql.sh