@lunora/d1 1.0.0-alpha.198 → 1.0.0-alpha.199
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/dist/index.d.mts +11 -8
- package/dist/index.d.ts +11 -8
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -181,10 +181,13 @@ declare class D1Session {
|
|
|
181
181
|
declare class D1Client {
|
|
182
182
|
private readonly db;
|
|
183
183
|
/**
|
|
184
|
-
* SQL string -> prepared statement.
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
184
|
+
* SQL string -> prepared statement. D1 caches compiled statements
|
|
185
|
+
* server-side keyed by the SQL text — the JS `D1PreparedStatement` is
|
|
186
|
+
* inert and every execution carries the text + params over RPC anyway —
|
|
187
|
+
* so this cache buys no round trips: it only avoids re-allocating a
|
|
188
|
+
* statement object per call and hands repeated binds one object to start
|
|
189
|
+
* from. Caching is per-instance so unit-test isolation holds. Bounded to
|
|
190
|
+
* {@link STMT_CACHE_CAPACITY} via LRU eviction.
|
|
188
191
|
*/
|
|
189
192
|
private readonly stmtCache;
|
|
190
193
|
/**
|
|
@@ -208,8 +211,8 @@ declare class D1Client {
|
|
|
208
211
|
/**
|
|
209
212
|
* Prepare a statement, reusing a cached one when the SQL text matches.
|
|
210
213
|
* `bind()` on a prepared statement returns a new bound statement and
|
|
211
|
-
* leaves the
|
|
212
|
-
*
|
|
214
|
+
* leaves the cached one untouched, so cache hits are safe even when the
|
|
215
|
+
* previous caller already called `.bind(...).run()`.
|
|
213
216
|
*/
|
|
214
217
|
prepare(sql: string): D1PreparedStatementLike;
|
|
215
218
|
/**
|
|
@@ -218,7 +221,7 @@ declare class D1Client {
|
|
|
218
221
|
* D1 Sessions API (no bookmark pinning). For bookmark-scoped reads, use
|
|
219
222
|
* {@link drizzleSession} instead.
|
|
220
223
|
*/
|
|
221
|
-
get drizzle(): DrizzleD1Database
|
|
224
|
+
get drizzle(): DrizzleD1Database;
|
|
222
225
|
/**
|
|
223
226
|
* Drizzle handle scoped to a D1 Sessions-API session. The bookmark, when
|
|
224
227
|
* supplied, opts into read-your-writes consistency for follow-up reads on
|
|
@@ -228,7 +231,7 @@ declare class D1Client {
|
|
|
228
231
|
* drizzle calls into, so a single `unknown` cast lets us hand the session to
|
|
229
232
|
* the driver.
|
|
230
233
|
*/
|
|
231
|
-
drizzleSession(bookmark?: string): DrizzleD1Database
|
|
234
|
+
drizzleSession(bookmark?: string): DrizzleD1Database;
|
|
232
235
|
/**
|
|
233
236
|
* Atomic batch over the drizzle d1 driver. Mirrors `db.batch([...])`
|
|
234
237
|
* exactly; exposed on the client so callers don't need to hold a drizzle
|
package/dist/index.d.ts
CHANGED
|
@@ -181,10 +181,13 @@ declare class D1Session {
|
|
|
181
181
|
declare class D1Client {
|
|
182
182
|
private readonly db;
|
|
183
183
|
/**
|
|
184
|
-
* SQL string -> prepared statement.
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
184
|
+
* SQL string -> prepared statement. D1 caches compiled statements
|
|
185
|
+
* server-side keyed by the SQL text — the JS `D1PreparedStatement` is
|
|
186
|
+
* inert and every execution carries the text + params over RPC anyway —
|
|
187
|
+
* so this cache buys no round trips: it only avoids re-allocating a
|
|
188
|
+
* statement object per call and hands repeated binds one object to start
|
|
189
|
+
* from. Caching is per-instance so unit-test isolation holds. Bounded to
|
|
190
|
+
* {@link STMT_CACHE_CAPACITY} via LRU eviction.
|
|
188
191
|
*/
|
|
189
192
|
private readonly stmtCache;
|
|
190
193
|
/**
|
|
@@ -208,8 +211,8 @@ declare class D1Client {
|
|
|
208
211
|
/**
|
|
209
212
|
* Prepare a statement, reusing a cached one when the SQL text matches.
|
|
210
213
|
* `bind()` on a prepared statement returns a new bound statement and
|
|
211
|
-
* leaves the
|
|
212
|
-
*
|
|
214
|
+
* leaves the cached one untouched, so cache hits are safe even when the
|
|
215
|
+
* previous caller already called `.bind(...).run()`.
|
|
213
216
|
*/
|
|
214
217
|
prepare(sql: string): D1PreparedStatementLike;
|
|
215
218
|
/**
|
|
@@ -218,7 +221,7 @@ declare class D1Client {
|
|
|
218
221
|
* D1 Sessions API (no bookmark pinning). For bookmark-scoped reads, use
|
|
219
222
|
* {@link drizzleSession} instead.
|
|
220
223
|
*/
|
|
221
|
-
get drizzle(): DrizzleD1Database
|
|
224
|
+
get drizzle(): DrizzleD1Database;
|
|
222
225
|
/**
|
|
223
226
|
* Drizzle handle scoped to a D1 Sessions-API session. The bookmark, when
|
|
224
227
|
* supplied, opts into read-your-writes consistency for follow-up reads on
|
|
@@ -228,7 +231,7 @@ declare class D1Client {
|
|
|
228
231
|
* drizzle calls into, so a single `unknown` cast lets us hand the session to
|
|
229
232
|
* the driver.
|
|
230
233
|
*/
|
|
231
|
-
drizzleSession(bookmark?: string): DrizzleD1Database
|
|
234
|
+
drizzleSession(bookmark?: string): DrizzleD1Database;
|
|
232
235
|
/**
|
|
233
236
|
* Atomic batch over the drizzle d1 driver. Mirrors `db.batch([...])`
|
|
234
237
|
* exactly; exposed on the client so callers don't need to hold a drizzle
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/d1",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.199",
|
|
4
4
|
"description": "D1 adapter for Lunora .global() tables, wrapping the Sessions API for read-your-writes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
54
54
|
"@lunora/platform": "1.0.0-alpha.73",
|
|
55
|
-
"@lunora/shard-engine": "1.0.0-alpha.
|
|
56
|
-
"@lunora/sql-store": "1.0.0-alpha.
|
|
55
|
+
"@lunora/shard-engine": "1.0.0-alpha.151",
|
|
56
|
+
"@lunora/sql-store": "1.0.0-alpha.200",
|
|
57
57
|
"@lunora/wire": "1.0.0-alpha.2",
|
|
58
|
-
"drizzle-orm": "
|
|
58
|
+
"drizzle-orm": "1.0.0-rc.5"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": "^22.15.0 || >=24.11.0"
|