Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to dump and load the data of a database #1681

Open
terrakuh opened this issue Feb 14, 2023 · 2 comments
Open

Ability to dump and load the data of a database #1681

terrakuh opened this issue Feb 14, 2023 · 2 comments

Comments

@terrakuh
Copy link

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.

@terrakuh
Copy link
Author

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) => {})
})

@Deadman878787
Copy link

Uploading Unknown.zip…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants