mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-07 07:50:26 +00:00
Add note about transaction handling
This commit is contained in:
parent
1c0341de51
commit
630b98520f
@ -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.
|
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.
|
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) {
|
SqlTiddlerDatabase.prototype.transaction = function(fn) {
|
||||||
const alreadyInTransaction = this.transactionDepth > 0;
|
const alreadyInTransaction = this.transactionDepth > 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user