Skip to content

Commit 96ec647

Browse files
authored
Update README.md
1 parent 5367106 commit 96ec647

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ db = {
6161
query: string,
6262
params?: any[]
6363
) => Promise<QueryResult>,
64-
executeBatch: (commands: SQLBatchParams[]) => BatchQueryResult,
65-
executeBatchAsync: (commands: SQLBatchParams[]) => Promise<BatchQueryResult>,
64+
executeBatch: (commands: BatchQueryCommand[]) => BatchQueryResult,
65+
executeBatchAsync: (commands: BatchQueryCommand[]) => Promise<BatchQueryResult>,
6666
loadFile: (location: string) => FileLoadResult;,
6767
loadFileAsync: (location: string) => Promise<FileLoadResult>
6868
}
@@ -130,10 +130,10 @@ Batch execution allows the transactional execution of a set of commands
130130

131131
```typescript
132132
const commands = [
133-
['CREATE TABLE TEST (id integer)'],
134-
['INSERT INTO TEST (id) VALUES (?)', [1]],
135-
[('INSERT INTO TEST (id) VALUES (?)', [2])],
136-
[('INSERT INTO TEST (id) VALUES (?)', [[3], [4], [5], [6]])],
133+
{query: 'CREATE TABLE TEST (id integer)'},
134+
{query: 'INSERT INTO TEST (id) VALUES (?)', params: [value1]},
135+
{query: 'INSERT INTO TEST (id) VALUES (?)', params: [value2]},
136+
{query: 'INSERT INTO TEST (id) VALUES (?)', params: [value3, value4, value5, value6]},
137137
];
138138

139139
const res = NitroSQLite.executeSqlBatch('myDatabase', commands);

0 commit comments

Comments
 (0)