From 630b98520fdde61ab494fb9cc87e74c98c7b0f6a Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 25 Feb 2024 09:48:24 +0000 Subject: [PATCH] Add note about transaction handling --- .../tiddlywiki/multiwikiserver/modules/sql-tiddler-database.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/tiddlywiki/multiwikiserver/modules/sql-tiddler-database.js b/plugins/tiddlywiki/multiwikiserver/modules/sql-tiddler-database.js index 924e37bd3..959642378 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/sql-tiddler-database.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/sql-tiddler-database.js @@ -501,6 +501,8 @@ SqlTiddlerDatabase.prototype.getRecipeBags = function(recipename) { Execute the given function in a transaction, committing if successful but rolling back if an error occurs. Returns whatever the given function returns. Calls to this function can be safely nested, but only the topmost call will actually take place in a transaction. + +TODO: better-sqlite3 provides its own transaction method which we should be using if available */ SqlTiddlerDatabase.prototype.transaction = function(fn) { const alreadyInTransaction = this.transactionDepth > 0;