@@ -71,7 +71,6 @@ Or specify individual permissions:
7171 " sqlite:allow-load" ,
7272 " sqlite:allow-fetch-one" ,
7373 " sqlite:allow-fetch-all" ,
74- // etc.
7574 ]
7675}
7776```
@@ -187,14 +186,14 @@ All query methods use `$1`, `$2`, etc. syntax with `SqlValue` types:
187186type SqlValue = string | number | boolean | null | Uint8Array
188187` ` `
189188
190- | SQLite Type | TypeScript Type | Notes |
191- | ----------- | --------------- | ----- |
192- | TEXT | ` string ` | Also for DATE, TIME, DATETIME |
193- | INTEGER | ` number ` | Integers preserved up to i64 range |
194- | REAL | ` number ` | Floating point |
195- | BOOLEAN | ` boolean ` | |
196- | NULL | ` null ` | |
197- | BLOB | ` Uint8Array ` | Binary data |
189+ | SQLite Type | TypeScript Type | Notes |
190+ | ----------- | --------------- | ----------------------------------- |
191+ | TEXT | ` string ` | Also for DATE, TIME, DATETIME |
192+ | INTEGER | ` number ` | Integers preserved up to i64 range |
193+ | REAL | ` number ` | Floating point |
194+ | BOOLEAN | ` boolean ` | |
195+ | NULL | ` null ` | |
196+ | BLOB | ` Uint8Array ` | Binary data |
198197
199198> **Note:** JavaScript safely represents integers up to ±2^53 - 1. The plugin binds
200199> integers as SQLite's INTEGER type (i64), maintaining full precision within that range.
@@ -255,7 +254,7 @@ generated ID or other computed values, then using that data in subsequent writes
255254
256255``` typescript
257256// Begin transaction with initial insert
258- const tx = await db .executeInterruptibleTransaction ([
257+ let tx = await db .executeInterruptibleTransaction ([
259258 [' INSERT INTO orders (user_id, total) VALUES ($1, $2)' , [userId , 0 ]]
260259])
261260
@@ -267,13 +266,13 @@ const orders = await tx.read<Array<{ id: number }>>(
267266const orderId = orders [0 ].id
268267
269268// Continue transaction with the order ID
270- const tx2 = await tx .continue ([
269+ tx = await tx .continue ([
271270 [' INSERT INTO order_items (order_id, product_id) VALUES ($1, $2)' , [orderId , productId ]],
272271 [' UPDATE orders SET total = $1 WHERE id = $2' , [itemTotal , orderId ]]
273272])
274273
275274// Commit the transaction
276- await tx2 .commit ()
275+ await tx .commit ()
277276```
278277
279278** Important:**
@@ -390,6 +389,7 @@ fn init_tracing() {
390389 use tracing_subscriber :: {fmt, EnvFilter };
391390 let filter = EnvFilter :: try_from_default_env ()
392391 . unwrap_or_else (| _ | EnvFilter :: new (" trace" ));
392+
393393 fmt (). with_env_filter (filter ). compact (). init ();
394394}
395395
0 commit comments