Skip to content

Commit 36181f9

Browse files
committed
update for compatible @ionic/sqlite@5.x
1 parent 31c67cf commit 36181f9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/definitions/database-definition.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11

22
export type DatabaseBase = DatabaseTransaction | DatabaseObject;
33

4-
export interface DatabaseTransaction {
5-
start: () => void;
4+
export interface DatabaseBaseTransaction {
65
executeSql: (
76
sql: string,
87
values: any,
98
success: (tx: DatabaseTransaction, result: DatabaseResult) => void,
109
error: (tx: DatabaseTransaction, error: any) => void,
1110
) => void;
11+
}
12+
13+
export interface DatabaseTransaction extends DatabaseBaseTransaction {
14+
start: () => void;
1215
addStatement: (sql: any, values: any, success: () => void, error: () => void) => void;
1316
handleStatementSuccess: (handler: () => void, response: any) => void;
1417
handleStatementFailure: (handler: () => void, response: any) => void;
@@ -24,7 +27,7 @@ export interface DatabaseObject {
2427
* @param fn {any}
2528
* @returns {Promise<any>}
2629
*/
27-
transaction(fn: (transaction: DatabaseTransaction) => void): Promise<any>;
30+
transaction(fn: (transaction: DatabaseBaseTransaction) => void): Promise<any>;
2831
/**
2932
* @param fn {() => void}
3033
* @returns {Promise<any>}

0 commit comments

Comments
 (0)