@tursodatabase/database-common 0.7.0-pre.2 → 0.7.0-pre.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/compat.d.ts +16 -1
- package/dist/compat.d.ts.map +1 -1
- package/dist/compat.js +112 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/promise.d.ts +26 -12
- package/dist/promise.d.ts.map +1 -1
- package/dist/promise.js +67 -31
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,5 +4,5 @@ This package is the Turso embedded database common JS library which is shared be
|
|
|
4
4
|
|
|
5
5
|
Do not use this package directly - instead you must use `@tursodatabase/database` or `@tursodatabase/database-wasm`.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Turso Database runs in production today at multiple organizations. It has not yet reached 1.0, so as with any database we recommend keeping backups — see the [FAQ](https://github.com/tursodatabase/turso#faq) for where the project stands.
|
|
8
8
|
|
package/dist/compat.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { NativeDatabase, NativeStatement, QueryOptions } from "./types.js";
|
|
2
|
+
export type BatchMode = "write" | "read" | "deferred" | "immediate" | "exclusive" | "concurrent" | string;
|
|
3
|
+
export interface BatchOptions {
|
|
4
|
+
mode?: BatchMode;
|
|
5
|
+
raw?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type BatchRow = Record<string, any> | any[];
|
|
8
|
+
export interface ResultSet {
|
|
9
|
+
columns: Array<string>;
|
|
10
|
+
columnTypes: Array<string>;
|
|
11
|
+
rows: Array<BatchRow>;
|
|
12
|
+
rowsAffected: number;
|
|
13
|
+
}
|
|
2
14
|
/**
|
|
3
15
|
* Database represents a connection that can prepare and execute SQL statements.
|
|
4
16
|
*/
|
|
@@ -9,7 +21,6 @@ declare class Database {
|
|
|
9
21
|
memory: boolean;
|
|
10
22
|
inTransaction: boolean;
|
|
11
23
|
private db;
|
|
12
|
-
private _inTransaction;
|
|
13
24
|
/**
|
|
14
25
|
* Creates a new database connection. If the database file pointed to by `path` does not exists, it will be created.
|
|
15
26
|
*
|
|
@@ -49,6 +60,10 @@ declare class Database {
|
|
|
49
60
|
* @param {string} sql - The string containing SQL statements to execute
|
|
50
61
|
*/
|
|
51
62
|
exec(sql: any, queryOptions?: QueryOptions): void;
|
|
63
|
+
batch(statements: Array<string | {
|
|
64
|
+
sql: string;
|
|
65
|
+
args?: any[] | Record<string, any>;
|
|
66
|
+
}>, options?: BatchMode | BatchOptions): ResultSet[];
|
|
52
67
|
/**
|
|
53
68
|
* Interrupts the database connection.
|
|
54
69
|
*/
|
package/dist/compat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../compat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAgC,MAAM,YAAY,CAAC;AAoDzG;;GAEG;AACH,cAAM,QAAQ;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IAEvB,OAAO,CAAC,EAAE,CAAiB;
|
|
1
|
+
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../compat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAgC,MAAM,YAAY,CAAC;AAoDzG,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM,CAAC;AAE1G,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,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CAAA;KAAE,CAAC,EAC/E,OAAO,CAAC,EAAE,SAAS,GAAG,YAAY,GACjC,SAAS,EAAE;IA2Ed;;OAEG;IACH,SAAS;IAIT;;;;OAIG;IACH,mBAAmB,CAAC,MAAM,KAAA;IAI1B;;OAEG;IACH,KAAK;CAGN;AAED;;GAEG;AACH,cAAM,SAAS;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,cAAc,CAAC;gBAEP,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,cAAc;IAKrD;;;;OAIG;IACH,GAAG,CAAC,GAAG,KAAA;IAKP;;;;OAIG;IACH,KAAK,CAAC,SAAS,KAAA;IAKf;;;;OAIG;IACH,YAAY,CAAC,MAAM,KAAA;IAKnB;;;;OAIG;IACH,OAAO;IAIP,IAAI,MAAM,SAET;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,QAAQ,mBAEX;IAED;;OAEG;IACH,GAAG,CAAC,GAAG,cAAc,OAAA;;;;IA4BrB;;;;OAIG;IACH,GAAG,CAAC,GAAG,cAAc,OAAA;IAsBrB;;;;OAIG;IACF,OAAO,CAAC,GAAG,cAAc,OAAA;IAqB1B;;;;OAIG;IACH,GAAG,CAAC,GAAG,cAAc,OAAA;IAsBrB;;OAEG;IACH,SAAS;IAKT;;;;;OAKG;IACH,IAAI,CAAC,GAAG,cAAc,OAAA;IAStB,KAAK;CAGN;AAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAA"}
|
package/dist/compat.js
CHANGED
|
@@ -40,6 +40,43 @@ function toBindArgs(params) {
|
|
|
40
40
|
}
|
|
41
41
|
return [params];
|
|
42
42
|
}
|
|
43
|
+
function normalizeBatchMode(mode) {
|
|
44
|
+
switch (String(mode).toLowerCase()) {
|
|
45
|
+
case "write":
|
|
46
|
+
return "IMMEDIATE";
|
|
47
|
+
case "read":
|
|
48
|
+
case "deferred":
|
|
49
|
+
return "DEFERRED";
|
|
50
|
+
case "immediate":
|
|
51
|
+
return "IMMEDIATE";
|
|
52
|
+
case "exclusive":
|
|
53
|
+
return "EXCLUSIVE";
|
|
54
|
+
case "concurrent":
|
|
55
|
+
return "CONCURRENT";
|
|
56
|
+
default:
|
|
57
|
+
return String(mode).toUpperCase();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function normalizeBatchOptions(options) {
|
|
61
|
+
if (options != null && typeof options === "object") {
|
|
62
|
+
return {
|
|
63
|
+
mode: options.mode,
|
|
64
|
+
raw: options.raw === true,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
mode: options,
|
|
69
|
+
raw: false,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function makeResultSet(columns, columnTypes, rows, rowsAffected) {
|
|
73
|
+
return {
|
|
74
|
+
columns,
|
|
75
|
+
columnTypes,
|
|
76
|
+
rows,
|
|
77
|
+
rowsAffected,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
43
80
|
/**
|
|
44
81
|
* Database represents a connection that can prepare and execute SQL statements.
|
|
45
82
|
*/
|
|
@@ -50,7 +87,6 @@ class Database {
|
|
|
50
87
|
memory;
|
|
51
88
|
inTransaction;
|
|
52
89
|
db;
|
|
53
|
-
_inTransaction = false;
|
|
54
90
|
/**
|
|
55
91
|
* Creates a new database connection. If the database file pointed to by `path` does not exists, it will be created.
|
|
56
92
|
*
|
|
@@ -70,7 +106,7 @@ class Database {
|
|
|
70
106
|
readonly: { get: () => this.db.readonly },
|
|
71
107
|
open: { get: () => this.db.open },
|
|
72
108
|
memory: { get: () => this.db.memory },
|
|
73
|
-
inTransaction: { get: () => this.
|
|
109
|
+
inTransaction: { get: () => this.db.inTransaction() },
|
|
74
110
|
});
|
|
75
111
|
}
|
|
76
112
|
/**
|
|
@@ -104,16 +140,13 @@ class Database {
|
|
|
104
140
|
const wrapTxn = (mode) => {
|
|
105
141
|
return (...bindParameters) => {
|
|
106
142
|
db.exec("BEGIN " + mode);
|
|
107
|
-
db._inTransaction = true;
|
|
108
143
|
try {
|
|
109
144
|
const result = fn(...bindParameters);
|
|
110
145
|
db.exec("COMMIT");
|
|
111
|
-
db._inTransaction = false;
|
|
112
146
|
return result;
|
|
113
147
|
}
|
|
114
148
|
catch (err) {
|
|
115
149
|
db.exec("ROLLBACK");
|
|
116
|
-
db._inTransaction = false;
|
|
117
150
|
throw err;
|
|
118
151
|
}
|
|
119
152
|
};
|
|
@@ -200,6 +233,80 @@ class Database {
|
|
|
200
233
|
exec.reset();
|
|
201
234
|
}
|
|
202
235
|
}
|
|
236
|
+
batch(statements, options) {
|
|
237
|
+
if (!Array.isArray(statements)) {
|
|
238
|
+
throw new TypeError("Expected first argument to be an array of statements");
|
|
239
|
+
}
|
|
240
|
+
if (!this.open) {
|
|
241
|
+
throw new TypeError("The database connection is not open");
|
|
242
|
+
}
|
|
243
|
+
const { mode, raw } = normalizeBatchOptions(options);
|
|
244
|
+
const wrap = mode != null && !this.db.inTransaction();
|
|
245
|
+
if (wrap) {
|
|
246
|
+
this.exec(`BEGIN ${normalizeBatchMode(mode)}`);
|
|
247
|
+
}
|
|
248
|
+
const results = [];
|
|
249
|
+
try {
|
|
250
|
+
for (const statement of statements) {
|
|
251
|
+
const sql = typeof statement === "string" ? statement : statement.sql;
|
|
252
|
+
const args = typeof statement === "string" ? undefined : statement.args;
|
|
253
|
+
const stmt = this.db.prepare(sql);
|
|
254
|
+
try {
|
|
255
|
+
if (args !== undefined) {
|
|
256
|
+
bindParams(stmt, [args]);
|
|
257
|
+
}
|
|
258
|
+
const cols = stmt.columns();
|
|
259
|
+
const columnNames = cols.map((c) => c.name);
|
|
260
|
+
const columnTypes = cols.map((c) => c.type ?? "");
|
|
261
|
+
if (columnNames.length > 0) {
|
|
262
|
+
stmt.raw(raw);
|
|
263
|
+
}
|
|
264
|
+
const totalChangesBefore = this.db.totalChanges();
|
|
265
|
+
const rows = [];
|
|
266
|
+
try {
|
|
267
|
+
while (true) {
|
|
268
|
+
const stepResult = stmt.stepSync();
|
|
269
|
+
if (stepResult === STEP_IO) {
|
|
270
|
+
this.db.ioLoopSync();
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
if (stepResult === STEP_DONE) {
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
if (stepResult === STEP_ROW) {
|
|
277
|
+
rows.push(stmt.row());
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
const rowsAffected = columnNames.length > 0
|
|
281
|
+
? 0
|
|
282
|
+
: this.db.totalChanges() !== totalChangesBefore ? this.db.changes() : 0;
|
|
283
|
+
results.push(makeResultSet(columnNames, columnTypes, rows, rowsAffected));
|
|
284
|
+
}
|
|
285
|
+
finally {
|
|
286
|
+
stmt.reset();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
finally {
|
|
290
|
+
stmt.finalize();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (wrap) {
|
|
294
|
+
this.exec("COMMIT");
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
catch (err) {
|
|
298
|
+
if (wrap) {
|
|
299
|
+
try {
|
|
300
|
+
this.exec("ROLLBACK");
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
// Keep the original statement error.
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
throw convertError(err);
|
|
307
|
+
}
|
|
308
|
+
return results;
|
|
309
|
+
}
|
|
203
310
|
/**
|
|
204
311
|
* Interrupts the database connection.
|
|
205
312
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NativeDatabase, NativeStatement, DatabaseOpts, EncryptionCipher, EncryptionOpts } from "./types.js";
|
|
1
|
+
import { NativeDatabase, NativeStatement, DatabaseOpts, EncryptionCipher, EncryptionOpts, ExperimentalFeature } from "./types.js";
|
|
2
2
|
import { Database as DatabaseCompat, Statement as StatementCompat } from "./compat.js";
|
|
3
3
|
import { Database as DatabasePromise, Statement as StatementPromise, TransactionFunction } from "./promise.js";
|
|
4
4
|
import { SqliteError } from "./sqlite-error.js";
|
|
5
5
|
import { AsyncLock } from "./async-lock.js";
|
|
6
|
-
export { DatabaseOpts, EncryptionCipher, EncryptionOpts, DatabaseCompat, StatementCompat, DatabasePromise, StatementPromise, TransactionFunction, NativeDatabase, NativeStatement, SqliteError, AsyncLock };
|
|
6
|
+
export { DatabaseOpts, ExperimentalFeature, EncryptionCipher, EncryptionOpts, DatabaseCompat, StatementCompat, DatabasePromise, StatementPromise, TransactionFunction, NativeDatabase, NativeStatement, SqliteError, AsyncLock };
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAClI,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,SAAS,IAAI,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,cAAc,EAAE,eAAe,EAC/B,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EACtD,cAAc,EAAE,eAAe,EAC/B,WAAW,EACX,SAAS,EACZ,CAAA"}
|
package/dist/promise.d.ts
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { AsyncLock } from "./async-lock.js";
|
|
2
2
|
import { NativeDatabase, NativeStatement, QueryOptions } from "./types.js";
|
|
3
3
|
/**
|
|
4
|
-
* Locking mode for `Database.batch(stmts,
|
|
5
|
-
* `Database.transaction(...)`. When passed to `batch()`, the statements are
|
|
6
|
-
* wrapped in `BEGIN <mode>` / `COMMIT` (with `ROLLBACK` on failure).
|
|
4
|
+
* Locking mode for `Database.batch(stmts, options)`.
|
|
7
5
|
*/
|
|
8
|
-
export type BatchMode = "deferred" | "immediate" | "exclusive" | "concurrent";
|
|
6
|
+
export type BatchMode = "write" | "read" | "deferred" | "immediate" | "exclusive" | "concurrent" | string;
|
|
7
|
+
export interface BatchOptions {
|
|
8
|
+
mode?: BatchMode;
|
|
9
|
+
raw?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type BatchRow = Record<string, any> | any[];
|
|
12
|
+
/**
|
|
13
|
+
* The result of executing a single statement within `batch()`, matching the
|
|
14
|
+
* libSQL client's `ResultSet` shape.
|
|
15
|
+
*/
|
|
16
|
+
export interface ResultSet {
|
|
17
|
+
/** Column names of the result, empty for statements that return no rows. */
|
|
18
|
+
columns: Array<string>;
|
|
19
|
+
/** Declared column types, parallel to `columns`. */
|
|
20
|
+
columnTypes: Array<string>;
|
|
21
|
+
/** Result rows; empty for non-SELECT statements. */
|
|
22
|
+
rows: Array<BatchRow>;
|
|
23
|
+
/** Number of rows changed by the statement (0 for SELECT). */
|
|
24
|
+
rowsAffected: number;
|
|
25
|
+
}
|
|
9
26
|
/**
|
|
10
27
|
* A wrapped transaction function. Calling it runs the wrapped function inside a
|
|
11
28
|
* `BEGIN`/`COMMIT` block; the mode properties (`deferred`, `concurrent`, etc.)
|
|
@@ -32,8 +49,7 @@ declare class Database {
|
|
|
32
49
|
inTransaction: boolean;
|
|
33
50
|
private db;
|
|
34
51
|
private ioStep;
|
|
35
|
-
|
|
36
|
-
private _inTransaction;
|
|
52
|
+
protected execLock: AsyncLock;
|
|
37
53
|
protected connected: boolean;
|
|
38
54
|
constructor(db: NativeDatabase, ioStep?: () => Promise<void>);
|
|
39
55
|
/**
|
|
@@ -75,8 +91,9 @@ declare class Database {
|
|
|
75
91
|
* @param mode - When set, wraps the batch in `BEGIN <mode>` / `COMMIT`
|
|
76
92
|
* (with `ROLLBACK` on failure). Ignored when already inside a
|
|
77
93
|
* transaction.
|
|
78
|
-
* @returns An
|
|
79
|
-
*
|
|
94
|
+
* @returns An array of `ResultSet`s — one per input statement, in order —
|
|
95
|
+
* matching the libsql-js batch contract. Each `ResultSet` carries that
|
|
96
|
+
* statement's `columns`, `columnTypes`, `rows`, and `rowsAffected`.
|
|
80
97
|
*
|
|
81
98
|
* @example
|
|
82
99
|
* // Plain SQL strings (non-atomic).
|
|
@@ -110,10 +127,7 @@ declare class Database {
|
|
|
110
127
|
batch(statements: Array<string | {
|
|
111
128
|
sql: string;
|
|
112
129
|
args?: any[] | Record<string, any>;
|
|
113
|
-
}>,
|
|
114
|
-
rowsAffected: number;
|
|
115
|
-
lastInsertRowid: number | bigint | undefined;
|
|
116
|
-
}>;
|
|
130
|
+
}>, options?: BatchMode | BatchOptions): Promise<ResultSet[]>;
|
|
117
131
|
/**
|
|
118
132
|
* Prepares the SQL and executes it as `Statement.run`, returning the run info.
|
|
119
133
|
*
|
package/dist/promise.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../promise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAA8C,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../promise.ts"],"names":[],"mappings":"AAAA,OAAO,E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B;gBAExB,IAAI,EAAE,SAAS,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAOlH;;;;OAIG;IACH,GAAG,CAAC,GAAG,KAAA;IAKP;;;;OAIG;IACH,KAAK,CAAC,SAAS,KAAA;IAKf;;;;OAIG;IACH,YAAY,CAAC,MAAM,KAAA;IAKnB;;;;OAIG;IACH,OAAO;IAIP,IAAI,MAAM,SAET;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,QAAQ,mBAEX;IAED;;OAEG;IACG,GAAG,CAAC,GAAG,cAAc,OAAA;;;;IAmC3B;;;;OAIG;IACG,GAAG,CAAC,GAAG,cAAc,OAAA;IA+B3B;;;;OAIG;IACI,OAAO,CAAC,GAAG,cAAc,OAAA;IA4BhC;;;;OAIG;IACG,GAAG,CAAC,GAAG,cAAc,OAAA;IA+BrB,EAAE;IAIR;;OAEG;IACH,SAAS;IAKT;;;;;OAKG;IACH,IAAI,CAAC,GAAG,cAAc,OAAA;IAStB,KAAK;CAUN;AAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,CAAA"}
|
package/dist/promise.js
CHANGED
|
@@ -41,6 +41,46 @@ function toBindArgs(params) {
|
|
|
41
41
|
}
|
|
42
42
|
return [params];
|
|
43
43
|
}
|
|
44
|
+
function normalizeBatchMode(mode) {
|
|
45
|
+
switch (String(mode).toLowerCase()) {
|
|
46
|
+
case "write":
|
|
47
|
+
return "IMMEDIATE";
|
|
48
|
+
case "read":
|
|
49
|
+
case "deferred":
|
|
50
|
+
return "DEFERRED";
|
|
51
|
+
case "immediate":
|
|
52
|
+
return "IMMEDIATE";
|
|
53
|
+
case "exclusive":
|
|
54
|
+
return "EXCLUSIVE";
|
|
55
|
+
case "concurrent":
|
|
56
|
+
return "CONCURRENT";
|
|
57
|
+
default:
|
|
58
|
+
return String(mode).toUpperCase();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function normalizeBatchOptions(options) {
|
|
62
|
+
if (options != null && typeof options === "object") {
|
|
63
|
+
return {
|
|
64
|
+
mode: options.mode,
|
|
65
|
+
raw: options.raw === true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
mode: options,
|
|
70
|
+
raw: false,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Builds a libSQL-style `ResultSet` for a single statement in a `batch()`.
|
|
75
|
+
*/
|
|
76
|
+
function makeResultSet(columns, columnTypes, rows, rowsAffected) {
|
|
77
|
+
return {
|
|
78
|
+
columns,
|
|
79
|
+
columnTypes,
|
|
80
|
+
rows,
|
|
81
|
+
rowsAffected,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
44
84
|
/**
|
|
45
85
|
* Database represents a connection that can prepare and execute SQL statements.
|
|
46
86
|
*/
|
|
@@ -52,8 +92,12 @@ class Database {
|
|
|
52
92
|
inTransaction;
|
|
53
93
|
db;
|
|
54
94
|
ioStep;
|
|
95
|
+
// Serializes native calls on this connection. Subclasses that also drive
|
|
96
|
+
// the same underlying core database from async worker tasks (the sync
|
|
97
|
+
// engine on wasm) must hold this lock around those windows too: on
|
|
98
|
+
// browser wasm the main thread cannot block on a contended core lock, so
|
|
99
|
+
// main-thread native calls must never overlap an in-flight worker task.
|
|
55
100
|
execLock;
|
|
56
|
-
_inTransaction = false;
|
|
57
101
|
connected = false;
|
|
58
102
|
constructor(db, ioStep) {
|
|
59
103
|
this.db = db;
|
|
@@ -64,7 +108,7 @@ class Database {
|
|
|
64
108
|
readonly: { get: () => this.db.readonly },
|
|
65
109
|
open: { get: () => this.db.open },
|
|
66
110
|
memory: { get: () => this.db.memory },
|
|
67
|
-
inTransaction: { get: () => this.
|
|
111
|
+
inTransaction: { get: () => this.db.inTransaction() },
|
|
68
112
|
});
|
|
69
113
|
}
|
|
70
114
|
/**
|
|
@@ -115,16 +159,13 @@ class Database {
|
|
|
115
159
|
const wrapTxn = (mode) => {
|
|
116
160
|
return async (...bindParameters) => {
|
|
117
161
|
await db.exec("BEGIN " + mode);
|
|
118
|
-
db._inTransaction = true;
|
|
119
162
|
try {
|
|
120
163
|
const result = await fn(...bindParameters);
|
|
121
164
|
await db.exec("COMMIT");
|
|
122
|
-
db._inTransaction = false;
|
|
123
165
|
return result;
|
|
124
166
|
}
|
|
125
167
|
catch (err) {
|
|
126
168
|
await db.exec("ROLLBACK");
|
|
127
|
-
db._inTransaction = false;
|
|
128
169
|
throw err;
|
|
129
170
|
}
|
|
130
171
|
};
|
|
@@ -167,8 +208,9 @@ class Database {
|
|
|
167
208
|
* @param mode - When set, wraps the batch in `BEGIN <mode>` / `COMMIT`
|
|
168
209
|
* (with `ROLLBACK` on failure). Ignored when already inside a
|
|
169
210
|
* transaction.
|
|
170
|
-
* @returns An
|
|
171
|
-
*
|
|
211
|
+
* @returns An array of `ResultSet`s — one per input statement, in order —
|
|
212
|
+
* matching the libsql-js batch contract. Each `ResultSet` carries that
|
|
213
|
+
* statement's `columns`, `columnTypes`, `rows`, and `rowsAffected`.
|
|
172
214
|
*
|
|
173
215
|
* @example
|
|
174
216
|
* // Plain SQL strings (non-atomic).
|
|
@@ -199,7 +241,7 @@ class Database {
|
|
|
199
241
|
* });
|
|
200
242
|
* await txn.immediate();
|
|
201
243
|
*/
|
|
202
|
-
async batch(statements,
|
|
244
|
+
async batch(statements, options) {
|
|
203
245
|
if (!Array.isArray(statements)) {
|
|
204
246
|
throw new TypeError("Expected first argument to be an array of statements");
|
|
205
247
|
}
|
|
@@ -232,13 +274,12 @@ class Database {
|
|
|
232
274
|
exec.reset();
|
|
233
275
|
}
|
|
234
276
|
};
|
|
235
|
-
const
|
|
277
|
+
const { mode, raw } = normalizeBatchOptions(options);
|
|
278
|
+
const wrap = mode != null && !this.db.inTransaction();
|
|
236
279
|
if (wrap) {
|
|
237
|
-
await runRawSql(`BEGIN ${mode
|
|
238
|
-
this._inTransaction = true;
|
|
280
|
+
await runRawSql(`BEGIN ${normalizeBatchMode(mode)}`);
|
|
239
281
|
}
|
|
240
|
-
|
|
241
|
-
let lastInsertRowid;
|
|
282
|
+
const results = [];
|
|
242
283
|
try {
|
|
243
284
|
for (const statement of statements) {
|
|
244
285
|
const sql = typeof statement === "string" ? statement : statement.sql;
|
|
@@ -254,8 +295,14 @@ class Database {
|
|
|
254
295
|
if (args !== undefined) {
|
|
255
296
|
bindParams(nativeStmt, [args]);
|
|
256
297
|
}
|
|
298
|
+
const cols = nativeStmt.columns();
|
|
299
|
+
const columnNames = cols.map((c) => c.name);
|
|
300
|
+
const columnTypes = cols.map((c) => c.type ?? "");
|
|
301
|
+
if (columnNames.length > 0) {
|
|
302
|
+
nativeStmt.raw(raw);
|
|
303
|
+
}
|
|
257
304
|
const totalChangesBefore = this.db.totalChanges();
|
|
258
|
-
const
|
|
305
|
+
const rows = [];
|
|
259
306
|
try {
|
|
260
307
|
while (true) {
|
|
261
308
|
const stepResult = await nativeStmt.stepSync();
|
|
@@ -266,21 +313,12 @@ class Database {
|
|
|
266
313
|
if (stepResult === STEP_DONE) {
|
|
267
314
|
break;
|
|
268
315
|
}
|
|
269
|
-
|
|
270
|
-
// surface rows.
|
|
271
|
-
}
|
|
272
|
-
if (this.db.totalChanges() !== totalChangesBefore) {
|
|
273
|
-
rowsAffected += this.db.changes();
|
|
274
|
-
}
|
|
275
|
-
// SQLite keeps last_insert_rowid() sticky across
|
|
276
|
-
// non-INSERT statements, so just checking the value is
|
|
277
|
-
// not enough — UPDATE/DELETE would inherit a stale
|
|
278
|
-
// rowid. Use the delta as the per-statement INSERT
|
|
279
|
-
// signal.
|
|
280
|
-
const lastInsertRowidAfter = this.db.lastInsertRowid();
|
|
281
|
-
if (lastInsertRowidAfter !== lastInsertRowidBefore) {
|
|
282
|
-
lastInsertRowid = lastInsertRowidAfter;
|
|
316
|
+
rows.push(nativeStmt.row());
|
|
283
317
|
}
|
|
318
|
+
const rowsAffected = columnNames.length > 0
|
|
319
|
+
? 0
|
|
320
|
+
: this.db.totalChanges() !== totalChangesBefore ? this.db.changes() : 0;
|
|
321
|
+
results.push(makeResultSet(columnNames, columnTypes, rows, rowsAffected));
|
|
284
322
|
}
|
|
285
323
|
finally {
|
|
286
324
|
nativeStmt.reset();
|
|
@@ -292,7 +330,6 @@ class Database {
|
|
|
292
330
|
}
|
|
293
331
|
if (wrap) {
|
|
294
332
|
await runRawSql("COMMIT");
|
|
295
|
-
this._inTransaction = false;
|
|
296
333
|
}
|
|
297
334
|
}
|
|
298
335
|
catch (err) {
|
|
@@ -301,11 +338,10 @@ class Database {
|
|
|
301
338
|
await runRawSql("ROLLBACK");
|
|
302
339
|
}
|
|
303
340
|
catch { /* ignore */ }
|
|
304
|
-
this._inTransaction = false;
|
|
305
341
|
}
|
|
306
342
|
throw err;
|
|
307
343
|
}
|
|
308
|
-
return
|
|
344
|
+
return results;
|
|
309
345
|
}
|
|
310
346
|
finally {
|
|
311
347
|
this.execLock.release();
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ExperimentalFeature = 'views' | 'strict' | 'encryption' | 'index_method' | 'autovacuum' | 'vacuum' | 'triggers' | 'attach' | 'multiprocess_wal' | 'without_rowid';
|
|
1
|
+
export type ExperimentalFeature = 'views' | 'strict' | 'encryption' | 'index_method' | 'custom_types' | 'autovacuum' | 'vacuum' | 'triggers' | 'attach' | 'generated_columns' | 'multiprocess_wal' | 'without_rowid';
|
|
2
2
|
/** Supported encryption ciphers for local database encryption. */
|
|
3
3
|
export type EncryptionCipher = 'aes128gcm' | 'aes256gcm' | 'aegis256' | 'aegis256x2' | 'aegis128l' | 'aegis128x2' | 'aegis128x4';
|
|
4
4
|
/** Encryption configuration for local encryption. */
|
|
@@ -36,6 +36,7 @@ export interface NativeDatabase {
|
|
|
36
36
|
prepare(sql: string): NativeStatement;
|
|
37
37
|
executor(sql: string, queryOptions?: QueryOptions): NativeExecutor;
|
|
38
38
|
defaultSafeIntegers(toggle: boolean): any;
|
|
39
|
+
inTransaction(): boolean;
|
|
39
40
|
totalChanges(): number;
|
|
40
41
|
changes(): number;
|
|
41
42
|
lastInsertRowid(): number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,kBAAkB,GAAG,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,cAAc,GAAG,cAAc,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAErN,kEAAkE;AAClE,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAA;AAEhI,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,gBAAgB,CAAA;IACxB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;IACpC,sCAAsC;IACtC,YAAY,CAAC,EAAE,m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