.mode csv
.import ./users.csv usersA reliable shell pattern when loading CSV into an existing table.
CSV import/export, SQL dumps, VACUUM INTO, backup copies, and repeatable data movement patterns for SQLite databases.
Import files, export query results, and create SQL dumps.
.mode csv
.import ./users.csv usersA reliable shell pattern when loading CSV into an existing table.
.headers on
.mode csv
.once recent_users.csv
SELECT id, email, created_at FROM users ORDER BY created_at DESC LIMIT 100;Good for ad hoc reporting and support workflows.
.dump usersUseful when sharing a fixture or moving just one logical dataset.
sqlite3 app.db < seed.sqlA shell-friendly way to initialize or refresh a local database.
Create safe copies and compact files.
Write a fresh copy of the database to a new file.
VACUUM INTO 'backup-2026-03-28.db';Produces a compact copy and is a strong option for backup-style snapshots.
.backup backup.dbA convenient shell-level backup path for local workflows.
VACUUM;Can reduce file size after large deletes or schema churn.
Verify the database structure and content consistency.
PRAGMA integrity_check;Useful before and after migrations, backup jobs, or corruption investigations.