sqlite

Examples

sqlite3 some.db .sch > schema.dump

... dumps the schema of database 'some.db' into 'schema.dump'



sqlite3 some.db .dump > full.dump

... dumps both schema and data for 'some.db' into 'full.dump'



grep -v -f schema.dump full.dump > data_only.dump

... dumps (filters) only the data



sqlite3 some.db .dump | grep '^INSERT INTO "tablename"' > tablename.dump

... dumps only the INSERT statements for 'tablename'



echo '.dump' | sqlite3 my.db | sqlite3 repaired_my.db

... in case of database corruption

2026-04-11 13:09:33

minicms - © 2020-2026 Simeon Simeonov