@prisma/orm-target-sqlite 8.0.0-rc.13-dev.11 → 8.0.0-rc.14
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-Bp_4Bjff-Nnv9oVby.d.mts → adapter-Bp_4Bjff-e0IpIZ1b.d.mts} +3 -3
- package/dist/{adapter-Bp_4Bjff-Nnv9oVby.d.mts.map → adapter-Bp_4Bjff-e0IpIZ1b.d.mts.map} +1 -1
- package/dist/{adapter-DBvizrEP-CJaqd8s4.mjs → adapter-DBvizrEP-SHMMlDkU.mjs} +3 -2
- package/dist/{adapter-DBvizrEP-CJaqd8s4.mjs.map → adapter-DBvizrEP-SHMMlDkU.mjs.map} +1 -1
- package/dist/adapter-_aaOdX79.d.mts +2 -0
- package/dist/adapter.d.mts +9 -9
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.d.mts +2 -2
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__control.d.mts +2 -2
- package/dist/adapter__control.mjs +4 -4
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/adapter__sql-renderer.d.mts +2 -2
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/codec-types-2BtIaiN_.d.mts +2 -0
- package/dist/codec-types-Bo18WDYR.d.mts +1 -0
- package/dist/{codec-types-DQBnSX3r-D0oAxE0z.d.mts → codec-types-Dm8kn3W4-BAWXUJJ8.d.mts} +3 -3
- package/dist/{codec-types-DQBnSX3r-D0oAxE0z.d.mts.map → codec-types-Dm8kn3W4-BAWXUJJ8.d.mts.map} +1 -1
- package/dist/codecs-Bsf9bHq3.mjs +49 -0
- package/dist/codecs-Bsf9bHq3.mjs.map +1 -0
- package/dist/{codecs-DVJZH-Ws-BZsPaWVJ.d.mts → codecs-BzSfaf5F-gXK7Etj3.d.mts} +2 -3
- package/dist/codecs-BzSfaf5F-gXK7Etj3.d.mts.map +1 -0
- package/dist/{codecs-mYqxakCT.mjs → codecs-CK___nqu-ByljcwNa.mjs} +28 -61
- package/dist/codecs-CK___nqu-ByljcwNa.mjs.map +1 -0
- package/dist/codecs-cfQqBb8r.d.mts +1 -0
- package/dist/{control-CLllizuP.d.mts → control-DG-hF-sF.d.mts} +4 -4
- package/dist/{control-CLllizuP.d.mts.map → control-DG-hF-sF.d.mts.map} +1 -1
- package/dist/{data-types-BOA80gRp-DV5kY9es.mjs → data-types-B6gWpyYW-CVM4AAZK.mjs} +22 -5
- package/dist/data-types-B6gWpyYW-CVM4AAZK.mjs.map +1 -0
- package/dist/{data-types-c3xcs6Mr.mjs → data-types-BgJU9cGq.mjs} +2 -2
- package/dist/data-types-BgJU9cGq.mjs.map +1 -0
- package/dist/{data-types-D3cyzV-O.d.mts → data-types-j8tJbltU.d.mts} +7 -2
- package/dist/data-types-j8tJbltU.d.mts.map +1 -0
- package/dist/{descriptor-meta-CqCH7n4c-BUIJjrKo.mjs → descriptor-meta-CqCH7n4c-Btl4cIXf.mjs} +3 -3
- package/dist/{descriptor-meta-CqCH7n4c-BUIJjrKo.mjs.map → descriptor-meta-CqCH7n4c-Btl4cIXf.mjs.map} +1 -1
- package/dist/{migration-CWDID6Ww.mjs → migration-BNB89lIv.mjs} +2 -2
- package/dist/{migration-CWDID6Ww.mjs.map → migration-BNB89lIv.mjs.map} +1 -1
- package/dist/{migration-DvsJtoPa.d.mts → migration-DSmUh0wk.d.mts} +3 -3
- package/dist/{migration-DvsJtoPa.d.mts.map → migration-DSmUh0wk.d.mts.map} +1 -1
- package/dist/{op-factory-call-CIivnKC6-BkzTmbmn.mjs → op-factory-call-C8CNBvCb-DyXVtd7o.mjs} +13 -7
- package/dist/op-factory-call-C8CNBvCb-DyXVtd7o.mjs.map +1 -0
- package/dist/{op-factory-call-DoHN7Q7L.d.mts → op-factory-call-C8jSguMU.d.mts} +2 -2
- package/dist/{op-factory-call-DoHN7Q7L.d.mts.map → op-factory-call-C8jSguMU.d.mts.map} +1 -1
- package/dist/{pack-ChN5gD_h.d.mts → pack-B488MxTx.d.mts} +2 -2
- package/dist/{pack-ChN5gD_h.d.mts.map → pack-B488MxTx.d.mts.map} +1 -1
- package/dist/{planner-CQOMheDh.d.mts → planner-B4FWi-jn.d.mts} +2 -2
- package/dist/{planner-CQOMheDh.d.mts.map → planner-B4FWi-jn.d.mts.map} +1 -1
- package/dist/{planner-BCwSwVSR-D_JBectN.mjs → planner-BTKa_OaV-Bl9T8ftA.mjs} +34 -13
- package/dist/planner-BTKa_OaV-Bl9T8ftA.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-C4NXxWMW-Bq44vd36.d.mts → planner-produced-sqlite-migration-C0pHN3qf-D1QDsx7l.d.mts} +3 -3
- package/dist/planner-produced-sqlite-migration-C0pHN3qf-D1QDsx7l.d.mts.map +1 -0
- package/dist/{planner-produced-sqlite-migration-BeAL3yLq-R6Dsf1M-.mjs → planner-produced-sqlite-migration-CAvJnzes-wf8WQ39U.mjs} +3 -3
- package/dist/{planner-produced-sqlite-migration-BeAL3yLq-R6Dsf1M-.mjs.map → planner-produced-sqlite-migration-CAvJnzes-wf8WQ39U.mjs.map} +1 -1
- package/dist/planner-produced-sqlite-migration-aw2sx-H-.d.mts +1 -0
- package/dist/{runtime-CKCyb8GD.d.mts → runtime-7ugF7qno.d.mts} +2 -2
- package/dist/{runtime-CKCyb8GD.d.mts.map → runtime-7ugF7qno.d.mts.map} +1 -1
- package/dist/{shared-BYAX0FaQ--VvRXVRC.d.mts → shared-AQqQ1hrb-3EPsz46S.d.mts} +2 -2
- package/dist/shared-AQqQ1hrb-3EPsz46S.d.mts.map +1 -0
- package/dist/sql-renderer-CSKXHcaY.d.mts +1 -0
- package/dist/{sqlite-migration-BVB27RsP-vMeuWP-0.d.mts → sqlite-migration-0qCGfq-S-wwKN7Zb3.d.mts} +3 -3
- package/dist/{sqlite-migration-BVB27RsP-vMeuWP-0.d.mts.map → sqlite-migration-0qCGfq-S-wwKN7Zb3.d.mts.map} +1 -1
- package/dist/{sqlite-migration-B3tZyoQY-yPLS2UuO.mjs → sqlite-migration-BKSuDis9-UHqFOBqU.mjs} +3 -3
- package/dist/{sqlite-migration-B3tZyoQY-yPLS2UuO.mjs.map → sqlite-migration-BKSuDis9-UHqFOBqU.mjs.map} +1 -1
- package/dist/target.d.mts +13 -13
- package/dist/target.mjs +10 -9
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -1
- package/dist/target__control.mjs +4 -4
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.d.mts +2 -2
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.d.mts +1 -1
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__planner-produced-sqlite-migration.d.mts +2 -2
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/{types-C5xbLI70.d.mts → types-DIgSNaLb.d.mts} +1 -1
- package/package.json +9 -9
- package/dist/adapter-C_J2HnoS.d.mts +0 -2
- package/dist/codec-types-DXkHvYl0.d.mts +0 -1
- package/dist/codec-types-DrRP65a-.d.mts +0 -2
- package/dist/codecs-Bc5WpLpi.d.mts +0 -1
- package/dist/codecs-DVJZH-Ws-BZsPaWVJ.d.mts.map +0 -1
- package/dist/codecs-mYqxakCT.mjs.map +0 -1
- package/dist/data-types-BOA80gRp-DV5kY9es.mjs.map +0 -1
- package/dist/data-types-D3cyzV-O.d.mts.map +0 -1
- package/dist/data-types-c3xcs6Mr.mjs.map +0 -1
- package/dist/op-factory-call-CIivnKC6-BkzTmbmn.mjs.map +0 -1
- package/dist/planner-BCwSwVSR-D_JBectN.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-BLJCGYw8.d.mts +0 -1
- package/dist/planner-produced-sqlite-migration-C4NXxWMW-Bq44vd36.d.mts.map +0 -1
- package/dist/shared-BYAX0FaQ--VvRXVRC.d.mts.map +0 -1
- package/dist/sql-renderer-D2p6McsA.d.mts +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { n as buildSqliteCodecDescriptorRegistry } from "./codec-descriptor-DAmZuKvV-B2UsMrgX.mjs";
|
|
2
|
+
import { t as codecDescriptors } from "./codecs-CK___nqu-ByljcwNa.mjs";
|
|
3
|
+
import { extractCodecLookup } from "@prisma/orm-framework/components/control";
|
|
4
|
+
import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
|
|
5
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codecs.mjs
|
|
6
|
+
/**
|
|
7
|
+
* Registry of every codec descriptor shipped by `@internal/target-sqlite`.
|
|
8
|
+
*
|
|
9
|
+
* 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.
|
|
10
|
+
*/
|
|
11
|
+
const sqliteCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);
|
|
12
|
+
const sqliteCodecDescriptorRegistry = buildSqliteCodecDescriptorRegistry(codecDescriptors);
|
|
13
|
+
function descriptorsFrom(contributors) {
|
|
14
|
+
return contributors.flatMap((contributor) => contributor.types?.codecTypes?.codecDescriptors ?? []);
|
|
15
|
+
}
|
|
16
|
+
function buildSqliteCodecRegistry(descriptors) {
|
|
17
|
+
const descriptorRegistry = buildSqliteCodecDescriptorRegistry(descriptors);
|
|
18
|
+
const registry = {
|
|
19
|
+
...extractCodecLookup([{
|
|
20
|
+
id: "sqlite-codecs",
|
|
21
|
+
types: { codecTypes: { codecDescriptors: Array.from(descriptorRegistry.values()) } }
|
|
22
|
+
}]),
|
|
23
|
+
descriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),
|
|
24
|
+
values: () => descriptorRegistry.values()
|
|
25
|
+
};
|
|
26
|
+
return Object.freeze(registry);
|
|
27
|
+
}
|
|
28
|
+
function assembleSqliteCodecRegistry(target, extensions) {
|
|
29
|
+
return buildSqliteCodecRegistry([
|
|
30
|
+
...descriptorsFrom([target]),
|
|
31
|
+
...sqliteCodecDescriptorRegistry.values(),
|
|
32
|
+
...descriptorsFrom(extensions)
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
function createSqliteCodecRegistryWithBuiltins(codecDescriptors = []) {
|
|
36
|
+
return buildSqliteCodecRegistry([...sqliteCodecDescriptorRegistry.values(), ...codecDescriptors]);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Build a coherent SQLite codec registry populated with built-in descriptors only.
|
|
40
|
+
*
|
|
41
|
+
* The returned registry supports both ordinary codec materialization and SQLite target behavior. Stack-composed paths build the same combined registry from target, full adapter, and ordered extension contributions.
|
|
42
|
+
*/
|
|
43
|
+
function createSqliteBuiltinCodecLookup() {
|
|
44
|
+
return createSqliteCodecRegistryWithBuiltins();
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { sqliteCodecRegistry as a, sqliteCodecDescriptorRegistry as i, createSqliteBuiltinCodecLookup as n, createSqliteCodecRegistryWithBuiltins as r, assembleSqliteCodecRegistry as t };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=codecs-Bsf9bHq3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-Bsf9bHq3.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs.mjs"],"sourcesContent":["import { n as buildSqliteCodecDescriptorRegistry } from \"./codec-descriptor-DAmZuKvV.mjs\";\nimport { a as sqliteBigintColumn, c as sqliteDatetimeColumn, d as sqliteRealColumn, f as sqliteTextColumn, i as jsonDocumentRetag, l as sqliteIntegerColumn, o as sqliteBigintNumberColumn, s as sqliteBlobColumn, t as codecDescriptors, u as sqliteJsonColumn } from \"./codecs-CK___nqu.mjs\";\nimport { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\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\n//#region src/core/codec-registry.ts\nfunction descriptorsFrom(contributors) {\n\treturn contributors.flatMap((contributor) => contributor.types?.codecTypes?.codecDescriptors ?? []);\n}\nfunction buildSqliteCodecRegistry(descriptors) {\n\tconst descriptorRegistry = buildSqliteCodecDescriptorRegistry(descriptors);\n\tconst registry = {\n\t\t...extractCodecLookup([{\n\t\t\tid: \"sqlite-codecs\",\n\t\t\ttypes: { codecTypes: { codecDescriptors: Array.from(descriptorRegistry.values()) } }\n\t\t}]),\n\t\tdescriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),\n\t\tvalues: () => descriptorRegistry.values()\n\t};\n\treturn Object.freeze(registry);\n}\nfunction assembleSqliteCodecRegistry(target, extensions) {\n\treturn buildSqliteCodecRegistry([\n\t\t...descriptorsFrom([target]),\n\t\t...sqliteCodecDescriptorRegistry.values(),\n\t\t...descriptorsFrom(extensions)\n\t]);\n}\nfunction createSqliteCodecRegistryWithBuiltins(codecDescriptors = []) {\n\treturn buildSqliteCodecRegistry([...sqliteCodecDescriptorRegistry.values(), ...codecDescriptors]);\n}\n/**\n* Build a coherent SQLite codec registry populated with built-in descriptors only.\n*\n* The returned registry supports both ordinary codec materialization and SQLite target behavior. Stack-composed paths build the same combined registry from target, full adapter, and ordered extension contributions.\n*/\nfunction createSqliteBuiltinCodecLookup() {\n\treturn createSqliteCodecRegistryWithBuiltins();\n}\n//#endregion\nexport { assembleSqliteCodecRegistry, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, jsonDocumentRetag, sqliteBigintColumn, sqliteBigintNumberColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };\n\n//# sourceMappingURL=codecs.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,sBAAsB,6BAA6B,gBAAgB;AACzE,MAAM,gCAAgC,mCAAmC,gBAAgB;AAGzF,SAAS,gBAAgB,cAAc;CACtC,OAAO,aAAa,SAAS,gBAAgB,YAAY,OAAO,YAAY,oBAAoB,CAAC,CAAC;AACnG;AACA,SAAS,yBAAyB,aAAa;CAC9C,MAAM,qBAAqB,mCAAmC,WAAW;CACzE,MAAM,WAAW;EAChB,GAAG,mBAAmB,CAAC;GACtB,IAAI;GACJ,OAAO,EAAE,YAAY,EAAE,kBAAkB,MAAM,KAAK,mBAAmB,OAAO,CAAC,EAAE,EAAE;EACpF,CAAC,CAAC;EACF,gBAAgB,YAAY,mBAAmB,cAAc,OAAO;EACpE,cAAc,mBAAmB,OAAO;CACzC;CACA,OAAO,OAAO,OAAO,QAAQ;AAC9B;AACA,SAAS,4BAA4B,QAAQ,YAAY;CACxD,OAAO,yBAAyB;EAC/B,GAAG,gBAAgB,CAAC,MAAM,CAAC;EAC3B,GAAG,8BAA8B,OAAO;EACxC,GAAG,gBAAgB,UAAU;CAC9B,CAAC;AACF;AACA,SAAS,sCAAsC,mBAAmB,CAAC,GAAG;CACrE,OAAO,yBAAyB,CAAC,GAAG,8BAA8B,OAAO,GAAG,GAAG,gBAAgB,CAAC;AACjG;;;;;;AAMA,SAAS,iCAAiC;CACzC,OAAO,sCAAsC;AAC9C"}
|
|
@@ -5,7 +5,7 @@ import { CodecCallContext, CodecImpl, CodecInstanceContext, CodecRegistry } from
|
|
|
5
5
|
import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
6
6
|
import { ComponentMetadata } from "@prisma/orm-framework/components/components";
|
|
7
7
|
import { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
|
|
8
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-
|
|
8
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-BzSfaf5F.d.mts
|
|
9
9
|
//#region src/core/codec-helpers.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* 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.
|
|
@@ -113,7 +113,6 @@ declare class SqliteBlobDescriptor extends SqliteCodecDescriptor<void> {
|
|
|
113
113
|
}
|
|
114
114
|
declare const sqliteBlobColumn: () => import("@prisma/orm-framework/components/codec").ColumnSpec<SqliteBlobCodec, undefined>;
|
|
115
115
|
declare class SqliteDatetimeCodec extends CodecImpl<typeof SQLITE_DATETIME_CODEC_ID, readonly ['equality', 'order'], string, Date> {
|
|
116
|
-
private parseDate;
|
|
117
116
|
encode(value: Date, _ctx: CodecCallContext): Promise<string>;
|
|
118
117
|
decode(wire: string, _ctx: CodecCallContext): Promise<Date>;
|
|
119
118
|
encodeJson(value: Date): JsonValue;
|
|
@@ -211,4 +210,4 @@ declare const sqliteCodecRegistry: CodecDescriptorRegistry;
|
|
|
211
210
|
declare const sqliteCodecDescriptorRegistry: SqliteCodecDescriptorRegistry;
|
|
212
211
|
//#endregion
|
|
213
212
|
export { sqliteRealColumn as C, sqliteJsonColumn as S, sqliteBlobColumn as _, SqliteCodecRegistry as a, sqliteDatetimeColumn as b, SqliteJsonDescriptor as c, assembleSqliteCodecRegistry as d, createSqliteBuiltinCodecLookup as f, sqliteBigintNumberColumn as g, sqliteBigintColumn as h, SqliteBlobDescriptor as i, SqliteRealDescriptor as l, jsonDocumentRetag as m, SqliteBigintDescriptor as n, SqliteDatetimeDescriptor as o, createSqliteCodecRegistryWithBuiltins as p, SqliteBigintNumberDescriptor as r, SqliteIntegerDescriptor as s, JsonValue$1 as t, SqliteTextDescriptor as u, sqliteCodecDescriptorRegistry as v, sqliteTextColumn as w, sqliteIntegerColumn as x, sqliteCodecRegistry as y };
|
|
214
|
-
//# sourceMappingURL=codecs-
|
|
213
|
+
//# sourceMappingURL=codecs-BzSfaf5F-gXK7Etj3.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-BzSfaf5F-gXK7Etj3.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs-BzSfaf5F.d.mts"],"mappings":";;;;;;;;;;;;KAWK;YACO,cAAc;aACb;;;KAGR,mBAAmB,KAAK;KACxB,sBAAsB,gBAAgB;iBAC1B,4BAA4B,QAAQ,kBAAkB,YAAY,cAAc,oBAAoB;iBACpG,sCAAsC,4BAA4B,6BAA6B;;;;;;iBAM/F,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;cAuBrC,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,yDAAyD;WACzD;WACA;WACA;WACA;EACT,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,yDAAyD;WACzD;WACA;WACA;WACA;EACT,YAAY,KAAK,yBAAyB;;cAE9B,0EAA0E,WAAW;cACrF,wBAAwB,iBAAiB;EACrD,OAAO,eAAe,MA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;EAC3B,WAAW,MAAM;;cAEL,+BAA+B;YACjC,eAAe,YAAY,iBAAiB;WAC7C,yDAAyD;WACzD;WACA;WACA;WACA;EACT,YAAY,KAAK,yBAAyB;;cAE9B,yEAAyE,WAAW;;;;;;;;;;cAUpF,gCAAgC,iBAAiB;EAC7D,OAAO,eAAe,MAAM,mBAAmB;;;;;;EAM/C,OAAO,gCAAgC,MAAM,mBAAmB;EAChE,WAAW,gBAAgB;EAC3B,WAAW,MAAM;;cAEL,qCAAqC;YACvC,eAAe,YAAY,iBAAiB;WAC7C,yDAAyD;WACzD;WACA;WACA;WACA;EACT,mBAAmB,OAAO;EAC1B,YAAY,KAAK,yBAAyB;;cAE9B,+EAA+E,WAAW;;;;;;;;cAQ1F,qBAAqB;cACrB,+BAA+B"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
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
|
-
import { a as sqliteCodec,
|
|
3
|
-
import { a as
|
|
2
|
+
import { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-DAmZuKvV-B2UsMrgX.mjs";
|
|
3
|
+
import { a as sqliteDatetimeCanonical, c as sqliteReal, i as sqliteDatetime, l as sqliteText, n as sqliteBlob, o as sqliteInteger, s as sqliteJson, t as sqliteBigint } from "./data-types-B6gWpyYW-CVM4AAZK.mjs";
|
|
4
4
|
import { n as sqliteError } from "./errors-DnR-sMHS-KkMLIP2U.mjs";
|
|
5
5
|
import { CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
6
|
import { CodecImpl, column } from "@prisma/orm-framework/components/codec";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codecs.mjs
|
|
7
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
8
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-CK___nqu.mjs
|
|
10
9
|
/**
|
|
11
10
|
* Projects the expression unchanged, for codecs whose canonical JSON is what
|
|
12
11
|
* SQLite's own JSON conversion already produces.
|
|
@@ -178,7 +177,7 @@ var SqliteTextCodec = class extends CodecImpl {
|
|
|
178
177
|
return value;
|
|
179
178
|
}
|
|
180
179
|
decodeJson(json) {
|
|
181
|
-
return json;
|
|
180
|
+
return blindCast(json);
|
|
182
181
|
}
|
|
183
182
|
};
|
|
184
183
|
var SqliteTextDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -311,30 +310,38 @@ var SqliteBlobDescriptor = class extends SqliteCodecDescriptor {
|
|
|
311
310
|
};
|
|
312
311
|
const sqliteBlobDescriptor = new SqliteBlobDescriptor();
|
|
313
312
|
const sqliteBlobColumn = () => column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, void 0, "blob");
|
|
313
|
+
/**
|
|
314
|
+
* Reads the text SQLite holds for an instant. Rejects `Invalid Date` (NaN-time) at every decode
|
|
315
|
+
* ingress so consumers never receive a Date whose downstream operations silently produce NaN.
|
|
316
|
+
*/
|
|
317
|
+
function decodeSqliteDatetime(value) {
|
|
318
|
+
const date = new Date(value);
|
|
319
|
+
if (Number.isNaN(date.getTime())) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/datetime@1 value must be a valid ISO-8601 string: ${value}`, { meta: {
|
|
320
|
+
codecId: SQLITE_DATETIME_CODEC_ID,
|
|
321
|
+
received: value
|
|
322
|
+
} });
|
|
323
|
+
return date;
|
|
324
|
+
}
|
|
325
|
+
/** The text SQLite holds for an instant: what the codec writes for every row, and for a default. */
|
|
326
|
+
function encodeSqliteDatetime(value) {
|
|
327
|
+
return value.toISOString();
|
|
328
|
+
}
|
|
314
329
|
var SqliteDatetimeCodec = class extends CodecImpl {
|
|
315
|
-
parseDate(value) {
|
|
316
|
-
const date = new Date(value);
|
|
317
|
-
if (Number.isNaN(date.getTime())) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/datetime@1 value must be a valid ISO-8601 string: ${value}`, { meta: {
|
|
318
|
-
codecId: SQLITE_DATETIME_CODEC_ID,
|
|
319
|
-
received: value
|
|
320
|
-
} });
|
|
321
|
-
return date;
|
|
322
|
-
}
|
|
323
330
|
async encode(value, _ctx) {
|
|
324
|
-
return value
|
|
331
|
+
return encodeSqliteDatetime(value);
|
|
325
332
|
}
|
|
326
333
|
async decode(wire, _ctx) {
|
|
327
|
-
return
|
|
334
|
+
return decodeSqliteDatetime(wire);
|
|
328
335
|
}
|
|
329
336
|
encodeJson(value) {
|
|
330
|
-
return value.toISOString();
|
|
337
|
+
return sqliteDatetimeCanonical(value.toISOString());
|
|
331
338
|
}
|
|
332
339
|
decodeJson(json) {
|
|
333
340
|
if (typeof json !== "string") throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/datetime@1 contract value must be an ISO-8601 string", { meta: {
|
|
334
341
|
codecId: SQLITE_DATETIME_CODEC_ID,
|
|
335
342
|
received: typeof json
|
|
336
343
|
} });
|
|
337
|
-
return
|
|
344
|
+
return decodeSqliteDatetime(json);
|
|
338
345
|
}
|
|
339
346
|
};
|
|
340
347
|
var SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -357,7 +364,7 @@ var SqliteJsonCodec = class extends CodecImpl {
|
|
|
357
364
|
return JSON.stringify(value);
|
|
358
365
|
}
|
|
359
366
|
async decode(wire, _ctx) {
|
|
360
|
-
return typeof wire === "string" ? JSON.parse(wire) : wire;
|
|
367
|
+
return typeof wire === "string" ? blindCast(JSON.parse(wire)) : wire;
|
|
361
368
|
}
|
|
362
369
|
encodeJson(value) {
|
|
363
370
|
return value;
|
|
@@ -508,47 +515,7 @@ const codecDescriptors = defineSqliteCodecs([
|
|
|
508
515
|
sqliteBigintDescriptor,
|
|
509
516
|
sqliteBigintNumberDescriptor
|
|
510
517
|
]);
|
|
511
|
-
/**
|
|
512
|
-
* Registry of every codec descriptor shipped by `@internal/target-sqlite`.
|
|
513
|
-
*
|
|
514
|
-
* 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.
|
|
515
|
-
*/
|
|
516
|
-
const sqliteCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);
|
|
517
|
-
const sqliteCodecDescriptorRegistry = buildSqliteCodecDescriptorRegistry(codecDescriptors);
|
|
518
|
-
function descriptorsFrom(contributors) {
|
|
519
|
-
return contributors.flatMap((contributor) => contributor.types?.codecTypes?.codecDescriptors ?? []);
|
|
520
|
-
}
|
|
521
|
-
function buildSqliteCodecRegistry(descriptors) {
|
|
522
|
-
const descriptorRegistry = buildSqliteCodecDescriptorRegistry(descriptors);
|
|
523
|
-
const registry = {
|
|
524
|
-
...extractCodecLookup([{
|
|
525
|
-
id: "sqlite-codecs",
|
|
526
|
-
types: { codecTypes: { codecDescriptors: Array.from(descriptorRegistry.values()) } }
|
|
527
|
-
}]),
|
|
528
|
-
descriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),
|
|
529
|
-
values: () => descriptorRegistry.values()
|
|
530
|
-
};
|
|
531
|
-
return Object.freeze(registry);
|
|
532
|
-
}
|
|
533
|
-
function assembleSqliteCodecRegistry(target, extensions) {
|
|
534
|
-
return buildSqliteCodecRegistry([
|
|
535
|
-
...descriptorsFrom([target]),
|
|
536
|
-
...sqliteCodecDescriptorRegistry.values(),
|
|
537
|
-
...descriptorsFrom(extensions)
|
|
538
|
-
]);
|
|
539
|
-
}
|
|
540
|
-
function createSqliteCodecRegistryWithBuiltins(codecDescriptors = []) {
|
|
541
|
-
return buildSqliteCodecRegistry([...sqliteCodecDescriptorRegistry.values(), ...codecDescriptors]);
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Build a coherent SQLite codec registry populated with built-in descriptors only.
|
|
545
|
-
*
|
|
546
|
-
* The returned registry supports both ordinary codec materialization and SQLite target behavior. Stack-composed paths build the same combined registry from target, full adapter, and ordered extension contributions.
|
|
547
|
-
*/
|
|
548
|
-
function createSqliteBuiltinCodecLookup() {
|
|
549
|
-
return createSqliteCodecRegistryWithBuiltins();
|
|
550
|
-
}
|
|
551
518
|
//#endregion
|
|
552
|
-
export { sqliteBigintColumn as a,
|
|
519
|
+
export { sqliteBigintColumn as a, sqliteDatetimeColumn as c, sqliteRealColumn as d, sqliteTextColumn as f, jsonDocumentRetag as i, sqliteIntegerColumn as l, decodeSqliteDatetime as n, sqliteBigintNumberColumn as o, encodeSqliteDatetime as r, sqliteBlobColumn as s, codecDescriptors as t, sqliteJsonColumn as u };
|
|
553
520
|
|
|
554
|
-
//# sourceMappingURL=codecs-
|
|
521
|
+
//# sourceMappingURL=codecs-CK___nqu-ByljcwNa.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-CK___nqu-ByljcwNa.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs-CK___nqu.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 sqliteDatetimeCanonical, c as sqliteReal, i as sqliteDatetime, l as sqliteText, n as sqliteBlob, o as sqliteInteger, s as sqliteJson, t as sqliteBigint } from \"./data-types-B6gWpyYW.mjs\";\nimport { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from \"./codec-descriptor-DAmZuKvV.mjs\";\nimport { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from \"@internal/sql-relational-core/ast\";\nimport { CodecImpl, column } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\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/** Renders the decimal text `sqlite/bigintnumber@1` carries, whose application type is `number`, as a number literal. */\nconst decimalTextNumberLiteral = (value) => typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? value : void 0;\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 application value to be of the JS type the codec reads.\n*\n* A range check reads a value of the wrong type as a value out of range, and\n* reports a number plainly inside the range as outside it — so the type is\n* established first and answered for on its own terms, naming what a caller\n* has to change.\n*/\nconst requireJsType = (codecId, expected, value) => {\n\tif (typeof value === expected) return;\n\tthrow sqliteError(\"RUNTIME.ENCODE_FAILED\", `${codecId} value must be a ${expected}, got ${typeof value} ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: typeof value\n\t} });\n};\n/**\n* Writes an application value as the decimal text `sqlite/bigint@1` carries as\n* its canonical JSON.\n*\n* A schema-written literal default (`BigInt @default(0)`) arrives here as a\n* `number`, since a number literal is the only integer a schema language\n* writes, and one that is a safe integer names its value exactly. Past that\n* range the literal was rounded before any of this ran, so the value written is\n* not the value meant — which this refuses rather than minting an exact-looking\n* value from it. A non-integral number is refused on the same terms.\n*/\nconst bigintEncodeJson = (codecId, value) => {\n\tif (typeof value !== \"number\") {\n\t\trequireJsType(codecId, \"bigint\", value);\n\t\treturn value.toString();\n\t}\n\tif (!Number.isSafeInteger(value)) throw sqliteError(\"RUNTIME.ENCODE_FAILED\", `${codecId} number literal must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(value)\n\t} });\n\treturn BigInt(value).toString();\n};\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/** The application value the number-flavoured integer codec writes: the JS type it reads, within the range that type holds exactly. */\nconst encodableSafeInteger = (value) => {\n\trequireJsType(SQLITE_BIGINT_NUMBER_CODEC_ID, \"number\", value);\n\treturn safeIntegerNumber(value, \"RUNTIME.ENCODE_FAILED\");\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, {\n\tdataType: sqliteText.id,\n\tjsonProjection: identityJsonProjection\n});\nconst sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, {\n\tdataType: sqliteText.id,\n\tjsonProjection: identityJsonProjection\n});\nconst sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, {\n\tdataType: sqliteInteger.id,\n\tjsonProjection: identityJsonProjection\n});\nconst sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, {\n\tdataType: sqliteReal.id,\n\tjsonProjection: identityJsonProjection\n});\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 blindCast(json);\n\t}\n};\nvar SqliteTextDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tdataType = sqliteText.id;\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 = void 0;\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\tif (typeof json !== \"number\") throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/integer@1 database JSON value must be a number\", { meta: {\n\t\t\tcodecId: SQLITE_INTEGER_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\tif (!Number.isSafeInteger(json)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `sqlite/integer@1 value must be an integer within the safe integer range, got ${String(json)}`, { meta: {\n\t\t\tcodecId: SQLITE_INTEGER_CODEC_ID,\n\t\t\treceived: String(json)\n\t\t} });\n\t\treturn json;\n\t}\n};\nvar SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tdataType = sqliteInteger.id;\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 = void 0;\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\tdataType = sqliteReal.id;\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 = void 0;\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\tdataType = sqliteBlob.id;\n\tcodecId = SQLITE_BLOB_CODEC_ID;\n\ttraits = [\"equality\"];\n\ttargetTypes = [\"blob\"];\n\tparamsSchema = void 0;\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\");\n/**\n* Reads the text SQLite holds for an instant. Rejects `Invalid Date` (NaN-time) at every decode\n* ingress so consumers never receive a Date whose downstream operations silently produce NaN.\n*/\nfunction decodeSqliteDatetime(value) {\n\tconst date = new Date(value);\n\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\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\treceived: value\n\t} });\n\treturn date;\n}\n/** The text SQLite holds for an instant: what the codec writes for every row, and for a default. */\nfunction encodeSqliteDatetime(value) {\n\treturn value.toISOString();\n}\nvar SqliteDatetimeCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn encodeSqliteDatetime(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn decodeSqliteDatetime(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn sqliteDatetimeCanonical(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 decodeSqliteDatetime(json);\n\t}\n};\nvar SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tdataType = sqliteDatetime.id;\n\tcodecId = SQLITE_DATETIME_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = void 0;\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\" ? blindCast(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\tdataType = sqliteJson.id;\n\tcodecId = SQLITE_JSON_CODEC_ID;\n\ttraits = [\"equality\"];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = void 0;\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\trequireJsType(SQLITE_BIGINT_CODEC_ID, \"bigint\", value);\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 bigintEncodeJson(SQLITE_BIGINT_CODEC_ID, value);\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\tdataType = sqliteBigint.id;\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 = void 0;\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 the decimal text\n* `sqlite/bigint` carries, which every codec of that data type shares. The\n* descriptor claims no target type, so `integer` in type position keeps its\n* current codecs.\n*/\nvar SqliteBigintNumberCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn encodableSafeInteger(value);\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 String(encodableSafeInteger(value));\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"string\" || !DECIMAL_INTEGER.test(json)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/bigintnumber@1 database JSON value must be decimal text\", { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_NUMBER_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn safeIntegerFromBigint(BigInt(json));\n\t}\n};\nvar SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn decimalTextJsonProjection(expression);\n\t}\n\tdataType = sqliteBigint.id;\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 = void 0;\n\trenderValueLiteral(value) {\n\t\treturn decimalTextNumberLiteral(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\nexport { sqliteBigintColumn as a, sqliteDatetimeColumn as c, sqliteRealColumn as d, sqliteTextColumn as f, jsonDocumentRetag as i, sqliteIntegerColumn as l, decodeSqliteDatetime as n, sqliteBigintNumberColumn as o, encodeSqliteDatetime as r, sqliteBlobColumn as s, codecDescriptors as t, sqliteJsonColumn as u };\n\n//# sourceMappingURL=codecs-CK___nqu.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,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;;AAEtB,MAAM,4BAA4B,UAAU,OAAO,UAAU,YAAY,gBAAgB,KAAK,KAAK,IAAI,QAAQ,KAAK;;;;;;AAMpH,MAAM,cAAc,OAAO,SAAS;CACnC,IAAI,CAAC,OAAO,SAAS,KAAK,GAAG,MAAM,YA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B,IAAI,OAAO,SAAS,UAAU,OAAO,kBAAkB,MAAM,uBAAuB;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,OAAO,qBAAqB,KAAK,CAAC;CAC1C;CACA,WAAW,MAAM;EAChB,IAAI,OAAO,SAAS,YAAY,CAAC,gBAAgB,KAAK,IAAI,GAAG,MAAM,YAAY,yBAAyB,kEAAkE,EAAE,MAAM;GACjL,SAAS;GACT,UAAU,OAAO;EAClB,EAAE,CAAC;EACH,OAAO,sBAAsB,OAAO,IAAI,CAAC;CAC1C;AACD;AACA,IAAI,+BAA+B,cAAc,sBAAsB;CACtE,eAAe,YAAY;EAC1B,OAAO,0BAA0B,UAAU;CAC5C;CACA,WAAW,aAAa;CACxB,UAAU;CACV,SAAS;EACR;EACA;EACA;CACD;CACA,cAAc,CAAC;CACf,eAAe,KAAK;CACpB,mBAAmB,OAAO;EACzB,OAAO,yBAAyB,KAAK;CACtC;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codecs-BzSfaf5F-gXK7Etj3.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as SqliteCodecRegistry } from "./codecs-
|
|
2
|
-
import "./codecs-
|
|
1
|
+
import { a as SqliteCodecRegistry } from "./codecs-BzSfaf5F-gXK7Etj3.mjs";
|
|
2
|
+
import "./codecs-cfQqBb8r.mjs";
|
|
3
3
|
import { r as SqliteDdlNode } from "./nodes-D8EC1yCx-rpfpuJ4T.mjs";
|
|
4
4
|
import "./ddl-CfSqNT0M.mjs";
|
|
5
5
|
import { t as parseSqliteDefault } from "./default-normalizer-B9V7TY5u.mjs";
|
|
6
6
|
import { t as normalizeSqliteNativeType } from "./native-type-normalizer-CO2wKGL6.mjs";
|
|
7
7
|
import { AnyQueryAst, DdlNode, LoweredStatement, LowererContext, MarkerReadResult, SqlExecuteRequest } from "@prisma/orm-family-sql/relational-core/ast";
|
|
8
|
-
import { SqlSchemaIR } from "@prisma/orm-family-sql/schema-ir/types";
|
|
9
8
|
import { SqlControlAdapterDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
9
|
+
import { SqlSchemaIR } from "@prisma/orm-family-sql/schema-ir/types";
|
|
10
10
|
import { SqlControlDriverInstance } from "@prisma/orm-family-sql/contract/types";
|
|
11
11
|
import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
|
|
12
12
|
import { SqlControlAdapter } from "@prisma/orm-family-sql/family/control-adapter";
|
|
@@ -103,4 +103,4 @@ declare class SqliteControlAdapter implements SqlControlAdapter<'sqlite'> {
|
|
|
103
103
|
declare const sqliteAdapterDescriptor: SqlControlAdapterDescriptor<'sqlite'>;
|
|
104
104
|
//#endregion
|
|
105
105
|
export { sqliteAdapterDescriptor as n, SqliteControlAdapter as t };
|
|
106
|
-
//# sourceMappingURL=control-
|
|
106
|
+
//# sourceMappingURL=control-DG-hF-sF.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-
|
|
1
|
+
{"version":3,"file":"control-DG-hF-sF.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;cAYc,gCAAgC;WACnC;WACA;mBACQ;EACjB,YAAY,eAAe;WAClB,yBAAyB;WACzB,4BAA4B;EACrC,yCAAyC;EACzC,uCAAuC;;;;;;;;;EASvC,MAAM,KAAK,cAAc,eAAe,SAAS,0BAA0B;;;;;;;;EAQ3E,sBAAsB,KAAK,cAAc,eAAe,UAAU,0BAA0B,QAAQ;;;;;;EAMpG,WAAW,QAAQ,oCAAoC,gBAAgB,QAAQ;EAC/E,wBAAwB,QAAQ,oCAAoC,gBAAgB,QAAQ;;;;;;EAM5F,eAAe,QAAQ,qCAAqC,QAAQ,oBAAoB;UAChF;;;;;;EAMR,WAAW,QAAQ,oCAAoC,iBAAiB,iBAAiB;UACjF;;;;;;EAMR,aAAa,QAAQ,oCAAoC,eAAe;aAC7D;aACA;aACA;MACP;EACJ,WAAW,QAAQ,oCAAoC,eAAe;aAC3D;aACA;aACA;MACP;;;;;EAKJ,aAAa,QAAQ,oCAAoC,eAAe,sBAAsB;aACnF;aACA;aACA;MACP;;;;;EAKJ,iBAAiB,QAAQ,oCAAoC,eAAe;aACjE;aACA;aACA;aACA;aACA;aACA;MACP;UACI;EACR,WAAW,QAAQ,oCAAoC,sBAAsB,QAAQ;;;;cAIzE,yBAAyB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { numeralText } from "@prisma/orm-family-sql/relational-core/ast";
|
|
1
|
+
import { canonicalDateTime, numeralText } from "@prisma/orm-family-sql/relational-core/ast";
|
|
2
2
|
import { dataType } from "@prisma/orm-framework/components/codec";
|
|
3
3
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/data-types-
|
|
4
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/data-types-B6gWpyYW.mjs
|
|
5
5
|
const unchanged = (value) => value;
|
|
6
6
|
function wrongShape(value, expected) {
|
|
7
7
|
throw structuredError("CONTRACT.CAST_REFUSED", `Expected ${expected}, got ${JSON.stringify(value)}.`, {
|
|
@@ -27,7 +27,24 @@ const asReal = (value) => {
|
|
|
27
27
|
const sqliteText = dataType("sqlite/text", {});
|
|
28
28
|
const sqliteJson = dataType("sqlite/json", {});
|
|
29
29
|
const sqliteInteger = dataType("sqlite/integer", {});
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The canonical form of `sqlite/datetime` (ADR 254), from ISO 8601 text with a UTC offset. The range
|
|
32
|
+
* and the millisecond precision are those of a JavaScript `Date`, the codec's value.
|
|
33
|
+
*/
|
|
34
|
+
const sqliteDatetimeCanonical = (text) => canonicalDateTime(text, {
|
|
35
|
+
shape: "instant",
|
|
36
|
+
dataTypeId: "sqlite/datetime",
|
|
37
|
+
maxFractionDigits: 3,
|
|
38
|
+
range: {
|
|
39
|
+
earliest: "-271821-04-20T00:00:00Z",
|
|
40
|
+
latest: "+275760-09-13T00:00:00Z"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const datetimeCanonicalForm = (value) => typeof value === "string" ? sqliteDatetimeCanonical(value) : wrongShape(value, "text");
|
|
44
|
+
const sqliteDatetime = dataType("sqlite/datetime", {
|
|
45
|
+
toCanonicalForm: datetimeCanonicalForm,
|
|
46
|
+
casts: { [sqliteText.id]: datetimeCanonicalForm }
|
|
47
|
+
});
|
|
31
48
|
const sqliteBlob = dataType("sqlite/blob", { casts: { [sqliteText.id]: unchanged } });
|
|
32
49
|
const sqliteBigint = dataType("sqlite/bigint", { casts: { [sqliteInteger.id]: asNumeralText } });
|
|
33
50
|
const sqliteReal = dataType("sqlite/real", { casts: {
|
|
@@ -45,6 +62,6 @@ const sqliteDataTypes = [
|
|
|
45
62
|
sqliteReal
|
|
46
63
|
];
|
|
47
64
|
//#endregion
|
|
48
|
-
export {
|
|
65
|
+
export { sqliteDatetimeCanonical as a, sqliteReal as c, sqliteDatetime as i, sqliteText as l, sqliteBlob as n, sqliteInteger as o, sqliteDataTypes as r, sqliteJson as s, sqliteBigint as t };
|
|
49
66
|
|
|
50
|
-
//# sourceMappingURL=data-types-
|
|
67
|
+
//# sourceMappingURL=data-types-B6gWpyYW-CVM4AAZK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-B6gWpyYW-CVM4AAZK.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/data-types-B6gWpyYW.mjs"],"sourcesContent":["import { canonicalDateTime, numeralText } from \"@internal/sql-relational-core/ast\";\nimport { dataType } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/data-types.ts\nconst unchanged = (value) => value;\nfunction wrongShape(value, expected) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `Expected ${expected}, got ${JSON.stringify(value)}.`, {\n\t\twhy: \"A cast reads the canonical form of the type it takes values of.\",\n\t\tfix: \"Hand the cast a value in the shape its source type stores.\"\n\t});\n}\nconst asNumeralText = (value) => typeof value === \"number\" ? numeralText(value) : wrongShape(value, \"a number\");\n/**\n* A number as `real` stores it. A magnitude past what a double holds is refused rather than\n* rounded, for the reason the target's other numeric casts give.\n*/\nconst asReal = (value) => {\n\tif (typeof value === \"number\") return value;\n\tif (typeof value !== \"string\") return wrongShape(value, \"a number or digit text\");\n\tconst converted = Number(value);\n\tif (Number.isFinite(converted)) return converted;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `${value} is out of range: no double holds a number that large.`, {\n\t\twhy: \"A real stores a double, which holds magnitudes up to about 1.8e308.\",\n\t\tfix: \"Use a number a double holds.\"\n\t});\n};\nconst sqliteText = dataType(\"sqlite/text\", {});\nconst sqliteJson = dataType(\"sqlite/json\", {});\nconst sqliteInteger = dataType(\"sqlite/integer\", {});\n/**\n* The canonical form of `sqlite/datetime` (ADR 254), from ISO 8601 text with a UTC offset. The range\n* and the millisecond precision are those of a JavaScript `Date`, the codec's value.\n*/\nconst sqliteDatetimeCanonical = (text) => canonicalDateTime(text, {\n\tshape: \"instant\",\n\tdataTypeId: \"sqlite/datetime\",\n\tmaxFractionDigits: 3,\n\trange: {\n\t\tearliest: \"-271821-04-20T00:00:00Z\",\n\t\tlatest: \"+275760-09-13T00:00:00Z\"\n\t}\n});\nconst datetimeCanonicalForm = (value) => typeof value === \"string\" ? sqliteDatetimeCanonical(value) : wrongShape(value, \"text\");\nconst sqliteDatetime = dataType(\"sqlite/datetime\", {\n\ttoCanonicalForm: datetimeCanonicalForm,\n\tcasts: { [sqliteText.id]: datetimeCanonicalForm }\n});\nconst sqliteBlob = dataType(\"sqlite/blob\", { casts: { [sqliteText.id]: unchanged } });\nconst sqliteBigint = dataType(\"sqlite/bigint\", { casts: { [sqliteInteger.id]: asNumeralText } });\nconst sqliteReal = dataType(\"sqlite/real\", { casts: {\n\t[sqliteInteger.id]: asReal,\n\t[sqliteBigint.id]: asReal\n} });\n/** Every data type this target registers. */\nconst sqliteDataTypes = [\n\tsqliteText,\n\tsqliteJson,\n\tsqliteInteger,\n\tsqliteDatetime,\n\tsqliteBlob,\n\tsqliteBigint,\n\tsqliteReal\n];\n//#endregion\nexport { sqliteDatetimeCanonical as a, sqliteReal as c, sqliteDatetime as i, sqliteText as l, sqliteBlob as n, sqliteInteger as o, sqliteDataTypes as r, sqliteJson as s, sqliteBigint as t };\n\n//# sourceMappingURL=data-types-B6gWpyYW.mjs.map"],"mappings":";;;;AAIA,MAAM,aAAa,UAAU;AAC7B,SAAS,WAAW,OAAO,UAAU;CACpC,MAAM,gBAAgB,yBAAyB,YAAY,SAAS,QAAQ,KAAK,UAAU,KAAK,EAAE,IAAI;EACrG,KAAK;EACL,KAAK;CACN,CAAC;AACF;AACA,MAAM,iBAAiB,UAAU,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,WAAW,OAAO,UAAU;;;;;AAK9G,MAAM,UAAU,UAAU;CACzB,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,UAAU,OAAO,WAAW,OAAO,wBAAwB;CAChF,MAAM,YAAY,OAAO,KAAK;CAC9B,IAAI,OAAO,SAAS,SAAS,GAAG,OAAO;CACvC,MAAM,gBAAgB,yBAAyB,GAAG,MAAM,yDAAyD;EAChH,KAAK;EACL,KAAK;CACN,CAAC;AACF;AACA,MAAM,aAAa,SAAS,eAAe,CAAC,CAAC;AAC7C,MAAM,aAAa,SAAS,eAAe,CAAC,CAAC;AAC7C,MAAM,gBAAgB,SAAS,kBAAkB,CAAC,CAAC;;;;;AAKnD,MAAM,2BAA2B,SAAS,kBAAkB,MAAM;CACjE,OAAO;CACP,YAAY;CACZ,mBAAmB;CACnB,OAAO;EACN,UAAU;EACV,QAAQ;CACT;AACD,CAAC;AACD,MAAM,yBAAyB,UAAU,OAAO,UAAU,WAAW,wBAAwB,KAAK,IAAI,WAAW,OAAO,MAAM;AAC9H,MAAM,iBAAiB,SAAS,mBAAmB;CAClD,iBAAiB;CACjB,OAAO,GAAG,WAAW,KAAK,sBAAsB;AACjD,CAAC;AACD,MAAM,aAAa,SAAS,eAAe,EAAE,OAAO,GAAG,WAAW,KAAK,UAAU,EAAE,CAAC;AACpF,MAAM,eAAe,SAAS,iBAAiB,EAAE,OAAO,GAAG,cAAc,KAAK,cAAc,EAAE,CAAC;AAC/F,MAAM,aAAa,SAAS,eAAe,EAAE,OAAO;EAClD,cAAc,KAAK;EACnB,aAAa,KAAK;AACpB,EAAE,CAAC;;AAEH,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;AACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as sqliteReal, l as sqliteText, o as sqliteInteger, s as sqliteJson, t as sqliteBigint } from "./data-types-B6gWpyYW-CVM4AAZK.mjs";
|
|
2
2
|
import { createNumberClassifier, numeralText, parseJsonBody, printJsonBody, signedRange } from "@prisma/orm-family-sql/relational-core/ast";
|
|
3
3
|
//#region ../../../3-targets/3-targets/sqlite/dist/data-types.mjs
|
|
4
4
|
const SAFE_INTEGER = BigInt(Number.MAX_SAFE_INTEGER);
|
|
@@ -65,4 +65,4 @@ function sqliteDataTypeEntries() {
|
|
|
65
65
|
//#endregion
|
|
66
66
|
export { sqliteDataTypeEntries as t };
|
|
67
67
|
|
|
68
|
-
//# sourceMappingURL=data-types-
|
|
68
|
+
//# sourceMappingURL=data-types-BgJU9cGq.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-BgJU9cGq.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/data-types.mjs"],"sourcesContent":["import { a as sqliteDatetimeCanonical, c as sqliteReal, i as sqliteDatetime, l as sqliteText, n as sqliteBlob, o as sqliteInteger, r as sqliteDataTypes, s as sqliteJson, t as sqliteBigint } from \"./data-types-B6gWpyYW.mjs\";\nimport { createNumberClassifier, numeralText, parseJsonBody, printJsonBody, signedRange } from \"@internal/sql-relational-core/ast\";\n//#region src/core/data-type-entries.ts\nconst SAFE_INTEGER = BigInt(Number.MAX_SAFE_INTEGER);\n/**\n* A whole number within the range a double holds exactly is an `integer`, a wider one up to 64 bits\n* is a `bigint`, and a number with a fraction is a `real`. Anything else — a whole number past 64\n* bits, or one of the three words — has no SQLite type, so it is refused.\n*/\nconst classifySqliteNumber = createNumberClassifier({\n\tintegers: [{\n\t\ttype: sqliteInteger.id,\n\t\tform: \"number\",\n\t\tmin: -SAFE_INTEGER,\n\t\tmax: SAFE_INTEGER\n\t}, {\n\t\ttype: sqliteBigint.id,\n\t\tform: \"text\",\n\t\t...signedRange(64)\n\t}],\n\tfraction: {\n\t\ttype: sqliteReal.id,\n\t\tform: \"number\"\n\t}\n});\nfunction printNumber(value) {\n\treturn typeof value === \"number\" ? numeralText(value) : String(value);\n}\nfunction sqliteDataTypeEntries() {\n\treturn {\n\t\t[sqliteText.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"string\",\n\t\t\t\tparse: (text) => text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Text.\"\n\t\t},\n\t\t[sqliteReal.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"number\",\n\t\t\t\ttypes: [\n\t\t\t\t\tsqliteInteger.id,\n\t\t\t\t\tsqliteBigint.id,\n\t\t\t\t\tsqliteReal.id\n\t\t\t\t],\n\t\t\t\tclassify: classifySqliteNumber\n\t\t\t},\n\t\t\tprint: printNumber,\n\t\t\tdocumentation: \"A number, whose type comes from its own size and precision.\"\n\t\t},\n\t\t[sqliteJson.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"json\",\n\t\t\t\tparse: parseJsonBody\n\t\t\t},\n\t\t\tprint: printJsonBody,\n\t\t\tdocumentation: \"Reads the body as a JSON document and stores it as the default value.\"\n\t\t}\n\t};\n}\n//#endregion\nexport { sqliteBigint, sqliteBlob, sqliteDataTypeEntries, sqliteDataTypes, sqliteDatetime, sqliteDatetimeCanonical, sqliteInteger, sqliteJson, sqliteReal, sqliteText };\n\n//# sourceMappingURL=data-types.mjs.map"],"mappings":";;;AAGA,MAAM,eAAe,OAAO,OAAO,gBAAgB;;;;;;AAMnD,MAAM,uBAAuB,uBAAuB;CACnD,UAAU,CAAC;EACV,MAAM,cAAc;EACpB,MAAM;EACN,KAAK,CAAC;EACN,KAAK;CACN,GAAG;EACF,MAAM,aAAa;EACnB,MAAM;EACN,GAAG,YAAY,EAAE;CAClB,CAAC;CACD,UAAU;EACT,MAAM,WAAW;EACjB,MAAM;CACP;AACD,CAAC;AACD,SAAS,YAAY,OAAO;CAC3B,OAAO,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,OAAO,KAAK;AACrE;AACA,SAAS,wBAAwB;CAChC,OAAO;GACL,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,QAAQ,SAAS;GAClB;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,OAAO;KACN,cAAc;KACd,aAAa;KACb,WAAW;IACZ;IACA,UAAU;GACX;GACA,OAAO;GACP,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,OAAO;GACP,eAAe;EAChB;CACD;AACD"}
|
|
@@ -8,6 +8,11 @@ declare function sqliteDataTypeEntries(): Readonly<Record<string, AuthoringDataT
|
|
|
8
8
|
declare const sqliteText: DataType;
|
|
9
9
|
declare const sqliteJson: DataType;
|
|
10
10
|
declare const sqliteInteger: DataType;
|
|
11
|
+
/**
|
|
12
|
+
* The canonical form of `sqlite/datetime` (ADR 254), from ISO 8601 text with a UTC offset. The range
|
|
13
|
+
* and the millisecond precision are those of a JavaScript `Date`, the codec's value.
|
|
14
|
+
*/
|
|
15
|
+
declare const sqliteDatetimeCanonical: (text: string) => string;
|
|
11
16
|
declare const sqliteDatetime: DataType;
|
|
12
17
|
declare const sqliteBlob: DataType;
|
|
13
18
|
declare const sqliteBigint: DataType;
|
|
@@ -15,5 +20,5 @@ declare const sqliteReal: DataType;
|
|
|
15
20
|
/** Every data type this target registers. */
|
|
16
21
|
declare const sqliteDataTypes: readonly DataType[];
|
|
17
22
|
//#endregion
|
|
18
|
-
export { sqliteDatetime as a,
|
|
19
|
-
//# sourceMappingURL=data-types-
|
|
23
|
+
export { sqliteDatetime as a, sqliteJson as c, sqliteDataTypes as i, sqliteReal as l, sqliteBlob as n, sqliteDatetimeCanonical as o, sqliteDataTypeEntries as r, sqliteInteger as s, sqliteBigint as t, sqliteText as u };
|
|
24
|
+
//# sourceMappingURL=data-types-j8tJbltU.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-j8tJbltU.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/data-types.d.mts"],"mappings":";;;;iBAGiB,yBAAyB,SAAS,eAAe;;;cAGpD,YAAY;cACZ,YAAY;cACZ,eAAe;;;;;cAKf,0BAA0B;cAC1B,gBAAgB;cAChB,YAAY;cACZ,cAAc;cACd,YAAY;;cAEZ,0BAA0B"}
|
package/dist/{descriptor-meta-CqCH7n4c-BUIJjrKo.mjs → descriptor-meta-CqCH7n4c-Btl4cIXf.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as sqliteAggregateDescriptors } from "./aggregates-CATLYJxc.mjs";
|
|
2
|
-
import { r as sqliteDataTypes } from "./data-types-
|
|
3
|
-
import {
|
|
2
|
+
import { r as sqliteDataTypes } from "./data-types-B6gWpyYW-CVM4AAZK.mjs";
|
|
3
|
+
import { a as sqliteCodecRegistry } from "./codecs-Bsf9bHq3.mjs";
|
|
4
4
|
//#region ../../../3-targets/6-adapters/sqlite/dist/descriptor-meta-CqCH7n4c.mjs
|
|
5
5
|
const sqliteAdapterDescriptorMeta = {
|
|
6
6
|
kind: "adapter",
|
|
@@ -35,4 +35,4 @@ const sqliteAdapterDescriptorMeta = {
|
|
|
35
35
|
//#endregion
|
|
36
36
|
export { sqliteAdapterDescriptorMeta as t };
|
|
37
37
|
|
|
38
|
-
//# sourceMappingURL=descriptor-meta-CqCH7n4c-
|
|
38
|
+
//# sourceMappingURL=descriptor-meta-CqCH7n4c-Btl4cIXf.mjs.map
|
package/dist/{descriptor-meta-CqCH7n4c-BUIJjrKo.mjs.map → descriptor-meta-CqCH7n4c-Btl4cIXf.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-CqCH7n4c-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-CqCH7n4c-Btl4cIXf.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/descriptor-meta-CqCH7n4c.mjs"],"sourcesContent":["import { sqliteCodecRegistry } from \"@internal/target-sqlite/codecs\";\nimport { sqliteDataTypes } from \"@internal/target-sqlite/data-types\";\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\tinsertOnConflictSkip: true,\n\t\tinsertOnConflictWithoutTarget: true\n\t} },\n\tdataTypes: sqliteDataTypes,\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-CqCH7n4c.mjs.map"],"mappings":";;;;AAGA,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;EACP,sBAAsB;EACtB,+BAA+B;CAChC,EAAE;CACF,WAAW;CACX,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"}
|
|
@@ -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-C8CNBvCb-DyXVtd7o.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-BNB89lIv.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-BNB89lIv.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/migration.mjs"],"sourcesContent":["import { f as step } from \"./op-factory-call-C8CNBvCb.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CIQ789Gc.mjs\";\nimport { t as SqliteMigration } from \"./sqlite-migration-BKSuDis9.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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Op } from "./shared-
|
|
2
|
-
import "./sqlite-migration-
|
|
1
|
+
import { t as Op } from "./shared-AQqQ1hrb-3EPsz46S.mjs";
|
|
2
|
+
import "./sqlite-migration-0qCGfq-S-wwKN7Zb3.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";
|
|
@@ -40,4 +40,4 @@ declare function dataTransform(opts: DataTransformOptions): Op;
|
|
|
40
40
|
declare function rawSql(op: Op): Op;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { fn$1 as a, placeholder as c, unique as d, dataTransform as i, primaryKey as l, MigrationCLI as n, foreignKey as o, col$1 as r, lit$1 as s, DataTransformOptions as t, rawSql as u };
|
|
43
|
-
//# sourceMappingURL=migration-
|
|
43
|
+
//# sourceMappingURL=migration-DSmUh0wk.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-DSmUh0wk.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/migration.d.mts"],"mappings":";;;;;;;UAMU;;WAEC;;WAEA;;WAEA;;;;;WAKA;;;;;;;;;WASA;;iBAEM,cAAc,MAAM,uBAAuB;;;;;;;;;;iBAU3C,OAAO,IAAI,KAAK"}
|
package/dist/{op-factory-call-CIivnKC6-BkzTmbmn.mjs → op-factory-call-C8CNBvCb-DyXVtd7o.mjs}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as sqliteError } from "./errors-DnR-sMHS-KkMLIP2U.mjs";
|
|
2
|
+
import { n as decodeSqliteDatetime, r as encodeSqliteDatetime } from "./codecs-CK___nqu-ByljcwNa.mjs";
|
|
2
3
|
import { i as tableExistsAst, n as createTable, r as indexExistsAst, t as columnExistsAst } from "./ddl-CXduXyOT-nlDP6DGx.mjs";
|
|
3
4
|
import { r as stripOuterParens } from "./default-normalizer-D_kHnqz7-SRi-lBH0.mjs";
|
|
4
5
|
import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-C2O4zVkP-Dz3Hb85I.mjs";
|
|
@@ -6,12 +7,12 @@ import { t as buildTargetDetails } from "./planner-target-details-CIQ789Gc-C5U4y
|
|
|
6
7
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
7
8
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
8
9
|
import { issueOutcome } from "@prisma/orm-framework/components/control";
|
|
9
|
-
import { RelationalSchemaNodeKind } from "@prisma/orm-family-sql/schema-ir/types";
|
|
10
10
|
import { checkSqlDefaultBody } from "@prisma/orm-family-sql/family/control";
|
|
11
|
+
import { RelationalSchemaNodeKind } from "@prisma/orm-family-sql/schema-ir/types";
|
|
11
12
|
import { errorUnfilledPlaceholder } from "@prisma/orm-framework/errors/migration";
|
|
12
13
|
import { TsExpression, jsonToTsSource } from "@prisma/orm-framework/ts-render";
|
|
13
14
|
import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
|
|
14
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/op-factory-call-
|
|
15
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/op-factory-call-C8CNBvCb.mjs
|
|
15
16
|
/**
|
|
16
17
|
* Low-level DDL fragment builders for SQLite migrations.
|
|
17
18
|
*
|
|
@@ -44,10 +45,10 @@ function buildColumnTypeSql(column, storageTypes = {}) {
|
|
|
44
45
|
* SQLite encodes that as `INTEGER PRIMARY KEY AUTOINCREMENT` inline on the
|
|
45
46
|
* column definition, not as a separate DEFAULT.
|
|
46
47
|
*/
|
|
47
|
-
function buildColumnDefaultSql(columnDefault) {
|
|
48
|
+
function buildColumnDefaultSql(columnDefault, codecId) {
|
|
48
49
|
if (!columnDefault) return "";
|
|
49
50
|
switch (columnDefault.kind) {
|
|
50
|
-
case "literal": return `DEFAULT ${renderDefaultLiteral(columnDefault.value)}`;
|
|
51
|
+
case "literal": return `DEFAULT ${renderDefaultLiteral(columnDefault.value, codecId)}`;
|
|
51
52
|
case "function":
|
|
52
53
|
if (columnDefault.expression === "autoincrement()") return "";
|
|
53
54
|
if (columnDefault.expression === "now()") return "DEFAULT (datetime('now'))";
|
|
@@ -55,8 +56,13 @@ function buildColumnDefaultSql(columnDefault) {
|
|
|
55
56
|
return `DEFAULT (${columnDefault.expression})`;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
/**
|
|
60
|
+
* A datetime default is the stored value itself in SQLite, which compares text byte by byte, so it
|
|
61
|
+
* is written as the text the column's codec writes for every row, not as its canonical form.
|
|
62
|
+
*/
|
|
63
|
+
function renderDefaultLiteral(value, codecId) {
|
|
64
|
+
if (value instanceof Date) return `'${escapeLiteral(encodeSqliteDatetime(value))}'`;
|
|
65
|
+
if (typeof value === "string" && codecId === "sqlite/datetime@1") return `'${escapeLiteral(encodeSqliteDatetime(decodeSqliteDatetime(value)))}'`;
|
|
60
66
|
if (typeof value === "string") return `'${escapeLiteral(value)}'`;
|
|
61
67
|
if (typeof value === "number" || typeof value === "bigint") return String(value);
|
|
62
68
|
if (typeof value === "boolean") return value ? "1" : "0";
|
|
@@ -836,4 +842,4 @@ var RawSqlCall = class extends SqliteOpFactoryCallNode {
|
|
|
836
842
|
//#endregion
|
|
837
843
|
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 };
|
|
838
844
|
|
|
839
|
-
//# sourceMappingURL=op-factory-call-
|
|
845
|
+
//# sourceMappingURL=op-factory-call-C8CNBvCb-DyXVtd7o.mjs.map
|