Skip to main content

Module dump

Module dump 

Source
Expand description

.dump: the SQL that would rebuild the database.

Invariant: what comes out reproduces what went in, and it says so at the top. A dump is wrapped in a transaction and begins with PRAGMA foreign_keys=OFF, because the rows come out in sqlite_master order rather than in dependency order and a foreign key would refuse a child whose parent is three statements later. That is SQLite’s dump format, and a dump that could not be fed back in is not a dump.

Functions§

dump
Writes the whole database, or one table, as SQL.