@prisma/orm-target-sqlite 8.0.0-rc.1-dev.3 → 8.0.0-rc.1-dev.5
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/{adapter-Dq0Gn7Uz-ChiMxJBJ.mjs → adapter-Dq0Gn7Uz-DMsm-8_y.mjs} +4 -4
- package/dist/{adapter-Dq0Gn7Uz-ChiMxJBJ.mjs.map → adapter-Dq0Gn7Uz-DMsm-8_y.mjs.map} +1 -1
- package/dist/adapter.d.mts +3 -3
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__column-types.mjs +1 -1
- package/dist/adapter__control.mjs +3 -3
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{aggregates-CTDRDyvD.mjs → aggregates-Cy5ovVZD.mjs} +4 -3
- package/dist/aggregates-Cy5ovVZD.mjs.map +1 -0
- package/dist/codec-ids-7WqtUuda.d.mts +1 -0
- package/dist/{codec-ids-DocGjhs--CHhP1jNZ.d.mts → codec-ids-CzeDyMWW-BZAcI50I.d.mts} +4 -3
- package/dist/codec-ids-CzeDyMWW-BZAcI50I.d.mts.map +1 -0
- package/dist/codec-ids-KMliSCRp-BhTbmbGr.mjs +14 -0
- package/dist/codec-ids-KMliSCRp-BhTbmbGr.mjs.map +1 -0
- package/dist/codec-types-B-TDcvQc.d.mts +1 -0
- package/dist/codec-types-CS0bD1kX.d.mts +2 -0
- package/dist/{codec-types-DOyikA9Q-DVHiIZxI.d.mts → codec-types-D7uWRvQ1-DPnvquS8.d.mts} +4 -3
- package/dist/codec-types-D7uWRvQ1-DPnvquS8.d.mts.map +1 -0
- package/dist/{codecs-CEh66QoN-oCsdncEe.d.mts → codecs-BQWqLgCl-CdB8t7HI.d.mts} +37 -5
- package/dist/{codecs-CEh66QoN-oCsdncEe.d.mts.map → codecs-BQWqLgCl-CdB8t7HI.d.mts.map} +1 -1
- package/dist/codecs-BTv6fRXv.d.mts +1 -0
- package/dist/{codecs-BaoqGdxT.mjs → codecs-_uRxBgUK.mjs} +97 -6
- package/dist/codecs-_uRxBgUK.mjs.map +1 -0
- package/dist/{column-types-StKUDF6A.mjs → column-types-NVxgsjFA.mjs} +2 -2
- package/dist/{column-types-StKUDF6A.mjs.map → column-types-NVxgsjFA.mjs.map} +1 -1
- package/dist/{contract-free-DElSXD0q.mjs → contract-free-D5cZrgNl.mjs} +3 -3
- package/dist/{contract-free-DElSXD0q.mjs.map → contract-free-D5cZrgNl.mjs.map} +1 -1
- package/dist/{ddl-CW34JvfE-rd1ZIxOn.mjs → ddl-CXduXyOT-nlDP6DGx.mjs} +3 -3
- package/dist/{ddl-CW34JvfE-rd1ZIxOn.mjs.map → ddl-CXduXyOT-nlDP6DGx.mjs.map} +1 -1
- package/dist/{descriptor-meta-DjKgG4z5-CDdHwPoG.mjs → descriptor-meta-DjKgG4z5-Cblr1jL7.mjs} +3 -3
- package/dist/{descriptor-meta-DjKgG4z5-CDdHwPoG.mjs.map → descriptor-meta-DjKgG4z5-Cblr1jL7.mjs.map} +1 -1
- package/dist/{descriptor-meta-DnwDwnGg-D3f936hn.mjs → descriptor-meta-nORSZfmr-Cw-pzAJr.mjs} +13 -3
- package/dist/descriptor-meta-nORSZfmr-Cw-pzAJr.mjs.map +1 -0
- package/dist/{migration-jsmNRI_8.mjs → migration-DWP33-2M.mjs} +2 -2
- package/dist/{migration-jsmNRI_8.mjs.map → migration-DWP33-2M.mjs.map} +1 -1
- package/dist/{op-factory-call-C_or6163-B_LDzC37.mjs → op-factory-call-BCDGjXmK-D_Q47Yko.mjs} +3 -3
- package/dist/{op-factory-call-C_or6163-B_LDzC37.mjs.map → op-factory-call-BCDGjXmK-D_Q47Yko.mjs.map} +1 -1
- package/dist/{pack-Cnu6UOJx.d.mts → pack-DIbefoZF.d.mts} +11 -2
- package/dist/pack-DIbefoZF.d.mts.map +1 -0
- package/dist/{planner-DiGcIjl1-oFtDTY7-.mjs → planner-B9A1yTAH-NXeVipfr.mjs} +4 -4
- package/dist/{planner-DiGcIjl1-oFtDTY7-.mjs.map → planner-B9A1yTAH-NXeVipfr.mjs.map} +1 -1
- package/dist/{planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs → planner-produced-sqlite-migration-BRxGeP57-Ban7mFdH.mjs} +3 -3
- package/dist/{planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs.map → planner-produced-sqlite-migration-BRxGeP57-Ban7mFdH.mjs.map} +1 -1
- package/dist/{sqlite-migration-CV6LIqhx-D5eMTAbH.mjs → sqlite-migration-DWl9RerP-X0sf9N80.mjs} +3 -3
- package/dist/{sqlite-migration-CV6LIqhx-D5eMTAbH.mjs.map → sqlite-migration-DWl9RerP-X0sf9N80.mjs.map} +1 -1
- package/dist/target.d.mts +8 -8
- package/dist/target.mjs +11 -11
- package/dist/target__aggregates.mjs +1 -1
- package/dist/target__codec-ids.d.mts +3 -3
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +3 -3
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__contract-free.mjs +2 -2
- package/dist/target__control.mjs +2 -2
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.mjs +1 -1
- package/package.json +9 -9
- package/dist/aggregates-CTDRDyvD.mjs.map +0 -1
- package/dist/codec-ids-ChRBs2aB.d.mts +0 -1
- package/dist/codec-ids-DocGjhs--CHhP1jNZ.d.mts.map +0 -1
- package/dist/codec-ids-xicqpuAa-DHnKqnIs.mjs +0 -13
- package/dist/codec-ids-xicqpuAa-DHnKqnIs.mjs.map +0 -1
- package/dist/codec-types-BV3IjK44.d.mts +0 -2
- package/dist/codec-types-C29741cn.d.mts +0 -1
- package/dist/codec-types-DOyikA9Q-DVHiIZxI.d.mts.map +0 -1
- package/dist/codecs-BVBvwzGc.d.mts +0 -1
- package/dist/codecs-BaoqGdxT.mjs.map +0 -1
- package/dist/descriptor-meta-DnwDwnGg-D3f936hn.mjs.map +0 -1
- package/dist/pack-Cnu6UOJx.d.mts.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { i as SqliteCodecDescriptorRegistry, r as SqliteCodecDescriptor } from "./codec-descriptor-BcgD9f3L-yDi5nh_k.mjs";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BIGINT_NUMBER_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-CzeDyMWW-BZAcI50I.mjs";
|
|
3
3
|
import { ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { CodecCallContext, CodecImpl, CodecInstanceContext } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
6
6
|
import { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
|
|
7
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-
|
|
7
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-BQWqLgCl.d.mts
|
|
8
8
|
//#region src/core/codec-helpers.d.ts
|
|
9
9
|
/**
|
|
10
10
|
* Local `JsonValue` alias for the SQLite target. Codec implementations live in `codecs.ts` (TML-2357); this module retains only the JSON-shape alias the surrounding adapter and tests still import.
|
|
@@ -132,7 +132,9 @@ declare class SqliteBigintCodec extends CodecImpl<typeof SQLITE_BIGINT_CODEC_ID,
|
|
|
132
132
|
* The wire value is text wherever the value could outrun a JS number: an
|
|
133
133
|
* aggregate SQLite computes leaves the database through the descriptor's cast
|
|
134
134
|
* to text, because the driver reads an integer no number can hold as an error
|
|
135
|
-
* rather than a value.
|
|
135
|
+
* rather than a value. A number-typed wire value must therefore be a safe
|
|
136
|
+
* integer — past ±(2^53 − 1) it has already rounded, and converting it would
|
|
137
|
+
* mint a spuriously-exact `bigint` that need not equal the stored value.
|
|
136
138
|
*/
|
|
137
139
|
decode(wire: number | bigint | string, _ctx: CodecCallContext): Promise<bigint>;
|
|
138
140
|
encodeJson(value: bigint): JsonValue;
|
|
@@ -147,6 +149,36 @@ declare class SqliteBigintDescriptor extends SqliteCodecDescriptor<void> {
|
|
|
147
149
|
factory(): (ctx: CodecInstanceContext) => SqliteBigintCodec;
|
|
148
150
|
}
|
|
149
151
|
declare const sqliteBigintColumn: () => import("@prisma/orm-framework/components/codec").ColumnSpec<SqliteBigintCodec, undefined>;
|
|
152
|
+
/**
|
|
153
|
+
* A SQLite INTEGER decoded as a JS `number`, for columns whose values stay
|
|
154
|
+
* within the safe integer range ±(2^53 − 1). Both directions guard rather than
|
|
155
|
+
* round: decode (wire and JSON) and encode throw a structured error on
|
|
156
|
+
* out-of-range or non-integral input. The canonical JSON is a JSON number —
|
|
157
|
+
* the deliberate exception to the decimal-text rule for 64-bit integers, and
|
|
158
|
+
* the codec's purpose. The descriptor claims no target type, so `integer` in
|
|
159
|
+
* type position keeps its current codecs.
|
|
160
|
+
*/
|
|
161
|
+
declare class SqliteBigintNumberCodec extends CodecImpl<typeof SQLITE_BIGINT_NUMBER_CODEC_ID, readonly ['equality', 'order', 'numeric'], number | bigint | string, number> {
|
|
162
|
+
encode(value: number, _ctx: CodecCallContext): Promise<number>;
|
|
163
|
+
/**
|
|
164
|
+
* The driver hands an INTEGER over as a `number` or, in safe-integer mode, a
|
|
165
|
+
* `bigint`; a bigint (or decimal text) is range-checked exactly before any
|
|
166
|
+
* conversion to `number`, so an out-of-range value throws rather than rounds.
|
|
167
|
+
*/
|
|
168
|
+
decode(wire: number | bigint | string, _ctx: CodecCallContext): Promise<number>;
|
|
169
|
+
encodeJson(value: number): JsonValue;
|
|
170
|
+
decodeJson(json: JsonValue): number;
|
|
171
|
+
}
|
|
172
|
+
declare class SqliteBigintNumberDescriptor extends SqliteCodecDescriptor<void> {
|
|
173
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
174
|
+
readonly codecId: "sqlite/bigintnumber@1";
|
|
175
|
+
readonly traits: readonly ["equality", "order", "numeric"];
|
|
176
|
+
readonly targetTypes: readonly [];
|
|
177
|
+
readonly paramsSchema: import("@standard-schema/spec").StandardSchemaV1<void, void>;
|
|
178
|
+
renderValueLiteral(value: JsonValue): string | undefined;
|
|
179
|
+
factory(): (ctx: CodecInstanceContext) => SqliteBigintNumberCodec;
|
|
180
|
+
}
|
|
181
|
+
declare const sqliteBigintNumberColumn: () => import("@prisma/orm-framework/components/codec").ColumnSpec<SqliteBigintNumberCodec, undefined>;
|
|
150
182
|
//#endregion
|
|
151
183
|
//#region src/core/registry.d.ts
|
|
152
184
|
/**
|
|
@@ -157,5 +189,5 @@ declare const sqliteBigintColumn: () => import("@prisma/orm-framework/components
|
|
|
157
189
|
declare const sqliteCodecRegistry: CodecDescriptorRegistry;
|
|
158
190
|
declare const sqliteCodecDescriptorRegistry: SqliteCodecDescriptorRegistry;
|
|
159
191
|
//#endregion
|
|
160
|
-
export {
|
|
161
|
-
//# sourceMappingURL=codecs-
|
|
192
|
+
export { sqliteIntegerColumn as _, SqliteDatetimeDescriptor as a, sqliteTextColumn as b, SqliteRealDescriptor as c, sqliteBigintColumn as d, sqliteBigintNumberColumn as f, sqliteDatetimeColumn as g, sqliteCodecRegistry as h, SqliteBlobDescriptor as i, SqliteTextDescriptor as l, sqliteCodecDescriptorRegistry as m, SqliteBigintDescriptor as n, SqliteIntegerDescriptor as o, sqliteBlobColumn as p, SqliteBigintNumberDescriptor as r, SqliteJsonDescriptor as s, JsonValue$1 as t, jsonDocumentRetag as u, sqliteJsonColumn as v, sqliteRealColumn as y };
|
|
193
|
+
//# sourceMappingURL=codecs-BQWqLgCl-CdB8t7HI.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-
|
|
1
|
+
{"version":3,"file":"codecs-BQWqLgCl-CdB8t7HI.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs-BQWqLgCl.d.mts"],"mappings":";;;;;;;;;;;KAUK;YACO,cAAc;aACb;;;;;;;;;;;;;;;;;;;;;;;cAuBC,oBAAoB,YAAY,mBAAmB;cACnD,wBAAwB,iBAAiB;EACrD,OAAO,eAAe,MAAM,mBAAmB;EAC/C,OAAO,cAAc,MAAM,mBAAmB;EAC9C,WAAW,gBAAgB;EAC3B,WAAW,MAAM;;cAEL,6BAA6B;YAC/B,eAAe,YAAY,iBAAiB;WAC7C;WACA;WACA;WACA,8CAA8C;EACvD,YAAY,KAAK,yBAAyB;;cAE9B,uEAAuE,WAAW;cAClF,2BAA2B,iBAAiB;EACxD,OAAO,eAAe,MAAM,mBAAmB;EAC/C,OAAO,cAAc,MAAM,mBAAmB;EAC9C,WAAW,gBAAgB;EAC3B,WAAW,MAAM;;cAEL,gCAAgC;YAClC,eAAe,YAAY,iBAAiB;WAC7C;WACA;WACA;WACA,8CAA8C;EACvD,YAAY,KAAK,yBAAyB;;cAE9B,0EAA0E,WAAW;cACrF,wBAAwB,iBAAiB;EACrD,OAAO,eAAe,MAAM,mBAAmB;EAC/C,OAAO,cAAc,MAAM,mBAAmB;EAC9C,WAAW,gBAAgB;EAC3B,WAAW,MAAM;;cAEL,6BAA6B;YAC/B,eAAe,YAAY,iBAAiB;WAC7C;WACA;WACA;WACA,8CAA8C;EACvD,YAAY,KAAK,yBAAyB;;cAE9B,uEAAuE,WAAW;cAClF,wBAAwB,iBAAiB,6CAA6C,YAAY;EAC9G,OAAO,OAAO,YAAY,MAAM,mBAAmB,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AAqC;YACvC,eAAe,YAAY,iBAAiB;WAC7C;WACA;WACA;WACA,8CAA8C;EACvD,mBAAmB,OAAO;EAC1B,YAAY,KAAK,yBAAyB;;cAE9B,+EAA+E,WAAW;;;;;;;;cAQ1F,qBAAqB;cACrB,+BAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codecs-BQWqLgCl-CdB8t7HI.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BIGINT_NUMBER_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-KMliSCRp-BhTbmbGr.mjs";
|
|
2
2
|
import { a as sqliteCodec, n as buildSqliteCodecDescriptorRegistry, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-kVCSW1OR-CPatZUPM.mjs";
|
|
3
3
|
import { n as sqliteError } from "./errors-CKsaaSnD-BeB4JS8h.mjs";
|
|
4
4
|
import { CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
-
import { CodecImpl, column, voidParamsSchema } from "@prisma/orm-framework/components/codec";
|
|
5
|
+
import { CodecImpl, column, renderTsLiteral, voidParamsSchema } from "@prisma/orm-framework/components/codec";
|
|
6
6
|
import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
|
|
7
7
|
//#region ../../../3-targets/3-targets/sqlite/dist/codecs.mjs
|
|
8
8
|
/**
|
|
@@ -79,6 +79,32 @@ const finiteReal = (value, code) => {
|
|
|
79
79
|
} });
|
|
80
80
|
return value;
|
|
81
81
|
};
|
|
82
|
+
const MIN_SAFE_INTEGER_BIGINT = BigInt(Number.MIN_SAFE_INTEGER);
|
|
83
|
+
const MAX_SAFE_INTEGER_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);
|
|
84
|
+
/**
|
|
85
|
+
* Requires an integer within ±(2^53 − 1), the range a JS `number` holds
|
|
86
|
+
* exactly. The guard throws rather than rounding: past the boundary a `number`
|
|
87
|
+
* silently loses digits, which is the failure mode this codec exists to refuse.
|
|
88
|
+
*/
|
|
89
|
+
const safeIntegerNumber = (value, code) => {
|
|
90
|
+
if (!Number.isSafeInteger(value)) throw sqliteError(code, `sqlite/bigintnumber@1 value must be an integer within the safe integer range, got ${String(value)}`, { meta: {
|
|
91
|
+
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
92
|
+
received: String(value)
|
|
93
|
+
} });
|
|
94
|
+
if (Object.is(value, -0)) return 0;
|
|
95
|
+
return value;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Converts an exact `bigint` into a safe-range `number`, comparing before any
|
|
99
|
+
* conversion so an out-of-range value throws rather than rounds.
|
|
100
|
+
*/
|
|
101
|
+
const safeIntegerFromBigint = (value) => {
|
|
102
|
+
if (value < MIN_SAFE_INTEGER_BIGINT || value > MAX_SAFE_INTEGER_BIGINT) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/bigintnumber@1 value must be an integer within the safe integer range, got ${value}`, { meta: {
|
|
103
|
+
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
104
|
+
received: value.toString()
|
|
105
|
+
} });
|
|
106
|
+
return Number(value);
|
|
107
|
+
};
|
|
82
108
|
const sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, { jsonProjection: identityJsonProjection });
|
|
83
109
|
const sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, { jsonProjection: identityJsonProjection });
|
|
84
110
|
const sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, { jsonProjection: identityJsonProjection });
|
|
@@ -291,9 +317,15 @@ var SqliteBigintCodec = class extends CodecImpl {
|
|
|
291
317
|
* The wire value is text wherever the value could outrun a JS number: an
|
|
292
318
|
* aggregate SQLite computes leaves the database through the descriptor's cast
|
|
293
319
|
* to text, because the driver reads an integer no number can hold as an error
|
|
294
|
-
* rather than a value.
|
|
320
|
+
* rather than a value. A number-typed wire value must therefore be a safe
|
|
321
|
+
* integer — past ±(2^53 − 1) it has already rounded, and converting it would
|
|
322
|
+
* mint a spuriously-exact `bigint` that need not equal the stored value.
|
|
295
323
|
*/
|
|
296
324
|
async decode(wire, _ctx) {
|
|
325
|
+
if (typeof wire === "number" && !Number.isSafeInteger(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/bigint@1 wire number must be an integer within the safe integer range, got ${String(wire)}`, { meta: {
|
|
326
|
+
codecId: SQLITE_BIGINT_CODEC_ID,
|
|
327
|
+
received: String(wire)
|
|
328
|
+
} });
|
|
297
329
|
if (typeof wire === "string" && !DECIMAL_INTEGER.test(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/bigint@1 wire value must be a decimal string", { meta: {
|
|
298
330
|
codecId: SQLITE_BIGINT_CODEC_ID,
|
|
299
331
|
received: wire
|
|
@@ -329,6 +361,64 @@ var SqliteBigintDescriptor = class extends SqliteCodecDescriptor {
|
|
|
329
361
|
};
|
|
330
362
|
const sqliteBigintDescriptor = new SqliteBigintDescriptor();
|
|
331
363
|
const sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, void 0, "integer");
|
|
364
|
+
/**
|
|
365
|
+
* A SQLite INTEGER decoded as a JS `number`, for columns whose values stay
|
|
366
|
+
* within the safe integer range ±(2^53 − 1). Both directions guard rather than
|
|
367
|
+
* round: decode (wire and JSON) and encode throw a structured error on
|
|
368
|
+
* out-of-range or non-integral input. The canonical JSON is a JSON number —
|
|
369
|
+
* the deliberate exception to the decimal-text rule for 64-bit integers, and
|
|
370
|
+
* the codec's purpose. The descriptor claims no target type, so `integer` in
|
|
371
|
+
* type position keeps its current codecs.
|
|
372
|
+
*/
|
|
373
|
+
var SqliteBigintNumberCodec = class extends CodecImpl {
|
|
374
|
+
async encode(value, _ctx) {
|
|
375
|
+
return safeIntegerNumber(value, "RUNTIME.ENCODE_FAILED");
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* The driver hands an INTEGER over as a `number` or, in safe-integer mode, a
|
|
379
|
+
* `bigint`; a bigint (or decimal text) is range-checked exactly before any
|
|
380
|
+
* conversion to `number`, so an out-of-range value throws rather than rounds.
|
|
381
|
+
*/
|
|
382
|
+
async decode(wire, _ctx) {
|
|
383
|
+
if (typeof wire === "number") return safeIntegerNumber(wire, "RUNTIME.DECODE_FAILED");
|
|
384
|
+
if (typeof wire === "string" && !DECIMAL_INTEGER.test(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/bigintnumber@1 wire value must be a decimal string", { meta: {
|
|
385
|
+
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
386
|
+
received: wire
|
|
387
|
+
} });
|
|
388
|
+
return safeIntegerFromBigint(BigInt(wire));
|
|
389
|
+
}
|
|
390
|
+
encodeJson(value) {
|
|
391
|
+
return safeIntegerNumber(value, "RUNTIME.ENCODE_FAILED");
|
|
392
|
+
}
|
|
393
|
+
decodeJson(json) {
|
|
394
|
+
if (typeof json !== "number") throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/bigintnumber@1 database JSON value must be a number", { meta: {
|
|
395
|
+
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
396
|
+
received: typeof json
|
|
397
|
+
} });
|
|
398
|
+
return safeIntegerNumber(json, "RUNTIME.DECODE_FAILED");
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
|
|
402
|
+
jsonProjection(expression) {
|
|
403
|
+
return expression;
|
|
404
|
+
}
|
|
405
|
+
codecId = SQLITE_BIGINT_NUMBER_CODEC_ID;
|
|
406
|
+
traits = [
|
|
407
|
+
"equality",
|
|
408
|
+
"order",
|
|
409
|
+
"numeric"
|
|
410
|
+
];
|
|
411
|
+
targetTypes = [];
|
|
412
|
+
paramsSchema = voidParamsSchema;
|
|
413
|
+
renderValueLiteral(value) {
|
|
414
|
+
return renderTsLiteral(value);
|
|
415
|
+
}
|
|
416
|
+
factory() {
|
|
417
|
+
return () => new SqliteBigintNumberCodec(this);
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
const sqliteBigintNumberDescriptor = new SqliteBigintNumberDescriptor();
|
|
421
|
+
const sqliteBigintNumberColumn = () => column(sqliteBigintNumberDescriptor.factory(), sqliteBigintNumberDescriptor.codecId, void 0, "integer");
|
|
332
422
|
const codecDescriptors = defineSqliteCodecs([
|
|
333
423
|
sqliteSqlCharDescriptor,
|
|
334
424
|
sqliteSqlVarcharDescriptor,
|
|
@@ -340,7 +430,8 @@ const codecDescriptors = defineSqliteCodecs([
|
|
|
340
430
|
sqliteBlobDescriptor,
|
|
341
431
|
sqliteDatetimeDescriptor,
|
|
342
432
|
sqliteJsonDescriptor,
|
|
343
|
-
sqliteBigintDescriptor
|
|
433
|
+
sqliteBigintDescriptor,
|
|
434
|
+
sqliteBigintNumberDescriptor
|
|
344
435
|
]);
|
|
345
436
|
/**
|
|
346
437
|
* Registry of every codec descriptor shipped by `@internal/target-sqlite`.
|
|
@@ -350,6 +441,6 @@ const codecDescriptors = defineSqliteCodecs([
|
|
|
350
441
|
const sqliteCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);
|
|
351
442
|
const sqliteCodecDescriptorRegistry = buildSqliteCodecDescriptorRegistry(codecDescriptors);
|
|
352
443
|
//#endregion
|
|
353
|
-
export {
|
|
444
|
+
export { sqliteCodecDescriptorRegistry as a, sqliteIntegerColumn as c, sqliteTextColumn as d, sqliteBlobColumn as i, sqliteJsonColumn as l, sqliteBigintColumn as n, sqliteCodecRegistry as o, sqliteBigintNumberColumn as r, sqliteDatetimeColumn as s, jsonDocumentRetag as t, sqliteRealColumn as u };
|
|
354
445
|
|
|
355
|
-
//# sourceMappingURL=codecs-
|
|
446
|
+
//# sourceMappingURL=codecs-_uRxBgUK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-_uRxBgUK.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs.mjs"],"sourcesContent":["import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BIGINT_NUMBER_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from \"./codec-ids-KMliSCRp.mjs\";\nimport { a as sqliteCodec, n as buildSqliteCodecDescriptorRegistry, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from \"./codec-descriptor-kVCSW1OR.mjs\";\nimport { n as sqliteError } from \"./errors-CKsaaSnD.mjs\";\nimport { CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from \"@internal/sql-relational-core/ast\";\nimport { CodecImpl, column, renderTsLiteral, voidParamsSchema } from \"@internal/framework-components/codec\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\n//#region src/core/codecs.ts\n/**\n* Projects the expression unchanged, for codecs whose canonical JSON is what\n* SQLite's own JSON conversion already produces.\n*\n* Identity here is a claim about the target's behaviour, not an absence of one:\n* the codec's conformance cases are what test it, including at the boundaries\n* of the representation where a native conversion would be most likely to\n* diverge.\n*/\nconst identityJsonProjection = (expression) => expression;\n/**\n* Projects an integer-valued expression as decimal text.\n*\n* The cast is part of the projected expression, so it applies before the JSON\n* constructor sees the value: handed an INTEGER directly, the constructor emits\n* a JSON number, and SQLite's 64-bit range does not survive being read back as\n* a double. Casting the constructor's result would be too late.\n*/\nconst decimalTextJsonProjection = (expression) => CastExpr.as(expression, \"TEXT\");\n/**\n* Projects a BLOB as hexadecimal text.\n*\n* SQLite's JSON functions reject a BLOB argument outright, so the encoding has\n* to replace the native conversion rather than post-process it. `hex()` emits\n* uppercase and never wraps at any length, which is the spelling `encodeJson`\n* pins.\n*\n* `hex(NULL)` is `''` rather than NULL, and `''` is the hex of an empty blob —\n* so without the NULL check an absent blob and an empty one would both project\n* as `''`, and `decodeJson` accepts `''` because zero hex pairs is a valid\n* empty blob. The check keeps the two distinguishable.\n*/\nconst hexJsonProjection = (expression) => CaseExpr.of([{\n\tcondition: NullCheckExpr.isNull(expression),\n\tvalue: LiteralExpr.of(null)\n}], FunctionCallExpr.of(\"hex\", [expression]));\nconst JSON_RETAG_FN = \"json\";\n/**\n* Re-applies SQLite's JSON subtype to a document-valued expression.\n*\n* SQLite carries \"this text is JSON\" as a subtype on the value rather than in\n* its type, and the subtype does not survive a derived table: a document that\n* `json_object` produced arrives one level out as plain text, so the enclosing\n* constructor embeds it as a *string containing JSON* rather than as a\n* document. `json()` re-applies the subtype, which is what makes the value nest\n* as a document again.\n*\n* The loss happens at the first derived-table boundary and does not compound, so\n* a retag is needed where the document is consumed rather than at every level it\n* passes through.\n*\n* Applying this twice is a no-op — SQLite's `json()` is idempotent, and the\n* wrapper collapses rather than nesting so the rendered SQL says so too. It is\n* safe on any valid JSON text, including scalars, and on NULL; it raises\n* `malformed JSON` on text that is not JSON, which is the correct failure for a\n* value that was never a document.\n*/\nconst jsonDocumentRetag = (expression) => isJsonRetag(expression) ? expression : FunctionCallExpr.of(JSON_RETAG_FN, [expression]);\n/** Whether an expression is already a retag, so applying one again would only nest. */\nconst isJsonRetag = (expression) => expression instanceof FunctionCallExpr && expression.fn === JSON_RETAG_FN && expression.args.length === 1;\nconst DECIMAL_INTEGER = /^-?\\d+$/;\nconst UPPERCASE_HEX = /^(?:[0-9A-F]{2})*$/;\n/**\n* JSON has no spelling for an infinity or a NaN, and SQLite renders one as\n* `9.0e+999`, which reads back as `Infinity` rather than failing. A real is\n* therefore carried only where it is finite.\n*/\nconst finiteReal = (value, code) => {\n\tif (!Number.isFinite(value)) throw sqliteError(code, \"sqlite/real@1 value must be a finite number\", { meta: {\n\t\tcodecId: SQLITE_REAL_CODEC_ID,\n\t\treceived: String(value)\n\t} });\n\treturn value;\n};\nconst MIN_SAFE_INTEGER_BIGINT = BigInt(Number.MIN_SAFE_INTEGER);\nconst MAX_SAFE_INTEGER_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);\n/**\n* Requires an integer within ±(2^53 − 1), the range a JS `number` holds\n* exactly. The guard throws rather than rounding: past the boundary a `number`\n* silently loses digits, which is the failure mode this codec exists to refuse.\n*/\nconst safeIntegerNumber = (value, code) => {\n\tif (!Number.isSafeInteger(value)) throw sqliteError(code, `sqlite/bigintnumber@1 value must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId: SQLITE_BIGINT_NUMBER_CODEC_ID,\n\t\treceived: String(value)\n\t} });\n\tif (Object.is(value, -0)) return 0;\n\treturn value;\n};\n/**\n* Converts an exact `bigint` into a safe-range `number`, comparing before any\n* conversion so an out-of-range value throws rather than rounds.\n*/\nconst safeIntegerFromBigint = (value) => {\n\tif (value < MIN_SAFE_INTEGER_BIGINT || value > MAX_SAFE_INTEGER_BIGINT) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `sqlite/bigintnumber@1 value must be an integer within the safe integer range, got ${value}`, { meta: {\n\t\tcodecId: SQLITE_BIGINT_NUMBER_CODEC_ID,\n\t\treceived: value.toString()\n\t} });\n\treturn Number(value);\n};\nconst sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, { jsonProjection: identityJsonProjection });\nconst sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, { jsonProjection: identityJsonProjection });\nconst sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, { jsonProjection: identityJsonProjection });\nconst sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, { jsonProjection: identityJsonProjection });\nvar SqliteTextCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqliteTextDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tcodecId = SQLITE_TEXT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteTextCodec(this);\n\t}\n};\nconst sqliteTextDescriptor = new SqliteTextDescriptor();\nconst sqliteTextColumn = () => column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, void 0, \"text\");\nvar SqliteIntegerCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tcodecId = SQLITE_INTEGER_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"integer\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteIntegerCodec(this);\n\t}\n};\nconst sqliteIntegerDescriptor = new SqliteIntegerDescriptor();\nconst sqliteIntegerColumn = () => column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, void 0, \"integer\");\nvar SqliteRealCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tencodeJson(value) {\n\t\treturn finiteReal(value, \"RUNTIME.ENCODE_FAILED\");\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"number\") throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/real@1 database JSON value must be a number\", { meta: {\n\t\t\tcodecId: SQLITE_REAL_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn finiteReal(json, \"RUNTIME.DECODE_FAILED\");\n\t}\n};\nvar SqliteRealDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tcodecId = SQLITE_REAL_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"real\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteRealCodec(this);\n\t}\n};\nconst sqliteRealDescriptor = new SqliteRealDescriptor();\nconst sqliteRealColumn = () => column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, void 0, \"real\");\nvar SqliteBlobCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tencodeJson(value) {\n\t\treturn Buffer.from(value).toString(\"hex\").toUpperCase();\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"string\" || !UPPERCASE_HEX.test(json)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/blob@1 database JSON value must be uppercase hexadecimal text\", { meta: {\n\t\t\tcodecId: SQLITE_BLOB_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn new Uint8Array(Buffer.from(json, \"hex\"));\n\t}\n};\nvar SqliteBlobDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn hexJsonProjection(expression);\n\t}\n\tcodecId = SQLITE_BLOB_CODEC_ID;\n\ttraits = [\"equality\"];\n\ttargetTypes = [\"blob\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteBlobCodec(this);\n\t}\n};\nconst sqliteBlobDescriptor = new SqliteBlobDescriptor();\nconst sqliteBlobColumn = () => column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, void 0, \"blob\");\nvar SqliteDatetimeCodec = class extends CodecImpl {\n\tparseDate(value) {\n\t\tconst date = new Date(value);\n\t\tif (Number.isNaN(date.getTime())) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `sqlite/datetime@1 value must be a valid ISO-8601 string: ${value}`, { meta: {\n\t\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\t\treceived: value\n\t\t} });\n\t\treturn date;\n\t}\n\tasync encode(value, _ctx) {\n\t\treturn value.toISOString();\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn this.parseDate(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value.toISOString();\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"string\") throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/datetime@1 contract value must be an ISO-8601 string\", { meta: {\n\t\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn this.parseDate(json);\n\t}\n};\nvar SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tcodecId = SQLITE_DATETIME_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteDatetimeCodec(this);\n\t}\n};\nconst sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();\nconst sqliteDatetimeColumn = () => column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, void 0, \"text\");\nvar SqliteJsonCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn JSON.stringify(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn typeof wire === \"string\" ? JSON.parse(wire) : wire;\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqliteJsonDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn jsonDocumentRetag(expression);\n\t}\n\tcodecId = SQLITE_JSON_CODEC_ID;\n\ttraits = [\"equality\"];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteJsonCodec(this);\n\t}\n};\nconst sqliteJsonDescriptor = new SqliteJsonDescriptor();\nconst sqliteJsonColumn = () => column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, void 0, \"text\");\nvar SqliteBigintCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn value;\n\t}\n\t/**\n\t* The wire value is text wherever the value could outrun a JS number: an\n\t* aggregate SQLite computes leaves the database through the descriptor's cast\n\t* to text, because the driver reads an integer no number can hold as an error\n\t* rather than a value. A number-typed wire value must therefore be a safe\n\t* integer — past ±(2^53 − 1) it has already rounded, and converting it would\n\t* mint a spuriously-exact `bigint` that need not equal the stored value.\n\t*/\n\tasync decode(wire, _ctx) {\n\t\tif (typeof wire === \"number\" && !Number.isSafeInteger(wire)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `sqlite/bigint@1 wire number must be an integer within the safe integer range, got ${String(wire)}`, { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\treceived: String(wire)\n\t\t} });\n\t\tif (typeof wire === \"string\" && !DECIMAL_INTEGER.test(wire)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/bigint@1 wire value must be a decimal string\", { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\treceived: wire\n\t\t} });\n\t\treturn BigInt(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value.toString();\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"string\" || !DECIMAL_INTEGER.test(json)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/bigint@1 database JSON value must be a decimal string\", { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn BigInt(json);\n\t}\n};\nvar SqliteBigintDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn decimalTextJsonProjection(expression);\n\t}\n\tcodecId = SQLITE_BIGINT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"integer\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteBigintCodec(this);\n\t}\n};\nconst sqliteBigintDescriptor = new SqliteBigintDescriptor();\nconst sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, void 0, \"integer\");\n/**\n* A SQLite INTEGER decoded as a JS `number`, for columns whose values stay\n* within the safe integer range ±(2^53 − 1). Both directions guard rather than\n* round: decode (wire and JSON) and encode throw a structured error on\n* out-of-range or non-integral input. The canonical JSON is a JSON number —\n* the deliberate exception to the decimal-text rule for 64-bit integers, and\n* the codec's purpose. The descriptor claims no target type, so `integer` in\n* type position keeps its current codecs.\n*/\nvar SqliteBigintNumberCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn safeIntegerNumber(value, \"RUNTIME.ENCODE_FAILED\");\n\t}\n\t/**\n\t* The driver hands an INTEGER over as a `number` or, in safe-integer mode, a\n\t* `bigint`; a bigint (or decimal text) is range-checked exactly before any\n\t* conversion to `number`, so an out-of-range value throws rather than rounds.\n\t*/\n\tasync decode(wire, _ctx) {\n\t\tif (typeof wire === \"number\") return safeIntegerNumber(wire, \"RUNTIME.DECODE_FAILED\");\n\t\tif (typeof wire === \"string\" && !DECIMAL_INTEGER.test(wire)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/bigintnumber@1 wire value must be a decimal string\", { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_NUMBER_CODEC_ID,\n\t\t\treceived: wire\n\t\t} });\n\t\treturn safeIntegerFromBigint(BigInt(wire));\n\t}\n\tencodeJson(value) {\n\t\treturn safeIntegerNumber(value, \"RUNTIME.ENCODE_FAILED\");\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"number\") throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/bigintnumber@1 database JSON value must be a number\", { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_NUMBER_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn safeIntegerNumber(json, \"RUNTIME.DECODE_FAILED\");\n\t}\n};\nvar SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tcodecId = SQLITE_BIGINT_NUMBER_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [];\n\tparamsSchema = voidParamsSchema;\n\trenderValueLiteral(value) {\n\t\treturn renderTsLiteral(value);\n\t}\n\tfactory() {\n\t\treturn () => new SqliteBigintNumberCodec(this);\n\t}\n};\nconst sqliteBigintNumberDescriptor = new SqliteBigintNumberDescriptor();\nconst sqliteBigintNumberColumn = () => column(sqliteBigintNumberDescriptor.factory(), sqliteBigintNumberDescriptor.codecId, void 0, \"integer\");\nconst codecDescriptors = defineSqliteCodecs([\n\tsqliteSqlCharDescriptor,\n\tsqliteSqlVarcharDescriptor,\n\tsqliteSqlIntDescriptor,\n\tsqliteSqlFloatDescriptor,\n\tsqliteTextDescriptor,\n\tsqliteIntegerDescriptor,\n\tsqliteRealDescriptor,\n\tsqliteBlobDescriptor,\n\tsqliteDatetimeDescriptor,\n\tsqliteJsonDescriptor,\n\tsqliteBigintDescriptor,\n\tsqliteBigintNumberDescriptor\n]);\n//#endregion\n//#region src/core/registry.ts\n/**\n* Registry of every codec descriptor shipped by `@internal/target-sqlite`.\n*\n* Public consumer surface for the sqlite codec set: the sqlite adapter and any other consumer that needs to enumerate or look up a sqlite codec by id consumes this rather than the raw descriptor array. See ADR 208.\n*/\nconst sqliteCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);\nconst sqliteCodecDescriptorRegistry = buildSqliteCodecDescriptorRegistry(codecDescriptors);\n//#endregion\nexport { jsonDocumentRetag, sqliteBigintColumn, sqliteBigintNumberColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };\n\n//# sourceMappingURL=codecs.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,0BAA0B,eAAe;;;;;;;;;AAS/C,MAAM,6BAA6B,eAAe,SAAS,GAAG,YAAY,MAAM;;;;;;;;;;;;;;AAchF,MAAM,qBAAqB,eAAe,SAAS,GAAG,CAAC;CACtD,WAAW,cAAc,OAAO,UAAU;CAC1C,OAAO,YAAY,GAAG,IAAI;AAC3B,CAAC,GAAG,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC5C,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;AAqBtB,MAAM,qBAAqB,eAAe,YAAY,UAAU,IAAI,aAAa,iBAAiB,GAAG,eAAe,CAAC,UAAU,CAAC;;AAEhI,MAAM,eAAe,eAAe,sBAAsB,oBAAoB,WAAW,OAAO,iBAAiB,WAAW,KAAK,WAAW;AAC5I,MAAM,kBAAkB;AACxB,MAAM,gBAAgB;;;;;;AAMtB,MAAM,cAAc,OAAO,SAAS;CACnC,IAA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EACpF,IAAI,OAAO,SAAS,YAAY,CAAC,gBAAgB,KAAK,IAAI,GAAG,MAAM,YAAY,yBAAyB,6DAA6D,EAAE,MAAM;GAC5K,SAAS;GACT,UAAU;EACX,EAAE,CAAC;EACH,OAAO,sBAAsB,OAAO,IAAI,CAAC;CAC1C;CACA,WAAW,OAAO;EACjB,OAAO,kBAAkB,OAAO,uBAAuB;CACxD;CACA,WAAW,MAAM;EAChB,IAAI,OAAO,SAAS,UAAU,MAAM,YAAY,yBAAyB,8DAA8D,EAAE,MAAM;GAC9I,SAAS;GACT,UAAU,OAAO;EAClB,EAAE,CAAC;EACH,OAAO,kBAAkB,MAAM,uBAAuB;CACvD;AACD;AACA,IAAI,+BAA+B,cAAc,sBAAsB;CACtE,eAAe,YAAY;EAC1B,OAAO;CACR;CACA,UAAU;CACV,SAAS;EACR;EACA;EACA;CACD;CACA,cAAc,CAAC;CACf,eAAe;CACf,mBAAmB,OAAO;EACzB,OAAO,gBAAgB,KAAK;CAC7B;CACA,UAAU;EACT,aAAa,IAAI,wBAAwB,IAAI;CAC9C;AACD;AACA,MAAM,+BAA+B,IAAI,6BAA6B;AACtE,MAAM,iCAAiC,OAAO,6BAA6B,QAAQ,GAAG,6BAA6B,SAAS,KAAK,GAAG,SAAS;AAC7I,MAAM,mBAAmB,mBAAmB;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;;;;;;AAQD,MAAM,sBAAsB,6BAA6B,gBAAgB;AACzE,MAAM,gCAAgC,mCAAmC,gBAAgB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-KMliSCRp-BhTbmbGr.mjs";
|
|
2
2
|
//#region ../../../3-targets/6-adapters/sqlite/dist/column-types.mjs
|
|
3
3
|
const textColumn = {
|
|
4
4
|
codecId: SQLITE_TEXT_CODEC_ID,
|
|
@@ -31,4 +31,4 @@ const bigintColumn = {
|
|
|
31
31
|
//#endregion
|
|
32
32
|
export { jsonColumn as a, integerColumn as i, blobColumn as n, realColumn as o, datetimeColumn as r, textColumn as s, bigintColumn as t };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=column-types-
|
|
34
|
+
//# sourceMappingURL=column-types-NVxgsjFA.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-types-
|
|
1
|
+
{"version":3,"file":"column-types-NVxgsjFA.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/column-types.mjs"],"sourcesContent":["import { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\n//#region src/core/column-types.ts\nconst textColumn = {\n\tcodecId: SQLITE_TEXT_CODEC_ID,\n\tnativeType: \"text\"\n};\nconst integerColumn = {\n\tcodecId: SQLITE_INTEGER_CODEC_ID,\n\tnativeType: \"integer\"\n};\nconst realColumn = {\n\tcodecId: SQLITE_REAL_CODEC_ID,\n\tnativeType: \"real\"\n};\nconst blobColumn = {\n\tcodecId: SQLITE_BLOB_CODEC_ID,\n\tnativeType: \"blob\"\n};\nconst datetimeColumn = {\n\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\tnativeType: \"text\"\n};\nconst jsonColumn = {\n\tcodecId: SQLITE_JSON_CODEC_ID,\n\tnativeType: \"text\"\n};\nconst bigintColumn = {\n\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\tnativeType: \"integer\"\n};\n//#endregion\nexport { bigintColumn, blobColumn, datetimeColumn, integerColumn, jsonColumn, realColumn, textColumn };\n\n//# sourceMappingURL=column-types.mjs.map"],"mappings":";;AAEA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,MAAM,gBAAgB;CACrB,SAAS;CACT,YAAY;AACb;AACA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,MAAM,iBAAiB;CACtB,SAAS;CACT,YAAY;AACb;AACA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,MAAM,eAAe;CACpB,SAAS;CACT,YAAY;AACb"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { n as createTable } from "./ddl-
|
|
1
|
+
import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, o as SQLITE_JSON_CODEC_ID } from "./codec-ids-KMliSCRp-BhTbmbGr.mjs";
|
|
2
|
+
import { n as createTable } from "./ddl-CXduXyOT-nlDP6DGx.mjs";
|
|
3
3
|
import { TableSource } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { col, fn, lit, table } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
5
5
|
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
@@ -87,4 +87,4 @@ function buildControlTableBootstrapQueries() {
|
|
|
87
87
|
//#endregion
|
|
88
88
|
export { jsonText as a, integer as i, buildSignMarkerBootstrapQueries as n, sqliteTable as o, datetime as r, text as s, buildControlTableBootstrapQueries as t };
|
|
89
89
|
|
|
90
|
-
//# sourceMappingURL=contract-free-
|
|
90
|
+
//# sourceMappingURL=contract-free-D5cZrgNl.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-free-
|
|
1
|
+
{"version":3,"file":"contract-free-D5cZrgNl.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/contract-free.mjs"],"sourcesContent":["import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, o as SQLITE_JSON_CODEC_ID } from \"./codec-ids-KMliSCRp.mjs\";\nimport { i as tableExistsAst, n as columnExistsAst, r as indexExistsAst, t as createTable } from \"./ddl-CXduXyOT.mjs\";\nimport { TableSource } from \"@internal/sql-relational-core/ast\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { col, fn, lit, table } from \"@internal/sql-relational-core/contract-free\";\n//#region src/contract-free/columns.ts\nconst desc = (codecId, opts) => ({\n\tcodecId,\n\tnullable: opts?.nullable ?? false\n});\nconst text = (opts) => desc(SQLITE_TEXT_CODEC_ID, opts);\nconst integer = (opts) => desc(SQLITE_INTEGER_CODEC_ID, opts);\nconst jsonText = (opts) => desc(SQLITE_JSON_CODEC_ID, opts);\nconst datetime = (opts) => desc(SQLITE_DATETIME_CODEC_ID, opts);\n/**\n* Declare a SQLite control-plane table with a typed column schema. SQLite tables\n* are addressed by a flat name (no schema prefix).\n*\n* ```ts\n* const marker = sqliteTable('_prisma_marker', {\n* space: text(),\n* core_hash: text(),\n* updated_at: datetime(),\n* });\n* ```\n*/\nfunction sqliteTable(name, columns) {\n\treturn table(TableSource.named(name), columns);\n}\n//#endregion\n//#region src/contract-free/control-bootstrap.ts\nconst markerColumns = [\n\tcol(\"space\", \"TEXT\", {\n\t\tnotNull: true,\n\t\tprimaryKey: true,\n\t\tdefault: lit(APP_SPACE_ID)\n\t}),\n\tcol(\"core_hash\", \"TEXT\", { notNull: true }),\n\tcol(\"profile_hash\", \"TEXT\", { notNull: true }),\n\tcol(\"contract_json\", \"TEXT\"),\n\tcol(\"canonical_version\", \"INTEGER\"),\n\tcol(\"updated_at\", \"TEXT\", {\n\t\tnotNull: true,\n\t\tdefault: fn(\"datetime('now')\")\n\t}),\n\tcol(\"app_tag\", \"TEXT\"),\n\tcol(\"meta\", \"TEXT\", {\n\t\tnotNull: true,\n\t\tdefault: lit(\"{}\")\n\t}),\n\tcol(\"invariants\", \"TEXT\", {\n\t\tnotNull: true,\n\t\tdefault: lit(\"[]\")\n\t})\n];\nconst ledgerColumns = [\n\tcol(\"id\", \"INTEGER PRIMARY KEY AUTOINCREMENT\"),\n\tcol(\"created_at\", \"TEXT\", {\n\t\tnotNull: true,\n\t\tdefault: fn(\"strftime('%Y-%m-%dT%H:%M:%fZ','now')\")\n\t}),\n\tcol(\"space\", \"TEXT\", { notNull: true }),\n\tcol(\"migration_name\", \"TEXT\", { notNull: true }),\n\tcol(\"migration_hash\", \"TEXT\", { notNull: true }),\n\tcol(\"origin_core_hash\", \"TEXT\"),\n\tcol(\"origin_profile_hash\", \"TEXT\"),\n\tcol(\"destination_core_hash\", \"TEXT\", { notNull: true }),\n\tcol(\"destination_profile_hash\", \"TEXT\"),\n\tcol(\"contract_json_before\", \"TEXT\"),\n\tcol(\"contract_json_after\", \"TEXT\"),\n\tcol(\"operations\", \"TEXT\", { notNull: true })\n];\nconst markerTable = createTable({\n\ttable: \"_prisma_marker\",\n\tifNotExists: true,\n\tcolumns: markerColumns\n});\nconst ledgerTable = createTable({\n\ttable: \"_prisma_ledger\",\n\tifNotExists: true,\n\tcolumns: ledgerColumns\n});\nfunction buildSignMarkerBootstrapQueries() {\n\treturn [markerTable];\n}\nfunction buildControlTableBootstrapQueries() {\n\treturn [markerTable, ledgerTable];\n}\n//#endregion\nexport { buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, columnExistsAst, createTable, datetime, indexExistsAst, integer, jsonText, sqliteTable, tableExistsAst, text };\n\n//# sourceMappingURL=contract-free.mjs.map"],"mappings":";;;;;;AAMA,MAAM,QAAQ,SAAS,UAAU;CAChC;CACA,UAAU,MAAM,YAAY;AAC7B;AACA,MAAM,QAAQ,SAAS,KAAK,sBAAsB,IAAI;AACtD,MAAM,WAAW,SAAS,KAAK,yBAAyB,IAAI;AAC5D,MAAM,YAAY,SAAS,KAA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aAAa;CACb,SAAS;AACV,CAAC;AACD,MAAM,cAAc,YAAY;CAC/B,OAAO;CACP,aAAa;CACb,SAAS;AACV,CAAC;AACD,SAAS,kCAAkC;CAC1C,OAAO,CAAC,WAAW;AACpB;AACA,SAAS,oCAAoC;CAC5C,OAAO,CAAC,aAAa,WAAW;AACjC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as SQLITE_TEXT_CODEC_ID } from "./codec-ids-KMliSCRp-BhTbmbGr.mjs";
|
|
2
2
|
import { t as SqliteCreateTable } from "./nodes-DUZSdX86-BBEEaxXY.mjs";
|
|
3
3
|
import { FunctionSource } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { cfExpr, cfTable, exprSelect } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
5
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/ddl-
|
|
5
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/ddl-CXduXyOT.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Typed builder for the migration planner's column-existence checks. Produces
|
|
8
8
|
* `SELECT COUNT(*) {=|>} 0 AS "result" FROM pragma_table_info(?) WHERE "name" = ?`
|
|
@@ -63,4 +63,4 @@ function createTable(options) {
|
|
|
63
63
|
//#endregion
|
|
64
64
|
export { tableExistsAst as i, createTable as n, indexExistsAst as r, columnExistsAst as t };
|
|
65
65
|
|
|
66
|
-
//# sourceMappingURL=ddl-
|
|
66
|
+
//# sourceMappingURL=ddl-CXduXyOT-nlDP6DGx.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ddl-
|
|
1
|
+
{"version":3,"file":"ddl-CXduXyOT-nlDP6DGx.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/ddl-CXduXyOT.mjs"],"sourcesContent":["import { c as SQLITE_TEXT_CODEC_ID } from \"./codec-ids-KMliSCRp.mjs\";\nimport { t as SqliteCreateTable } from \"./nodes-DUZSdX86.mjs\";\nimport { FunctionSource } from \"@internal/sql-relational-core/ast\";\nimport { cfExpr, cfTable, exprSelect } from \"@internal/sql-relational-core/contract-free\";\n//#region src/contract-free/checks.ts\n/**\n* Typed builder for the migration planner's column-existence checks. Produces\n* `SELECT COUNT(*) {=|>} 0 AS \"result\" FROM pragma_table_info(?) WHERE \"name\" = ?`\n* ASTs with the table and column names bound as text parameters — never\n* inlined into the SQL.\n*/\nfunction columnExistsAst(table, column) {\n\tconst source = FunctionSource.of(\"pragma_table_info\", [cfExpr.param(table, SQLITE_TEXT_CODEC_ID).ast]);\n\tconst where = cfExpr.identifierRef(\"name\").eqParam(column, SQLITE_TEXT_CODEC_ID);\n\treturn {\n\t\tcolumnAbsent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().eqLit(0)).where(where).build(),\n\t\tcolumnPresent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().gtLit(0)).where(where).build()\n\t};\n}\n/**\n* Typed builder for table-existence checks over `sqlite_master`.\n* Produces `SELECT COUNT(*) {=|>} 0 AS \"result\" FROM \"sqlite_master\" WHERE \"type\" = ? AND \"name\" = ?`\n* with the table name and the literal `'table'` bound as text parameters.\n*/\nfunction tableExistsAst(tableName) {\n\tconst source = cfTable(\"sqlite_master\");\n\tconst where = cfExpr.allOf([cfExpr.identifierRef(\"type\").eqParam(\"table\", SQLITE_TEXT_CODEC_ID), cfExpr.identifierRef(\"name\").eqParam(tableName, SQLITE_TEXT_CODEC_ID)]);\n\treturn {\n\t\ttableAbsent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().eqLit(0)).where(where).build(),\n\t\ttablePresent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().gtLit(0)).where(where).build()\n\t};\n}\n/**\n* Typed builder for index-existence checks over `sqlite_master`.\n* Produces `SELECT COUNT(*) {=|>} 0 AS \"result\" FROM \"sqlite_master\" WHERE \"type\" = ? AND \"name\" = ?`\n* with the index name and the literal `'index'` bound as text parameters.\n*/\nfunction indexExistsAst(indexName) {\n\tconst source = cfTable(\"sqlite_master\");\n\tconst where = cfExpr.allOf([cfExpr.identifierRef(\"type\").eqParam(\"index\", SQLITE_TEXT_CODEC_ID), cfExpr.identifierRef(\"name\").eqParam(indexName, SQLITE_TEXT_CODEC_ID)]);\n\treturn {\n\t\tindexAbsent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().eqLit(0)).where(where).build(),\n\t\tindexPresent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().gtLit(0)).where(where).build()\n\t};\n}\n//#endregion\n//#region src/contract-free/ddl.ts\n/**\n* Build a SQLite `CREATE TABLE` query node.\n*\n* Pass `constraints` for table-level composite primary keys, foreign keys, and\n* unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},\n* and {@link UniqueConstraint} classes from `@internal/sql-relational-core/ast`.\n*\n* Precondition: identifiers (`table`, column names/types) are emitted to SQL\n* verbatim — they are not quoted or escaped, so callers must pass pre-trusted\n* values (e.g. fixed control-plane identifiers). String-literal default values,\n* by contrast, are single-quote-escaped (embedded `'` doubled) by the renderer.\n* Identifier quoting for untrusted identifiers is added when the migration\n* planner adopts this lowering path.\n*/\nfunction createTable(options) {\n\treturn new SqliteCreateTable(options);\n}\n//#endregion\nexport { tableExistsAst as i, columnExistsAst as n, indexExistsAst as r, createTable as t };\n\n//# sourceMappingURL=ddl-CXduXyOT.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,gBAAgB,OAAO,QAAQ;CACvC,MAAM,SAAS,eAAe,GAAG,qBAAqB,CAAC,OAAO,MAAM,OAAO,oBAAoB,CAAC,CAAC,GAAG,CAAC;CACrG,MAAM,QAAQ,OAAO,cAAc,MAAM,CAAC,CAAC,QAAQ,QAAQ,oBAAoB;CAC/E,OAAO;EACN,oBAAoB,WAAW,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,QAAQ,UAAU,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAA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C,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CACjH;AACD;;;;;;;;;;;;;;;AAiBA,SAAS,YAAY,SAAS;CAC7B,OAAO,IAAI,kBAAkB,OAAO;AACrC"}
|
package/dist/{descriptor-meta-DjKgG4z5-CDdHwPoG.mjs → descriptor-meta-DjKgG4z5-Cblr1jL7.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as sqliteAggregateDescriptors } from "./aggregates-
|
|
2
|
-
import {
|
|
1
|
+
import { t as sqliteAggregateDescriptors } from "./aggregates-Cy5ovVZD.mjs";
|
|
2
|
+
import { o as sqliteCodecRegistry } from "./codecs-_uRxBgUK.mjs";
|
|
3
3
|
//#region ../../../3-targets/6-adapters/sqlite/dist/descriptor-meta-DjKgG4z5.mjs
|
|
4
4
|
const sqliteAdapterDescriptorMeta = {
|
|
5
5
|
kind: "adapter",
|
|
@@ -31,4 +31,4 @@ const sqliteAdapterDescriptorMeta = {
|
|
|
31
31
|
//#endregion
|
|
32
32
|
export { sqliteAdapterDescriptorMeta as t };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=descriptor-meta-DjKgG4z5-
|
|
34
|
+
//# sourceMappingURL=descriptor-meta-DjKgG4z5-Cblr1jL7.mjs.map
|
package/dist/{descriptor-meta-DjKgG4z5-CDdHwPoG.mjs.map → descriptor-meta-DjKgG4z5-Cblr1jL7.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-DjKgG4z5-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-DjKgG4z5-Cblr1jL7.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/descriptor-meta-DjKgG4z5.mjs"],"sourcesContent":["import { sqliteCodecRegistry } from \"@internal/target-sqlite/codecs\";\nimport { sqliteAggregateDescriptors } from \"@internal/target-sqlite/aggregates\";\nconst sqliteAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"sqlite\",\n\tid: \"sqlite\",\n\tversion: \"0.0.1\",\n\tcapabilities: { sql: {\n\t\torderBy: true,\n\t\tlimit: true,\n\t\tlateral: false,\n\t\tjsonAgg: true,\n\t\treturning: true,\n\t\tforeignKeys: true,\n\t\tenums: false\n\t} },\n\ttypes: {\n\t\taggregateDescriptors: sqliteAggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(sqliteCodecRegistry.values()).filter((d) => d.renderOutputType === void 0),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/adapter-sqlite/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"SqliteTypes\"\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\nexport { sqliteAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-DjKgG4z5.mjs.map"],"mappings":";;;AAEA,MAAM,8BAA8B;CACnC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,EAAE,KAAK;EACpB,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,WAAW;EACX,aAAa;EACb,OAAO;CACR,EAAE;CACF,OAAO;EACN,sBAAsB;EACtB,YAAY;GACX,kBAAkB,MAAM,KAAK,oBAAoB,OAAO,CAAC,CAAC,CAAC,QAAQ,MAAM,EAAE,qBAAqB,KAAK,CAAC;GACtG,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;EACD;CACD;AACD"}
|
package/dist/{descriptor-meta-DnwDwnGg-D3f936hn.mjs → descriptor-meta-nORSZfmr-Cw-pzAJr.mjs}
RENAMED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { t as sqliteTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-BkXK3OjD-CxZdKHCw.mjs";
|
|
2
2
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
3
3
|
import { temporalAuthoringPresets, temporalCodecPreset } from "@prisma/orm-family-sql/family/control";
|
|
4
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/descriptor-meta-
|
|
4
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/descriptor-meta-nORSZfmr.mjs
|
|
5
|
+
const sqliteAuthoringTypes = { BigIntNumber: {
|
|
6
|
+
kind: "typeConstructor",
|
|
7
|
+
output: {
|
|
8
|
+
codecId: "sqlite/bigintnumber@1",
|
|
9
|
+
nativeType: "integer"
|
|
10
|
+
}
|
|
11
|
+
} };
|
|
5
12
|
const sqliteAuthoringFieldPresets = { temporal: {
|
|
6
13
|
.../* @__PURE__ */ temporalAuthoringPresets({
|
|
7
14
|
codecId: "sqlite/datetime@1",
|
|
@@ -15,9 +22,12 @@ const sqliteAuthoringFieldPresets = { temporal: {
|
|
|
15
22
|
const sqliteTargetDescriptorMeta = {
|
|
16
23
|
...sqliteTargetDescriptorMetaRuntime,
|
|
17
24
|
defaultNamespaceId: UNBOUND_NAMESPACE_ID,
|
|
18
|
-
authoring: {
|
|
25
|
+
authoring: {
|
|
26
|
+
type: sqliteAuthoringTypes,
|
|
27
|
+
field: sqliteAuthoringFieldPresets
|
|
28
|
+
}
|
|
19
29
|
};
|
|
20
30
|
//#endregion
|
|
21
31
|
export { sqliteTargetDescriptorMeta as t };
|
|
22
32
|
|
|
23
|
-
//# sourceMappingURL=descriptor-meta-
|
|
33
|
+
//# sourceMappingURL=descriptor-meta-nORSZfmr-Cw-pzAJr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-nORSZfmr-Cw-pzAJr.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/descriptor-meta-nORSZfmr.mjs"],"sourcesContent":["import { t as sqliteTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-BkXK3OjD.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { temporalAuthoringPresets, temporalCodecPreset } from \"@internal/family-sql/control\";\n//#region src/core/authoring.ts\nconst sqliteAuthoringTypes = { BigIntNumber: {\n\tkind: \"typeConstructor\",\n\toutput: {\n\t\tcodecId: \"sqlite/bigintnumber@1\",\n\t\tnativeType: \"integer\"\n\t}\n} };\nconst sqliteAuthoringFieldPresets = { temporal: {\n\t.../* @__PURE__ */ temporalAuthoringPresets({\n\t\tcodecId: \"sqlite/datetime@1\",\n\t\tnativeType: \"text\"\n\t}),\n\tdatetime: /* @__PURE__ */ temporalCodecPreset({\n\t\tcodecId: \"sqlite/datetime@1\",\n\t\tnativeType: \"text\"\n\t})\n} };\nconst sqliteTargetDescriptorMeta = {\n\t...sqliteTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID,\n\tauthoring: {\n\t\ttype: sqliteAuthoringTypes,\n\t\tfield: sqliteAuthoringFieldPresets\n\t}\n};\n//#endregion\nexport { sqliteTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-nORSZfmr.mjs.map"],"mappings":";;;;AAIA,MAAM,uBAAuB,EAAE,cAAc;CAC5C,MAAM;CACN,QAAQ;EACP,SAAS;EACT,YAAY;CACb;AACD,EAAE;AACF,MAAM,8BAA8B,EAAE,UAAU;CAC/C,GAAmB,yCAAyB;EAC3C,SAAS;EACT,YAAY;CACb,CAAC;CACD,UAA0B,oCAAoB;EAC7C,SAAS;EACT,YAAY;CACb,CAAC;AACF,EAAE;AACF,MAAM,6BAA6B;CAClC,GAAG;CACH,oBAAoB;CACpB,WAAW;EACV,MAAM;EACN,OAAO;CACR;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as buildTargetDetails } from "./planner-target-details-CIQ789Gc-C5U4yVY9.mjs";
|
|
2
|
-
import { h as step } from "./op-factory-call-
|
|
2
|
+
import { h as step } from "./op-factory-call-BCDGjXmK-D_Q47Yko.mjs";
|
|
3
3
|
import { col as col$1, fn as fn$1, foreignKey, lit as lit$1, primaryKey, unique } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
4
4
|
import { placeholder } from "@prisma/orm-framework/errors/migration";
|
|
5
5
|
import { MigrationCLI } from "@prisma/orm-toolchain/cli/migration-cli";
|
|
@@ -44,4 +44,4 @@ function rawSql(op) {
|
|
|
44
44
|
//#endregion
|
|
45
45
|
export { foreignKey as a, primaryKey as c, fn$1 as i, rawSql as l, col$1 as n, lit$1 as o, dataTransform as r, placeholder as s, MigrationCLI as t, unique as u };
|
|
46
46
|
|
|
47
|
-
//# sourceMappingURL=migration-
|
|
47
|
+
//# sourceMappingURL=migration-DWP33-2M.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-DWP33-2M.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/migration.mjs"],"sourcesContent":["import { f as step } from \"./op-factory-call-BCDGjXmK.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CIQ789Gc.mjs\";\nimport { t as SqliteMigration } from \"./sqlite-migration-DWl9RerP.mjs\";\nimport { placeholder } from \"@internal/errors/migration\";\nimport { col, fn, foreignKey, lit, primaryKey, unique } from \"@internal/sql-relational-core/contract-free\";\nimport { MigrationCLI } from \"@internal/cli/migration-cli\";\n//#region src/core/migrations/operations/data-transform.ts\n/**\n* User-facing `dataTransform` factory for the SQLite migration authoring\n* surface. Invoked directly inside a `migration.ts` file to supply a\n* user-authored SQL statement that runs with operation class `'data'`.\n*\n* Typical use: the planner emits a `DataTransformCall` stub when a NOT NULL\n* tightening requires a backfill. The rendered `migration.ts` exposes the\n* backfill as a `placeholder(\"…\")` slot the user fills in with an\n* `UPDATE … WHERE col IS NULL` statement. The filled-in `dataTransform(...)`\n* invocation returns a runnable operation the runner executes before the\n* subsequent recreate-table op copies data into the tightened schema.\n*/\nfunction dataTransform(opts) {\n\treturn {\n\t\tid: opts.id,\n\t\tlabel: opts.label,\n\t\tsummary: opts.description,\n\t\toperationClass: \"data\",\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"table\", opts.table)\n\t\t},\n\t\tprecheck: [],\n\t\texecute: [step(opts.description, opts.run())],\n\t\tpostcheck: []\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/raw.ts\n/**\n* Identity factory for an already-materialized\n* `SqlMigrationPlanOperation<SqlitePlanTargetDetails>`. Mirrors the Postgres\n* `rawSql` factory: the planner uses this to carry ops produced by SQL-family\n* paths (codec lifecycle hooks, raw-SQL escape hatches) alongside structured\n* call IR without reverse-engineering their shape.\n*/\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\nexport { SqliteMigration as Migration, MigrationCLI, col, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, unique };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,SAAS,cAAc,MAAM;CAC5B,OAAO;EACN,IAAI,KAAK;EACT,OAAO,KAAK;EACZ,SAAS,KAAK;EACd,gBAAgB;EAChB,QAAQ;GACP,IAAI;GACJ,SAAS,mBAAmB,SAAS,KAAK,KAAK;EAChD;EACA,UAAU,CAAC;EACX,SAAS,CAAC,KAAK,KAAK,aAAa,KAAK,IAAI,CAAC,CAAC;EAC5C,WAAW,CAAC;CACb;AACD;;;;;;;;AAUA,SAAS,OAAO,IAAI;CACnB,OAAO;AACR"}
|
package/dist/{op-factory-call-C_or6163-B_LDzC37.mjs → op-factory-call-BCDGjXmK-D_Q47Yko.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as sqliteError } from "./errors-CKsaaSnD-BeB4JS8h.mjs";
|
|
2
|
-
import { i as tableExistsAst, n as createTable, r as indexExistsAst, t as columnExistsAst } from "./ddl-
|
|
2
|
+
import { i as tableExistsAst, n as createTable, r as indexExistsAst, t as columnExistsAst } from "./ddl-CXduXyOT-nlDP6DGx.mjs";
|
|
3
3
|
import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DqPXZBMA-Mm27NNjs.mjs";
|
|
4
4
|
import { t as buildTargetDetails } from "./planner-target-details-CIQ789Gc-C5U4yVY9.mjs";
|
|
5
5
|
import { n as stripOuterParens } from "./default-normalizer-DuoHj9-O-DsK7lJZn.mjs";
|
|
@@ -10,7 +10,7 @@ import { RelationalSchemaNodeKind } from "@prisma/orm-family-sql/schema-ir/types
|
|
|
10
10
|
import { errorUnfilledPlaceholder } from "@prisma/orm-framework/errors/migration";
|
|
11
11
|
import { TsExpression, jsonToTsSource } from "@prisma/orm-framework/ts-render";
|
|
12
12
|
import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
|
|
13
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/op-factory-call-
|
|
13
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/op-factory-call-BCDGjXmK.mjs
|
|
14
14
|
const SAFE_NATIVE_TYPE_PATTERN = /^[a-zA-Z][a-zA-Z0-9_ ]*$/;
|
|
15
15
|
function assertSafeNativeType(nativeType) {
|
|
16
16
|
if (!SAFE_NATIVE_TYPE_PATTERN.test(nativeType)) throw sqliteError("CONTRACT.NATIVE_TYPE_INVALID", `Unsafe native type name in contract: "${nativeType}". Native type names must match /^[a-zA-Z][a-zA-Z0-9_ ]*\$/`, { meta: { nativeType } });
|
|
@@ -826,4 +826,4 @@ var RawSqlCall = class extends SqliteOpFactoryCallNode {
|
|
|
826
826
|
//#endregion
|
|
827
827
|
export { DropColumnCall as a, RawSqlCall as c, buildColumnTypeSql as d, buildRecreatePostchecks as f, step as h, DataTransformCall as i, RecreateTableCall as l, renderDefaultLiteral as m, CreateIndexCall as n, DropIndexCall as o, buildRecreateSummary as p, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, buildColumnDefaultSql as u };
|
|
828
828
|
|
|
829
|
-
//# sourceMappingURL=op-factory-call-
|
|
829
|
+
//# sourceMappingURL=op-factory-call-BCDGjXmK-D_Q47Yko.mjs.map
|