Skip to content

Commit 7f7ec00

Browse files
author
Oscar Franco
committed
Update README
1 parent 03d6b67 commit 7f7ec00

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ db = {
4545
delete: () => void,
4646
attach: (dbNameToAttach: string, alias: string, location?: string) => void,
4747
detach: (alias: string) => void,
48-
transactionAsync: (fn: (tx: TransactionAsync) => Promise<void>) => void,
49-
transaction: (fn: (tx: Transaction) => void) => void,
48+
transactionAsync: (fn: (tx: TransactionAsync) => Promise<void>) => Promise<void>,
49+
transaction: (fn: (tx: Transaction) => void) => Promise<void>,
5050
execute: (query: string, params?: any[]) => QueryResult,
5151
executeAsync: (
5252
query: string,
@@ -95,7 +95,7 @@ If you want to execute a large set of commands as fast as possible you should us
9595
It is strongly recommended that you try/catch the code inside of the transactions since it will be internally catched if you don't handle it and nothing will be thrown into the parent application!
9696

9797
```typescript
98-
QuickSQLite.transaction('myDatabase', (tx) => {
98+
await QuickSQLite.transaction('myDatabase', (tx) => {
9999
const { status } = tx.execute(
100100
'UPDATE sometable SET somecolumn = ? where somekey = ?',
101101
[0, 1]
@@ -114,7 +114,7 @@ QuickSQLite.transaction('myDatabase', (tx) => {
114114
Async transactions are also possible:
115115

116116
```ts
117-
QuickSQLite.transactionAsync('myDatabase', async (tx) => {
117+
await QuickSQLite.transactionAsync('myDatabase', async (tx) => {
118118
tx.execute('UPDATE sometable SET somecolumn = ? where somekey = ?', [0, 1]);
119119

120120
await tx.executeAsync(

0 commit comments

Comments
 (0)