mirror of
https://github.com/hanzoai/better-sqlite3-multiple-ciphers.git
synced 2026-09-24 16:57:19 +00:00
Clarify error handling behavior for nested transactions in docs
Co-authored-by: Niklas Wenzel <[email protected]>
This commit is contained in:
co-authored by
Niklas Wenzel
parent
e59c67d03d
commit
f7ee3351e8
@@ -74,6 +74,8 @@ insertMany([
|
||||
|
||||
Transaction functions can be called from inside other transaction functions. When doing so, the inner transaction becomes a [savepoint](https://www.sqlite.org/lang_savepoint.html).
|
||||
|
||||
If an error is thrown inside of a nested transaction function, the nested transaction function will roll back to the state just before the savepoint and rethrow the error. If the error is not caught in the outer transaction function, this will cause the outer transaction function to roll back as well.
|
||||
|
||||
```js
|
||||
const newExpense = db.prepare('INSERT INTO expenses (note, dollars) VALUES (?, ?)');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user