|
61 | 61 | query: string, |
62 | 62 | params?: any[] |
63 | 63 | ) => Promise<QueryResult>, |
64 | | - executeBatch: (commands: SQLBatchParams[]) => BatchQueryResult, |
65 | | - executeBatchAsync: (commands: SQLBatchParams[]) => Promise<BatchQueryResult>, |
| 64 | + executeBatch: (commands: BatchQueryCommand[]) => BatchQueryResult, |
| 65 | + executeBatchAsync: (commands: BatchQueryCommand[]) => Promise<BatchQueryResult>, |
66 | 66 | loadFile: (location: string) => FileLoadResult;, |
67 | 67 | loadFileAsync: (location: string) => Promise<FileLoadResult> |
68 | 68 | } |
@@ -130,10 +130,10 @@ Batch execution allows the transactional execution of a set of commands |
130 | 130 |
|
131 | 131 | ```typescript |
132 | 132 | 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]}, |
137 | 137 | ]; |
138 | 138 |
|
139 | 139 | const res = NitroSQLite.executeSqlBatch('myDatabase', commands); |
|
0 commit comments