nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.97k stars 29.79k forks source link

node:sqlite: support database.backup #55413

Open topvis opened 1 month ago

topvis commented 1 month ago

What is the problem this feature will solve?

no simple function to make backup of the sqlite database.

What is the feature you are proposing to solve the problem?

make a backup of sqlite database with a simple function like database.backup(filename); refer to sqlite backup API: https://www.sqlite.org/backup.html

What alternatives have you considered?

No response

geeksilva97 commented 4 weeks ago

Hello @cjihrig . Would you have an opinion about this? This is something I'd like to try. Having some advice would be good.

cjihrig commented 4 weeks ago

Seems like a useful feature to support.

One design issue I see is whether we would expose the individual functions that make up the online backup API, or provide a single backup() function. A single function would be simpler for most cases, but 1. I could imagine people requesting access to the individual functions as well, and 2. we almost certainly would not want to block the event loop for the entire duration of the backup.