/** * Stores all operations applied to the transaction and then applies * them atomically to the database once it's committed. Locks the * database when the first operation in the transaction is started. * * You must release the lock by calling [[`IDatabaseTransaction.commit`]] * or [[`IDatabaseTransaction.abort`]] * * Start a transaction by using {@link IDatabase.transaction} or the less used {@link IDatabase.withTransaction} * * @note Unlike most relational database transactions, the state is * not guaranteed to be consistent at time the transaction was * started. A row is frozen into the transaction when the first read * or write is performed on it. */ export interface IDatabaseTransaction { /** * Lock the database */ acquireLock(): Promise; /** * Commit the transaction atomically to the database but do not release the database lock * */ update(): Promise; /** * Commit the transaction atomically to the database and release the database lock * */ commit(): Promise; /** * Abort the transaction and release the database lock * */ abort(): Promise; /** * The number of pending operations */ readonly size: number; } //# sourceMappingURL=transaction.d.ts.map