@lunora/d1 1.0.0-alpha.17 → 1.0.0-alpha.19
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/dialect.d.mts +14 -12
- package/dist/dialect.d.ts +14 -12
- package/dist/dialect.mjs +2 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{exportGlobalRows-BGCPm_nA.mjs → exportGlobalRows-DR6UiAZ8.mjs} +1 -1
- package/dist/packem_shared/quoteIdentifier-B-ZeSe1V.mjs +3 -0
- package/package.json +3 -3
package/dist/dialect.d.mts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* tables are physically shaped in D1.
|
|
2
|
+
* Canonical SQL identifier quoter shared by `@lunora/d1` and `@lunora/do`.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* stay "in lockstep"; this module makes the lockstep structural.
|
|
4
|
+
* Double-quotes a SQL identifier and escapes any embedded double quotes by
|
|
5
|
+
* doubling them (`"` → `""`) — the ANSI/SQLite/Postgres rule. This is a
|
|
6
|
+
* security-relevant primitive (it is the sole defense against identifier
|
|
7
|
+
* injection wherever a table/column name is spliced into raw SQL), so it must
|
|
8
|
+
* have exactly ONE definition rather than byte-identical copies that can drift.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* Like `shared/stable-key.ts`, it is deliberately **not** a package: `@lunora/d1`
|
|
11
|
+
* and `@lunora/do` sit on the same tier with no lower-level package to host it,
|
|
12
|
+
* so each imports this file by relative path and the bundler (packem/rollup)
|
|
13
|
+
* inlines it — no runtime dependency edge, duplicated only in emitted output.
|
|
14
|
+
* Keep it genuinely zero-dependency (relative/built-in imports only) or inlining
|
|
15
|
+
* breaks. Consumers must drop `outDir`/`rootDir` from their `tsconfig.json` (a
|
|
16
|
+
* set `rootDir` raises TS6059 for this out-of-package file under `tsc --noEmit`).
|
|
14
17
|
*/
|
|
18
|
+
declare const quoteIdentifier: (name: string) => string;
|
|
15
19
|
/** SQLite column type affinities Lunora emits. */
|
|
16
20
|
type SqlAffinity = "BLOB" | "INTEGER" | "REAL" | "TEXT";
|
|
17
|
-
/** Double-quote (and escape) a SQL identifier. */
|
|
18
|
-
declare const quoteIdentifier: (name: string) => string;
|
|
19
21
|
/**
|
|
20
22
|
* SQLite affinity for a column by its validator `kind`, chosen so the value the
|
|
21
23
|
* D1 layer serializes round-trips intact:
|
package/dist/dialect.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* tables are physically shaped in D1.
|
|
2
|
+
* Canonical SQL identifier quoter shared by `@lunora/d1` and `@lunora/do`.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* stay "in lockstep"; this module makes the lockstep structural.
|
|
4
|
+
* Double-quotes a SQL identifier and escapes any embedded double quotes by
|
|
5
|
+
* doubling them (`"` → `""`) — the ANSI/SQLite/Postgres rule. This is a
|
|
6
|
+
* security-relevant primitive (it is the sole defense against identifier
|
|
7
|
+
* injection wherever a table/column name is spliced into raw SQL), so it must
|
|
8
|
+
* have exactly ONE definition rather than byte-identical copies that can drift.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* Like `shared/stable-key.ts`, it is deliberately **not** a package: `@lunora/d1`
|
|
11
|
+
* and `@lunora/do` sit on the same tier with no lower-level package to host it,
|
|
12
|
+
* so each imports this file by relative path and the bundler (packem/rollup)
|
|
13
|
+
* inlines it — no runtime dependency edge, duplicated only in emitted output.
|
|
14
|
+
* Keep it genuinely zero-dependency (relative/built-in imports only) or inlining
|
|
15
|
+
* breaks. Consumers must drop `outDir`/`rootDir` from their `tsconfig.json` (a
|
|
16
|
+
* set `rootDir` raises TS6059 for this out-of-package file under `tsc --noEmit`).
|
|
14
17
|
*/
|
|
18
|
+
declare const quoteIdentifier: (name: string) => string;
|
|
15
19
|
/** SQLite column type affinities Lunora emits. */
|
|
16
20
|
type SqlAffinity = "BLOB" | "INTEGER" | "REAL" | "TEXT";
|
|
17
|
-
/** Double-quote (and escape) a SQL identifier. */
|
|
18
|
-
declare const quoteIdentifier: (name: string) => string;
|
|
19
21
|
/**
|
|
20
22
|
* SQLite affinity for a column by its validator `kind`, chosen so the value the
|
|
21
23
|
* D1 layer serializes round-trips intact:
|
package/dist/dialect.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { exportGlobalRows, importGlobalRows, selectGlobalTables } from './packem_shared/exportGlobalRows-
|
|
1
|
+
export { exportGlobalRows, importGlobalRows, selectGlobalTables } from './packem_shared/exportGlobalRows-DR6UiAZ8.mjs';
|
|
2
2
|
export { D1Client, D1Session } from './packem_shared/D1Client-DA3flo1o.mjs';
|
|
3
3
|
export { createD1CtxDb, readD1CdcChanges, runD1AggregateMigrations, runD1CdcMigration, runD1GlobalTableMigrations, runD1RankMigrations, runD1SearchMigrations, trimD1CdcChanges } from './packem_shared/createD1CtxDb-BMR8J0dT.mjs';
|
|
4
4
|
export { facetGlobalColumn, listGlobalTables, readGlobalTablePage } from './packem_shared/facetGlobalColumn-C6u_WMIY.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { quoteIdentifier } from './quoteIdentifier-B-ZeSe1V.mjs';
|
|
1
2
|
import { decodeGlobalRow } from '@lunora/sql-store';
|
|
2
3
|
|
|
3
4
|
const DEFAULT_BATCH_SIZE = 200;
|
|
4
|
-
const quoteIdentifier = (name) => `"${name.replaceAll('"', '""')}"`;
|
|
5
5
|
const selectGlobalTables = (schema, requested) => {
|
|
6
6
|
const isGlobal = (table) => schema.tables[table]?.shardMode?.kind === "global";
|
|
7
7
|
if (requested && requested.length > 0) {
|
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.19",
|
|
4
4
|
"description": "D1 adapter for Lunora .global() tables, wrapping the Sessions API for read-your-writes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@lunora/do": "1.0.0-alpha.
|
|
54
|
-
"@lunora/sql-store": "1.0.0-alpha.
|
|
53
|
+
"@lunora/do": "1.0.0-alpha.19",
|
|
54
|
+
"@lunora/sql-store": "1.0.0-alpha.19",
|
|
55
55
|
"drizzle-orm": "^0.45.2"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|