Skip to content

Commit 5b5de93

Browse files
committed
Added AsyncTransaction API for IBConnection interface
1 parent abcde2a commit 5b5de93

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ interface IDBConnection {
435435
) => void;
436436
detach: (alias: string, callback: (result: StatementResult) => void) => void;
437437
transaction: (fn: (tx: Transaction) => boolean) => void;
438+
asyncTransaction: (fn: (tx: AsyncTransaction) => Promise<boolean>) => void
438439
loadSqlFile: (
439440
location: string,
440441
callback: (result: FileLoadResult) => void
@@ -507,6 +508,9 @@ export const openDatabase = (
507508
transaction: (fn: (tx: Transaction) => boolean): void => {
508509
QuickSQLite.transaction(options.name, fn);
509510
},
511+
asyncTransaction: (fn: (tx: AsyncTransaction) => Promise<boolean>): void => {
512+
return QuickSQLite.asyncTransaction(options.name, fn);
513+
},
510514
close: (ok: any, fail: any) => {
511515
try {
512516
QuickSQLite.close(options.name);

0 commit comments

Comments
 (0)