sqlite3 app.db '.output dump.sql' '.dump'

Category: Databases & SQL

sqlite3 app.db '.output dump.sql' '.dump'

Export the whole database as SQL

.dump writes recreate statements for the schema and data; .output redirects them into dump.sql. Restore with sqlite3 app.db < dump.sql. Related: .backup for a binary copy.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.