Database.transaction() method
Home > @direct-sqlite/core > Database > transaction
Database.transaction() method
Section titled “Database.transaction() method”Executes a series of database operations within a transaction. If any operation throws an error, the transaction will be rolled back.
Signature:
transaction<T>(callback: () => T): T;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
callback |
() => T |
Function containing the database operations to execute within the transaction. |
Returns:
T
The value returned by the callback function if the transaction commits successfully.