better-sqlite3
better-sqlite3 copied to clipboard
General callback after any successful action ?
First of all, thank you for this library 👍.
I'm brainstorming the synching of two instances of my app, and one option could be to replicate each data successfully inserted in the database so that the other instance can apply the updates too.
Is there any kind of global callback which would be triggered on a successful db.transaction()
, insert
, update
, or destroy
?
I don't believe this is built-in.
I wrapped all DB calls to go through a wrapper class that ensures the db is open, handles nested transactions, and catches and logs all db errors. I'd suggest that approach: you then have as much flexibility as you need.
Thank you for your comment