Skip to content

Commit c93fd82

Browse files
committed
Merge branch 'main' into nitro-0.20.1
2 parents 428801f + e55e8b2 commit c93fd82

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
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);

package/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ export const NitroSQLite = {
1515
...HybridNitroSQLite,
1616
native: HybridNitroSQLite,
1717
onInitialized,
18-
// Overwrite native functions with session-based JS implementations,
18+
// Overwrite native `open` function with session-based JS abstraction,
1919
// where the database name can be ommited once opened
2020
open,
21+
// More JS abstractions, that perform type casting and validation.
2122
transaction,
2223
execute,
2324
executeAsync,

0 commit comments

Comments
 (0)