node-sqlite3
node-sqlite3 copied to clipboard
Ability to dump and load the data of a database
Summary
Are there any plans to provide functionality to dump/load the SQLite database to/from raw memory buffers? I've seen #709 but I think that issue is obsolete.
This would enable the user to work solely on in-memory database and make backups.
Proposed implementation
I have implemented the experimental methods db.dump() and db.load() which map to the SQLite equivalent sqlite3_serialize() and sqlite3_deserialize() at my fork. It is not 100% complete and does not contain tests.
For anyone who's interested: You can apply the dump_and_load.patch.txt patch:
git am < dump_and_load.patch.txt
Basic usage:
db1.dump("main", (err, data) => {
db2.load("main", data, (err) => {})
})
Uploading Unknown.zip…