@prisma/orm-target-sqlite 8.0.0-rc.14-dev.5 → 8.0.0-rc.14-dev.7
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-BNyoBP5X.d.mts +2 -0
- package/dist/{adapter-Bp_4Bjff-e0IpIZ1b.d.mts → adapter-Bp_4Bjff-O8HHkgK9.d.mts} +6 -6
- package/dist/{adapter-Bp_4Bjff-e0IpIZ1b.d.mts.map → adapter-Bp_4Bjff-O8HHkgK9.d.mts.map} +1 -1
- package/dist/{adapter-DBvizrEP-SHMMlDkU.mjs → adapter-DOg9HerQ-BP_BKOlH.mjs} +41 -22
- package/dist/adapter-DOg9HerQ-BP_BKOlH.mjs.map +1 -0
- package/dist/adapter.d.mts +10 -10
- package/dist/adapter.mjs +3 -3
- package/dist/adapter__adapter.d.mts +3 -3
- 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 +5 -5
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +2 -2
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +3 -3
- package/dist/codec-descriptor-3-wupJWh.d.mts +2 -0
- package/dist/codec-descriptor-C6M9ScCy-BqG7e8Oz.d.mts +1 -0
- package/dist/{codec-descriptor-BNC9tDro-BPWBITSr.d.mts → codec-descriptor-CDLhtrcE-CloMgVh6.d.mts} +13 -7
- package/dist/codec-descriptor-CDLhtrcE-CloMgVh6.d.mts.map +1 -0
- package/dist/{codec-descriptor-DAmZuKvV-B2UsMrgX.mjs → codec-descriptor-CWJAw6Ck-BksOSxiO.mjs} +3 -3
- package/dist/codec-descriptor-CWJAw6Ck-BksOSxiO.mjs.map +1 -0
- package/dist/codec-types-BBWeZKHk.d.mts +1 -0
- package/dist/codec-types-CXtfACRK.d.mts +2 -0
- package/dist/{codec-types-Dm8kn3W4-BAWXUJJ8.d.mts → codec-types-DU8BIZeM-DPqt7bmT.d.mts} +5 -5
- package/dist/{codec-types-Dm8kn3W4-BAWXUJJ8.d.mts.map → codec-types-DU8BIZeM-DPqt7bmT.d.mts.map} +1 -1
- package/dist/{codecs-BzSfaf5F-gXK7Etj3.d.mts → codecs-BURC1flo-UiOzcif2.d.mts} +3 -3
- package/dist/{codecs-BzSfaf5F-gXK7Etj3.d.mts.map → codecs-BURC1flo-UiOzcif2.d.mts.map} +1 -1
- package/dist/{codecs-Bsf9bHq3.mjs → codecs-BXELYOY1.mjs} +3 -3
- package/dist/{codecs-Bsf9bHq3.mjs.map → codecs-BXELYOY1.mjs.map} +1 -1
- package/dist/codecs-CKWQYtFS.d.mts +1 -0
- package/dist/{codecs-CK___nqu-ByljcwNa.mjs → codecs-yYxIwGIT-BHW7sSHn.mjs} +60 -56
- package/dist/codecs-yYxIwGIT-BHW7sSHn.mjs.map +1 -0
- package/dist/{control-B16T9OoX.mjs → control-1rQ6mko7.mjs} +3 -3
- package/dist/control-1rQ6mko7.mjs.map +1 -0
- package/dist/{control-DG-hF-sF.d.mts → control-CfS8mDnj.d.mts} +6 -5
- package/dist/control-CfS8mDnj.d.mts.map +1 -0
- package/dist/{control--wMueaTg.d.mts → control-DAys3o_s.d.mts} +2 -2
- package/dist/{control--wMueaTg.d.mts.map → control-DAys3o_s.d.mts.map} +1 -1
- package/dist/{data-types-B6gWpyYW-CVM4AAZK.mjs → data-types-B6gYWauJ-DPJUc7_Z.mjs} +7 -4
- package/dist/data-types-B6gYWauJ-DPJUc7_Z.mjs.map +1 -0
- package/dist/{data-types-BxmHClMK.mjs → data-types-D9CwP8vB.mjs} +4 -5
- package/dist/data-types-D9CwP8vB.mjs.map +1 -0
- package/dist/{default-normalizer-D_kHnqz7-SRi-lBH0.mjs → default-normalizer-Bbo6WzxJ-MgaICRCQ.mjs} +7 -4
- package/dist/default-normalizer-Bbo6WzxJ-MgaICRCQ.mjs.map +1 -0
- package/dist/{descriptor-meta-CqCH7n4c-Btl4cIXf.mjs → descriptor-meta-CqCH7n4c-Bx_S6IIu.mjs} +3 -3
- package/dist/{descriptor-meta-CqCH7n4c-Btl4cIXf.mjs.map → descriptor-meta-CqCH7n4c-Bx_S6IIu.mjs.map} +1 -1
- package/dist/{descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs → descriptor-meta-cwy5CXTT-DSRaq_b-.mjs} +17 -3
- package/dist/descriptor-meta-cwy5CXTT-DSRaq_b-.mjs.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.mjs +4 -7
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/{migration-BNB89lIv.mjs → migration-Y6M_R3GK.mjs} +2 -2
- package/dist/{migration-BNB89lIv.mjs.map → migration-Y6M_R3GK.mjs.map} +1 -1
- package/dist/{migration-DSmUh0wk.d.mts → migration-dc58fySD.d.mts} +3 -3
- package/dist/{migration-DSmUh0wk.d.mts.map → migration-dc58fySD.d.mts.map} +1 -1
- package/dist/{op-factory-call-C8jSguMU.d.mts → op-factory-call-4FJxPMyx.d.mts} +5 -11
- package/dist/op-factory-call-4FJxPMyx.d.mts.map +1 -0
- package/dist/{op-factory-call-C8CNBvCb-DyXVtd7o.mjs → op-factory-call-Dv_ma_mw-BtLqNmZI.mjs} +99 -65
- package/dist/op-factory-call-Dv_ma_mw-BtLqNmZI.mjs.map +1 -0
- package/dist/{pack-B488MxTx.d.mts → pack-YBiEVfBB.d.mts} +2 -2
- package/dist/{pack-B488MxTx.d.mts.map → pack-YBiEVfBB.d.mts.map} +1 -1
- package/dist/{planner-B4FWi-jn.d.mts → planner-Bsjn1MTX.d.mts} +2 -2
- package/dist/{planner-B4FWi-jn.d.mts.map → planner-Bsjn1MTX.d.mts.map} +1 -1
- package/dist/{planner-BTKa_OaV-Bl9T8ftA.mjs → planner-CWfPzOwZ-DVj6Tm5a.mjs} +14 -25
- package/dist/planner-CWfPzOwZ-DVj6Tm5a.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-C0pHN3qf-D1QDsx7l.d.mts → planner-produced-sqlite-migration-BQ8vBitH-DlquRDZ4.d.mts} +4 -4
- package/dist/planner-produced-sqlite-migration-BQ8vBitH-DlquRDZ4.d.mts.map +1 -0
- package/dist/planner-produced-sqlite-migration-BfFAqrKj.d.mts +1 -0
- package/dist/{planner-produced-sqlite-migration-CAvJnzes-wf8WQ39U.mjs → planner-produced-sqlite-migration-D1iuFT1l-BSFCXgJD.mjs} +3 -3
- package/dist/{planner-produced-sqlite-migration-CAvJnzes-wf8WQ39U.mjs.map → planner-produced-sqlite-migration-D1iuFT1l-BSFCXgJD.mjs.map} +1 -1
- package/dist/{runtime-7ugF7qno.d.mts → runtime-KPhmnsVg.d.mts} +2 -2
- package/dist/{runtime-7ugF7qno.d.mts.map → runtime-KPhmnsVg.d.mts.map} +1 -1
- package/dist/sql-renderer-2I1xGT7D.d.mts +1 -0
- package/dist/{sqlite-migration-0qCGfq-S-wwKN7Zb3.d.mts → sqlite-migration-Du67NG7r-CqcA5XBz.d.mts} +5 -8
- package/dist/{sqlite-migration-0qCGfq-S-wwKN7Zb3.d.mts.map → sqlite-migration-Du67NG7r-CqcA5XBz.d.mts.map} +1 -1
- package/dist/{sqlite-migration-BKSuDis9-UHqFOBqU.mjs → sqlite-migration-DuQG9WLW-BqHx4fMJ.mjs} +3 -3
- package/dist/{sqlite-migration-BKSuDis9-UHqFOBqU.mjs.map → sqlite-migration-DuQG9WLW-BqHx4fMJ.mjs.map} +1 -1
- package/dist/{shared-AQqQ1hrb-3EPsz46S.d.mts → tables-CvLOKCiJ-Ca1eFkWN.d.mts} +27 -8
- package/dist/tables-CvLOKCiJ-Ca1eFkWN.d.mts.map +1 -0
- package/dist/target.d.mts +14 -14
- package/dist/target.mjs +11 -11
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +3 -3
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__default-normalizer.mjs +1 -1
- 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-BXuhSSiR.d.mts +2 -0
- package/dist/{types-RJMd2PlL-DFJRCUUw.d.mts → types-RJMd2PlL-Dqp0xeHo.d.mts} +3 -3
- package/dist/{types-RJMd2PlL-DFJRCUUw.d.mts.map → types-RJMd2PlL-Dqp0xeHo.d.mts.map} +1 -1
- package/package.json +9 -9
- package/dist/adapter-DBvizrEP-SHMMlDkU.mjs.map +0 -1
- package/dist/adapter-_aaOdX79.d.mts +0 -2
- package/dist/codec-descriptor-4BIWMlhf-CjIjnr76.d.mts +0 -1
- package/dist/codec-descriptor-BNC9tDro-BPWBITSr.d.mts.map +0 -1
- package/dist/codec-descriptor-DAmZuKvV-B2UsMrgX.mjs.map +0 -1
- package/dist/codec-descriptor-ae4jEMJI.d.mts +0 -2
- package/dist/codec-types-2BtIaiN_.d.mts +0 -2
- package/dist/codec-types-Bo18WDYR.d.mts +0 -1
- package/dist/codecs-CK___nqu-ByljcwNa.mjs.map +0 -1
- package/dist/codecs-cfQqBb8r.d.mts +0 -1
- package/dist/control-B16T9OoX.mjs.map +0 -1
- package/dist/control-DG-hF-sF.d.mts.map +0 -1
- package/dist/data-types-B6gWpyYW-CVM4AAZK.mjs.map +0 -1
- package/dist/data-types-BxmHClMK.mjs.map +0 -1
- package/dist/default-normalizer-D_kHnqz7-SRi-lBH0.mjs.map +0 -1
- package/dist/descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs.map +0 -1
- package/dist/op-factory-call-C8CNBvCb-DyXVtd7o.mjs.map +0 -1
- package/dist/op-factory-call-C8jSguMU.d.mts.map +0 -1
- package/dist/planner-BTKa_OaV-Bl9T8ftA.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-C0pHN3qf-D1QDsx7l.d.mts.map +0 -1
- package/dist/planner-produced-sqlite-migration-aw2sx-H-.d.mts +0 -1
- package/dist/shared-AQqQ1hrb-3EPsz46S.d.mts.map +0 -1
- package/dist/sql-renderer-CSKXHcaY.d.mts +0 -1
- package/dist/types-DIgSNaLb.d.mts +0 -2
package/dist/{codec-descriptor-BNC9tDro-BPWBITSr.d.mts → codec-descriptor-CDLhtrcE-CloMgVh6.d.mts}
RENAMED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import { ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
2
|
-
import { AnyCodecDescriptor, AnyCodecDescriptorTemplate, CodecDescriptor, CodecDescriptorImpl, CodecDescriptorTemplate, CodecRef, DataTypeId } from "@prisma/orm-framework/components/codec";
|
|
3
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codec-descriptor-
|
|
2
|
+
import { AnyCodecDescriptor, AnyCodecDescriptorTemplate, Codec, CodecDescriptor, CodecDescriptorImpl, CodecDescriptorTemplate, CodecInstanceContext, CodecRef as CodecRef$1, CodecTrait, DataTypeId } from "@prisma/orm-framework/components/codec";
|
|
3
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codec-descriptor-CDLhtrcE.d.mts
|
|
4
4
|
//#region src/core/codec-descriptor.d.ts
|
|
5
5
|
declare const SQLITE_CODEC_DESCRIPTOR_KIND: "sqlite-codec";
|
|
6
6
|
interface AnySqliteCodecDescriptor extends AnyCodecDescriptor {
|
|
7
7
|
readonly descriptorKind: typeof SQLITE_CODEC_DESCRIPTOR_KIND;
|
|
8
|
-
projectJson(expression: ProjectionExpr, ref: CodecRef): ProjectionExpr;
|
|
8
|
+
projectJson(expression: ProjectionExpr, ref: CodecRef$1): ProjectionExpr;
|
|
9
9
|
}
|
|
10
10
|
declare abstract class SqliteCodecDescriptor<P = void> extends CodecDescriptorImpl<P> implements AnySqliteCodecDescriptor {
|
|
11
11
|
readonly descriptorKind: "sqlite-codec";
|
|
12
12
|
protected abstract jsonProjection(expression: ProjectionExpr, params: P): ProjectionExpr;
|
|
13
|
-
projectJson(expression: ProjectionExpr, ref: CodecRef): ProjectionExpr;
|
|
13
|
+
projectJson(expression: ProjectionExpr, ref: CodecRef$1): ProjectionExpr;
|
|
14
14
|
private validateParams;
|
|
15
15
|
}
|
|
16
16
|
type DescriptorParams<D extends AnyCodecDescriptorTemplate> = D extends CodecDescriptorTemplate<infer P> ? P : never;
|
|
17
|
-
|
|
17
|
+
/** The codec the family descriptor's factory builds, which a `factory` option's codec extends. */
|
|
18
|
+
type DescriptorCodec<D extends AnyCodecDescriptorTemplate> = ReturnType<ReturnType<D['factory']>>;
|
|
19
|
+
interface SqliteCodecOptions<P, C extends Codec<string, readonly CodecTrait[], unknown, unknown> = Codec<string, readonly CodecTrait[], unknown, unknown>> {
|
|
18
20
|
/** The data type the adapted codec represents here. A template names none; this target does. */
|
|
19
21
|
readonly dataType: DataTypeId;
|
|
20
22
|
readonly jsonProjection: (expression: ProjectionExpr, params: P) => ProjectionExpr;
|
|
23
|
+
/**
|
|
24
|
+
* Builds the codec in place of the adapted one, where SQLite stores fewer values than the family codec reads: a subclass of the family codec that adds SQLite's own rule.
|
|
25
|
+
*/
|
|
26
|
+
readonly factory?: (descriptor: SqliteCodecDescriptor<P>, params: P) => (ctx: CodecInstanceContext) => C;
|
|
21
27
|
}
|
|
22
28
|
type AdaptedSqliteCodecDescriptor<D extends AnyCodecDescriptorTemplate> = Pick<D, keyof CodecDescriptorTemplate<DescriptorParams<D>>> & Pick<CodecDescriptor, 'dataType'> & Pick<AnySqliteCodecDescriptor, 'descriptorKind' | 'projectJson'>;
|
|
23
|
-
declare function sqliteCodec<D extends AnyCodecDescriptorTemplate>(descriptor: D, options: SqliteCodecOptions<DescriptorParams<D>>): AdaptedSqliteCodecDescriptor<D>;
|
|
29
|
+
declare function sqliteCodec<D extends AnyCodecDescriptorTemplate>(descriptor: D, options: SqliteCodecOptions<DescriptorParams<D>, DescriptorCodec<D>>): AdaptedSqliteCodecDescriptor<D>;
|
|
24
30
|
declare function defineSqliteCodecs<const Descriptors extends readonly AnySqliteCodecDescriptor[]>(descriptors: Descriptors): Descriptors;
|
|
25
31
|
declare function isSqliteCodecDescriptor(value: unknown): value is AnySqliteCodecDescriptor;
|
|
26
32
|
interface SqliteCodecDescriptorRegistry {
|
|
@@ -30,4 +36,4 @@ interface SqliteCodecDescriptorRegistry {
|
|
|
30
36
|
declare function buildSqliteCodecDescriptorRegistry(descriptors: ReadonlyArray<unknown>): SqliteCodecDescriptorRegistry;
|
|
31
37
|
//#endregion
|
|
32
38
|
export { SqliteCodecOptions as a, isSqliteCodecDescriptor as c, SqliteCodecDescriptorRegistry as i, sqliteCodec as l, AnySqliteCodecDescriptor as n, buildSqliteCodecDescriptorRegistry as o, SqliteCodecDescriptor as r, defineSqliteCodecs as s, AdaptedSqliteCodecDescriptor as t };
|
|
33
|
-
//# sourceMappingURL=codec-descriptor-
|
|
39
|
+
//# sourceMappingURL=codec-descriptor-CDLhtrcE-CloMgVh6.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-descriptor-CDLhtrcE-CloMgVh6.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codec-descriptor-CDLhtrcE.d.mts"],"mappings":";;;;cAGc;UACJ,iCAAiC;WAChC,uBAAuB;EAChC,YAAY,YAAY,gBAAgB,KAAK,aAAa;;uBAErC,sBAAsB,kBAAkB,oBAAoB,cAAc;WACtF;qBACU,eAAe,YAAY,gBAAgB,QAAQ,IAAI;EAC1E,YAAY,YAAY,gBAAgB,KAAK,aAAa;UAClD;;KAEL,iBAAiB,UAAU,8BAA8B,UAAU,8BAA8B,KAAK;;KAEtG,gBAAgB,UAAU,8BAA8B,WAAW,WAAW;UACzE,mBAAmB,GAAG,UAAU,uBAAuB,kCAAkC,uBAAuB;;WAE/G,UAAU;WACV,iBAAiB,YAAY,gBAAgB,QAAQ,MAAM;;;;WAI3D,WAAW,YAAY,sBAAsB,IAAI,QAAQ,OAAO,KAAK,yBAAyB;;KAEpG,6BAA6B,UAAU,8BAA8B,KAAK,SAAS,wBAAwB,iBAAiB,OAAO,KAAK,+BAA+B,KAAK;iBAChK,YAAY,UAAU,4BAA4B,YAAY,GAAG,SAAS,mBAAmB,iBAAiB,IAAI,gBAAgB,MAAM,6BAA6B;iBACrK,yBAAyB,6BAA6B,4BAA4B,aAAa,cAAc;iBAC7G,wBAAwB,iBAAiB,SAAS;UACzD;EACR,cAAc,kBAAkB;EAChC,UAAU,iBAAiB;;iBAEZ,mCAAmC,aAAa,yBAAyB"}
|
package/dist/{codec-descriptor-DAmZuKvV-B2UsMrgX.mjs → codec-descriptor-CWJAw6Ck-BksOSxiO.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CodecDescriptorImpl, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codec-descriptor-
|
|
4
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codec-descriptor-CWJAw6Ck.mjs
|
|
5
5
|
const SQLITE_CODEC_DESCRIPTOR_KIND = "sqlite-codec";
|
|
6
6
|
var SqliteCodecDescriptor = class extends CodecDescriptorImpl {
|
|
7
7
|
descriptorKind = SQLITE_CODEC_DESCRIPTOR_KIND;
|
|
@@ -47,7 +47,7 @@ var SqliteCodecDescriptorAdapter = class extends SqliteCodecDescriptor {
|
|
|
47
47
|
get isParameterized() {
|
|
48
48
|
return this.descriptor.isParameterized;
|
|
49
49
|
}
|
|
50
|
-
factory = (params) => this.descriptor.factory(params);
|
|
50
|
+
factory = (params) => this.options.factory === void 0 ? this.descriptor.factory(params) : this.options.factory(this, params);
|
|
51
51
|
jsonProjection(expression, params) {
|
|
52
52
|
return this.options.jsonProjection(expression, params);
|
|
53
53
|
}
|
|
@@ -106,4 +106,4 @@ function candidateCodecId(value) {
|
|
|
106
106
|
//#endregion
|
|
107
107
|
export { sqliteCodec as a, isSqliteCodecDescriptor as i, buildSqliteCodecDescriptorRegistry as n, defineSqliteCodecs as r, SqliteCodecDescriptor as t };
|
|
108
108
|
|
|
109
|
-
//# sourceMappingURL=codec-descriptor-
|
|
109
|
+
//# sourceMappingURL=codec-descriptor-CWJAw6Ck-BksOSxiO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-descriptor-CWJAw6Ck-BksOSxiO.mjs","names":["#descriptors"],"sources":["../../../../3-targets/3-targets/sqlite/dist/codec-descriptor-CWJAw6Ck.mjs"],"sourcesContent":["import { CodecDescriptorImpl, validateCodecTypeParams } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/core/codec-descriptor.ts\nconst SQLITE_CODEC_DESCRIPTOR_KIND = \"sqlite-codec\";\nvar SqliteCodecDescriptor = class extends CodecDescriptorImpl {\n\tdescriptorKind = SQLITE_CODEC_DESCRIPTOR_KIND;\n\tprojectJson(expression, ref) {\n\t\tif (ref.many === true) throw structuredError(\"RUNTIME.CODEC_DESCRIPTOR_ARRAY_UNSUPPORTED\", `Codec '${ref.codecId}' uses CodecRef.many, but SQLite codec descriptors do not support stored scalar arrays.`, {\n\t\t\twhy: \"SQLite has no stored scalar-array codec protocol, so applying a scalar projection to the whole stored array would be ambiguous.\",\n\t\t\tfix: \"Use a scalar CodecRef or introduce an explicit target representation before projecting stored arrays.\",\n\t\t\tmeta: { codecId: ref.codecId }\n\t\t});\n\t\treturn this.jsonProjection(expression, this.validateParams(ref));\n\t}\n\tvalidateParams(ref) {\n\t\treturn blindCast(validateCodecTypeParams(this, ref));\n\t}\n};\nvar SqliteCodecDescriptorAdapter = class extends SqliteCodecDescriptor {\n\tdescriptor;\n\toptions;\n\tdataType;\n\tcodecId;\n\ttraits;\n\ttargetTypes;\n\tparamsSchema;\n\trenderOutputType;\n\trenderInputType;\n\trenderValueLiteral;\n\tconstructor(descriptor, options) {\n\t\tsuper();\n\t\tthis.descriptor = descriptor;\n\t\tthis.options = options;\n\t\tthis.dataType = options.dataType;\n\t\tthis.codecId = descriptor.codecId;\n\t\tthis.traits = descriptor.traits;\n\t\tthis.targetTypes = descriptor.targetTypes;\n\t\tthis.paramsSchema = descriptor.paramsSchema;\n\t\tconst renderOutputType = descriptor.renderOutputType;\n\t\tif (renderOutputType !== void 0) this.renderOutputType = (params) => renderOutputType.call(descriptor, params);\n\t\tconst renderInputType = descriptor.renderInputType;\n\t\tif (renderInputType !== void 0) this.renderInputType = (params) => renderInputType.call(descriptor, params);\n\t\tconst renderValueLiteral = descriptor.renderValueLiteral;\n\t\tif (renderValueLiteral !== void 0) this.renderValueLiteral = (value, side) => renderValueLiteral.call(descriptor, value, side);\n\t}\n\tget isParameterized() {\n\t\treturn this.descriptor.isParameterized;\n\t}\n\tfactory = (params) => this.options.factory === void 0 ? this.descriptor.factory(params) : this.options.factory(this, params);\n\tjsonProjection(expression, params) {\n\t\treturn this.options.jsonProjection(expression, params);\n\t}\n};\nfunction sqliteCodec(descriptor, options) {\n\treturn blindCast(new SqliteCodecDescriptorAdapter(descriptor, options));\n}\nfunction defineSqliteCodecs(descriptors) {\n\treturn descriptors;\n}\nfunction isSqliteCodecDescriptor(value) {\n\treturn typeof value === \"object\" && value !== null && \"descriptorKind\" in value && value.descriptorKind === SQLITE_CODEC_DESCRIPTOR_KIND && \"codecId\" in value && typeof value.codecId === \"string\" && \"traits\" in value && Array.isArray(value.traits) && \"targetTypes\" in value && Array.isArray(value.targetTypes) && value.targetTypes.every((targetType) => typeof targetType === \"string\") && \"paramsSchema\" in value && (value.paramsSchema === void 0 || isObjectLike(value.paramsSchema) && \"~standard\" in value.paramsSchema && isObjectLike(value.paramsSchema[\"~standard\"]) && \"validate\" in value.paramsSchema[\"~standard\"] && typeof value.paramsSchema[\"~standard\"].validate === \"function\") && \"isParameterized\" in value && typeof value.isParameterized === \"boolean\" && \"factory\" in value && typeof value.factory === \"function\" && \"projectJson\" in value && typeof value.projectJson === \"function\";\n}\nfunction isObjectLike(value) {\n\treturn typeof value === \"object\" && value !== null || typeof value === \"function\";\n}\nvar SqliteCodecDescriptorRegistryImpl = class {\n\t#descriptors;\n\tconstructor(descriptors) {\n\t\tthis.#descriptors = descriptors;\n\t\tObject.freeze(this);\n\t}\n\tdescriptorFor(codecId) {\n\t\treturn this.#descriptors.get(codecId);\n\t}\n\t*values() {\n\t\tyield* this.#descriptors.values();\n\t}\n};\nfunction buildSqliteCodecDescriptorRegistry(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (!isSqliteCodecDescriptor(descriptor)) {\n\t\t\tconst codecId = candidateCodecId(descriptor);\n\t\t\tthrow structuredError(\"RUNTIME.CODEC_DESCRIPTOR_INVALID\", `Codec descriptor '${codecId}' is not a valid SQLite codec descriptor.`, {\n\t\t\t\twhy: \"SQLite codec registries require the sqlite-codec discriminant and complete target descriptor methods.\",\n\t\t\t\tfix: \"Extend SqliteCodecDescriptor or adapt a generic descriptor with sqliteCodec().\",\n\t\t\t\tmeta: { codecId }\n\t\t\t});\n\t\t}\n\t\tif (byId.has(descriptor.codecId)) throw structuredError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate SQLite codec descriptor id '${descriptor.codecId}'.`, {\n\t\t\twhy: \"Each codecId must resolve to exactly one SQLite descriptor during registry composition.\",\n\t\t\tfix: \"Remove the duplicate target, adapter, or extension contribution.\",\n\t\t\tmeta: {\n\t\t\t\tcodecId: descriptor.codecId,\n\t\t\t\ttarget: \"sqlite\"\n\t\t\t}\n\t\t});\n\t\tbyId.set(descriptor.codecId, descriptor);\n\t}\n\treturn new SqliteCodecDescriptorRegistryImpl(byId);\n}\nfunction candidateCodecId(value) {\n\treturn typeof value === \"object\" && value !== null && \"codecId\" in value && typeof value.codecId === \"string\" ? value.codecId : \"<unknown>\";\n}\n//#endregion\nexport { sqliteCodec as a, isSqliteCodecDescriptor as i, buildSqliteCodecDescriptorRegistry as n, defineSqliteCodecs as r, SqliteCodecDescriptor as t };\n\n//# sourceMappingURL=codec-descriptor-CWJAw6Ck.mjs.map"],"mappings":";;;;AAIA,MAAM,+BAA+B;AACrC,IAAI,wBAAwB,cAAc,oBAAoB;CAC7D,iBAAiB;CACjB,YAAY,YAAY,KAAK;EAC5B,IAAI,IAAI,SAAS,MAAM,MAAM,gBAAgB,8CAA8C,UAAU,IAAI,QAAQ,0FAA0F;GAC1M,KAAK;GACL,KAAK;GACL,MAAM,EAAE,SAAS,IAAI,QAAQ;EAC9B,CAAC;EACD,OAAO,KAAK,eAAe,YAAY,KAAK,eAAe,GAAG,CAAC;CAChE;CACA,eAAe,KAAK;EACnB,OAAO,UAAU,wBAAwB,MAAM,GAAG,CAAC;CACpD;AACD;AACA,IAAI,+BAA+B,cAAc,sBAAsB;CACtE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,YAAY,SAAS;EAChC,MAAM;EACN,KAAK,aAAa;EAClB,KAAK,UAAU;EACf,KAAK,WAAW,QAAQ;EACxB,KAAK,UAAU,WAAW;EAC1B,KAAK,SAAS,WAAW;EACzB,KAAK,cAAc,WAAW;EAC9B,KAAK,eAAe,WAAW;EAC/B,MAAM,mBAAmB,WAAW;EACpC,IA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AO,MAAM,gBAAgB;AACh3B;AACA,SAAS,aAAa,OAAO;CAC5B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,OAAO,UAAU;AACxE;AACA,IAAI,oCAAoC,MAAM;CAC7C;CACA,YAAY,aAAa;EACxB,KAAKA,eAAe;EACpB,OAAO,OAAO,IAAI;CACnB;CACA,cAAc,SAAS;EACtB,OAAO,KAAKA,aAAa,IAAI,OAAO;CACrC;CACA,CAAC,SAAS;EACT,OAAO,KAAKA,aAAa,OAAO;CACjC;AACD;AACA,SAAS,mCAAmC,aAAa;CACxD,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,MAAM,cAAc,aAAa;EACrC,IAAI,CAAC,wBAAwB,UAAU,GAAG;GACzC,MAAM,UAAU,iBAAiB,UAAU;GAC3C,MAAM,gBAAgB,oCAAoC,qBAAqB,QAAQ,4CAA4C;IAClI,KAAK;IACL,KAAK;IACL,MAAM,EAAE,QAAQ;GACjB,CAAC;EACF;EACA,IAAI,KAAK,IAAI,WAAW,OAAO,GAAG,MAAM,gBAAgB,2BAA2B,yCAAyC,WAAW,QAAQ,KAAK;GACnJ,KAAK;GACL,KAAK;GACL,MAAM;IACL,SAAS,WAAW;IACpB,QAAQ;GACT;EACD,CAAC;EACD,KAAK,IAAI,WAAW,SAAS,UAAU;CACxC;CACA,OAAO,IAAI,kCAAkC,IAAI;AAClD;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAAS,OAAO,MAAM,YAAY,WAAW,MAAM,UAAU;AACjI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codec-types-CXtfACRK.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as AdaptedSqliteCodecDescriptor } from "./codec-descriptor-
|
|
2
|
-
import "./codec-descriptor-
|
|
3
|
-
import { c as SqliteJsonDescriptor, i as SqliteBlobDescriptor, l as SqliteRealDescriptor, n as SqliteBigintDescriptor, o as SqliteDatetimeDescriptor, r as SqliteBigintNumberDescriptor, s as SqliteIntegerDescriptor, u as SqliteTextDescriptor } from "./codecs-
|
|
1
|
+
import { t as AdaptedSqliteCodecDescriptor } from "./codec-descriptor-CDLhtrcE-CloMgVh6.mjs";
|
|
2
|
+
import "./codec-descriptor-C6M9ScCy-BqG7e8Oz.mjs";
|
|
3
|
+
import { c as SqliteJsonDescriptor, i as SqliteBlobDescriptor, l as SqliteRealDescriptor, n as SqliteBigintDescriptor, o as SqliteDatetimeDescriptor, r as SqliteBigintNumberDescriptor, s as SqliteIntegerDescriptor, u as SqliteTextDescriptor } from "./codecs-BURC1flo-UiOzcif2.mjs";
|
|
4
4
|
import { ExtractCodecTypes } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codec-types-
|
|
5
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codec-types-DU8BIZeM.d.mts
|
|
6
6
|
//#region src/exports/codec-types.d.ts
|
|
7
7
|
declare const codecDescriptorMap: {
|
|
8
8
|
readonly char: AdaptedSqliteCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlCharDescriptor>;
|
|
@@ -22,4 +22,4 @@ type Resolve<T> = { readonly [K in keyof T]: { readonly [P in keyof T[K]]: T[K][
|
|
|
22
22
|
type CodecTypes = Resolve<ExtractCodecTypes<typeof codecDescriptorMap>>;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { CodecTypes as t };
|
|
25
|
-
//# sourceMappingURL=codec-types-
|
|
25
|
+
//# sourceMappingURL=codec-types-DU8BIZeM-DPqt7bmT.d.mts.map
|
package/dist/{codec-types-Dm8kn3W4-BAWXUJJ8.d.mts.map → codec-types-DU8BIZeM-DPqt7bmT.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-types-
|
|
1
|
+
{"version":3,"file":"codec-types-DU8BIZeM-DPqt7bmT.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codec-types-DU8BIZeM.d.mts"],"mappings":";;;;;;cAKc;WACH,MAAM,yEAAyE;WAC/E,SAAS,yEAAyE;WAClF,KAAK,yEAAyE;WAC9E,OAAO,yEAAyE;WAChF,MAAM;WACN,SAAS;WACT,MAAM;WACN,MAAM;WACN,UAAU;WACV,MAAM;WACN,QAAQ;WACR,cAAc;;KAEpB,QAAQ,iBAAiB,WAAW,gBAAgB,WAAW,EAAE,KAAK,EAAE,GAAG;KAC3E,aAAa,QAAQ,yBAAyB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as SqliteCodecDescriptorRegistry, n as AnySqliteCodecDescriptor, r as SqliteCodecDescriptor } from "./codec-descriptor-
|
|
1
|
+
import { i as SqliteCodecDescriptorRegistry, n as AnySqliteCodecDescriptor, r as SqliteCodecDescriptor } from "./codec-descriptor-CDLhtrcE-CloMgVh6.mjs";
|
|
2
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, CodecRegistry } from "@prisma/orm-framework/components/codec";
|
|
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-BURC1flo.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.
|
|
@@ -210,4 +210,4 @@ declare const sqliteCodecRegistry: CodecDescriptorRegistry;
|
|
|
210
210
|
declare const sqliteCodecDescriptorRegistry: SqliteCodecDescriptorRegistry;
|
|
211
211
|
//#endregion
|
|
212
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 };
|
|
213
|
-
//# sourceMappingURL=codecs-
|
|
213
|
+
//# sourceMappingURL=codecs-BURC1flo-UiOzcif2.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-
|
|
1
|
+
{"version":3,"file":"codecs-BURC1flo-UiOzcif2.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs-BURC1flo.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,mBAAm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MAAM,YAAY;;cAEjB,iCAAiC;YACnC,eAAe,YAAY,iBAAiB;WAC7C,yDAAyD;WACzD;WACA;WACA;WACA;EACT,YAAY,KAAK,yBAAyB;;cAE9B,2EAA2E,WAAW;cACtF,wBAAwB,iBAAiB,sDAAsD,WAAW;EACtH,OAAO,OAAO,WAAW,MAAM,mBAAmB;EAClD,OAAO,eAAe,WAAW,MAAM,mBAAmB,QAAQ;EAClE,WAAW,OAAO,YAAY;EAC9B,WAAW,MAAM,YAAY;;cAEjB,6BAA6B;YAC/B,eAAe,YAAY,iBAAiB;WAC7C,yDAAyD;WACzD;WACA;WACA;WACA;EACT,YAAY,KAAK,yBAAyB;;cAE9B,uEAAuE,WAAW;cAClF,0BAA0B,iBAAiB;EACvD,OAAO,eAAe,MAAM,mBAAmB;;;;;;;;;EAS/C,OAAO,gCAAgC,MAAM,mBAAmB;EAChE,WAAW,gBAAgB;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,5 +1,5 @@
|
|
|
1
|
-
import { n as buildSqliteCodecDescriptorRegistry } from "./codec-descriptor-
|
|
2
|
-
import { t as codecDescriptors } from "./codecs-
|
|
1
|
+
import { n as buildSqliteCodecDescriptorRegistry } from "./codec-descriptor-CWJAw6Ck-BksOSxiO.mjs";
|
|
2
|
+
import { t as codecDescriptors } from "./codecs-yYxIwGIT-BHW7sSHn.mjs";
|
|
3
3
|
import { extractCodecLookup } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
|
|
5
5
|
//#region ../../../3-targets/3-targets/sqlite/dist/codecs.mjs
|
|
@@ -46,4 +46,4 @@ function createSqliteBuiltinCodecLookup() {
|
|
|
46
46
|
//#endregion
|
|
47
47
|
export { sqliteCodecRegistry as a, sqliteCodecDescriptorRegistry as i, createSqliteBuiltinCodecLookup as n, createSqliteCodecRegistryWithBuiltins as r, assembleSqliteCodecRegistry as t };
|
|
48
48
|
|
|
49
|
-
//# sourceMappingURL=codecs-
|
|
49
|
+
//# sourceMappingURL=codecs-BXELYOY1.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-
|
|
1
|
+
{"version":3,"file":"codecs-BXELYOY1.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs.mjs"],"sourcesContent":["import { n as buildSqliteCodecDescriptorRegistry } from \"./codec-descriptor-CWJAw6Ck.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-yYxIwGIT.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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codecs-BURC1flo-UiOzcif2.mjs";
|
|
@@ -1,11 +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, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-
|
|
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-
|
|
2
|
+
import { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-CWJAw6Ck-BksOSxiO.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-B6gYWauJ-DPJUc7_Z.mjs";
|
|
4
4
|
import { n as sqliteError } from "./errors-DnR-sMHS-KkMLIP2U.mjs";
|
|
5
|
-
import { CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
|
-
import { CodecImpl, column } from "@prisma/orm-framework/components/codec";
|
|
5
|
+
import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, SqlFloatCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
|
+
import { CodecImpl, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, column, decodeJsonFloat, decodeJsonInteger, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, encodeJsonFloat, refuseJsonValue } from "@prisma/orm-framework/components/codec";
|
|
7
7
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
8
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-
|
|
8
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-yYxIwGIT.mjs
|
|
9
9
|
/**
|
|
10
10
|
* Projects the expression unchanged, for codecs whose canonical JSON is what
|
|
11
11
|
* SQLite's own JSON conversion already produces.
|
|
@@ -42,6 +42,16 @@ const hexJsonProjection = (expression) => CaseExpr.of([{
|
|
|
42
42
|
condition: NullCheckExpr.isNull(expression),
|
|
43
43
|
value: LiteralExpr.of(null)
|
|
44
44
|
}], FunctionCallExpr.of("hex", [expression]));
|
|
45
|
+
/**
|
|
46
|
+
* Projects a REAL as SQLite writes it in JSON, except an infinity, which SQLite writes as `9.0e+999` and which becomes the text `Infinity` or `-Infinity` that `encodeJson` writes. The test is equality with an infinity, so text or a blob that a REAL column holds outside a STRICT table passes through unchanged.
|
|
47
|
+
*/
|
|
48
|
+
const floatJsonProjection = (expression) => CaseExpr.of([{
|
|
49
|
+
condition: BinaryExpr.eq(expression, LiteralExpr.of(Number.POSITIVE_INFINITY)),
|
|
50
|
+
value: LiteralExpr.of("Infinity")
|
|
51
|
+
}, {
|
|
52
|
+
condition: BinaryExpr.eq(expression, LiteralExpr.of(Number.NEGATIVE_INFINITY)),
|
|
53
|
+
value: LiteralExpr.of("-Infinity")
|
|
54
|
+
}], expression);
|
|
45
55
|
const JSON_RETAG_FN = "json";
|
|
46
56
|
/**
|
|
47
57
|
* Re-applies SQLite's JSON subtype to a document-valued expression.
|
|
@@ -71,19 +81,33 @@ const UPPERCASE_HEX = /^(?:[0-9A-F]{2})*$/;
|
|
|
71
81
|
/** Renders the decimal text `sqlite/bigintnumber@1` carries, whose application type is `number`, as a number literal. */
|
|
72
82
|
const decimalTextNumberLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? value : void 0;
|
|
73
83
|
/**
|
|
74
|
-
*
|
|
75
|
-
* `9.0e+999`, which reads back as `Infinity` rather than failing. A real is
|
|
76
|
-
* therefore carried only where it is finite.
|
|
84
|
+
* SQLite stores an infinity but not NaN, which it turns into NULL, so a float codec on SQLite refuses NaN wherever it writes a value: to a parameter, and to the contract.
|
|
77
85
|
*/
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
codecId
|
|
81
|
-
received:
|
|
86
|
+
function refuseNaN(codecId, value) {
|
|
87
|
+
if (Number.isNaN(value)) throw sqliteError("RUNTIME.ENCODE_FAILED", `${codecId} value must be a number other than NaN, which SQLite cannot store`, { meta: {
|
|
88
|
+
codecId,
|
|
89
|
+
received: "NaN"
|
|
82
90
|
} });
|
|
83
91
|
return value;
|
|
92
|
+
}
|
|
93
|
+
/** Reads a float's JSON form, which on SQLite has no NaN. */
|
|
94
|
+
function decodeJsonFloatWithoutNaN(codecId, json) {
|
|
95
|
+
const value = decodeJsonFloat(codecId, json);
|
|
96
|
+
if (Number.isNaN(value)) return refuseJsonValue(codecId, "a finite number or the text Infinity or -Infinity; SQLite cannot store NaN", json);
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
/** `sql/float@1` as SQLite stores it: without NaN. */
|
|
100
|
+
var SqliteFloatCodec = class extends SqlFloatCodec {
|
|
101
|
+
async encode(value, ctx) {
|
|
102
|
+
return super.encode(refuseNaN(this.id, value), ctx);
|
|
103
|
+
}
|
|
104
|
+
encodeJson(value) {
|
|
105
|
+
return super.encodeJson(refuseNaN(this.id, value));
|
|
106
|
+
}
|
|
107
|
+
decodeJson(json) {
|
|
108
|
+
return decodeJsonFloatWithoutNaN(this.id, json);
|
|
109
|
+
}
|
|
84
110
|
};
|
|
85
|
-
const MIN_SAFE_INTEGER_BIGINT = BigInt(Number.MIN_SAFE_INTEGER);
|
|
86
|
-
const MAX_SAFE_INTEGER_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);
|
|
87
111
|
/**
|
|
88
112
|
* Requires an application value to be of the JS type the codec reads.
|
|
89
113
|
*
|
|
@@ -144,15 +168,19 @@ const encodableSafeInteger = (value) => {
|
|
|
144
168
|
* conversion so an out-of-range value throws rather than rounds.
|
|
145
169
|
*/
|
|
146
170
|
const safeIntegerFromBigint = (value) => {
|
|
147
|
-
if (value <
|
|
171
|
+
if (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/bigintnumber@1 value must be an integer within the safe integer range, got ${value}`, { meta: {
|
|
148
172
|
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
149
173
|
received: value.toString()
|
|
150
174
|
} });
|
|
151
175
|
return Number(value);
|
|
152
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Projects a `sql/char@1` value without trailing spaces, as its `decode` reads it on a flat read, so an include reads the same value. SQLite does not pad the value; the rule is the family codec's.
|
|
179
|
+
*/
|
|
180
|
+
const unpaddedCharJsonProjection = (expression) => FunctionCallExpr.of("rtrim", [expression, LiteralExpr.of(" ")]);
|
|
153
181
|
const sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, {
|
|
154
182
|
dataType: sqliteText.id,
|
|
155
|
-
jsonProjection:
|
|
183
|
+
jsonProjection: unpaddedCharJsonProjection
|
|
156
184
|
});
|
|
157
185
|
const sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, {
|
|
158
186
|
dataType: sqliteText.id,
|
|
@@ -164,7 +192,8 @@ const sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, {
|
|
|
164
192
|
});
|
|
165
193
|
const sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, {
|
|
166
194
|
dataType: sqliteReal.id,
|
|
167
|
-
jsonProjection:
|
|
195
|
+
jsonProjection: floatJsonProjection,
|
|
196
|
+
factory: (descriptor) => () => new SqliteFloatCodec(descriptor)
|
|
168
197
|
});
|
|
169
198
|
var SqliteTextCodec = class extends CodecImpl {
|
|
170
199
|
async encode(value, _ctx) {
|
|
@@ -177,7 +206,7 @@ var SqliteTextCodec = class extends CodecImpl {
|
|
|
177
206
|
return value;
|
|
178
207
|
}
|
|
179
208
|
decodeJson(json) {
|
|
180
|
-
return
|
|
209
|
+
return decodeJsonString(SQLITE_TEXT_CODEC_ID, json);
|
|
181
210
|
}
|
|
182
211
|
};
|
|
183
212
|
var SqliteTextDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -210,15 +239,7 @@ var SqliteIntegerCodec = class extends CodecImpl {
|
|
|
210
239
|
return value;
|
|
211
240
|
}
|
|
212
241
|
decodeJson(json) {
|
|
213
|
-
|
|
214
|
-
codecId: SQLITE_INTEGER_CODEC_ID,
|
|
215
|
-
received: typeof json
|
|
216
|
-
} });
|
|
217
|
-
if (!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: {
|
|
218
|
-
codecId: SQLITE_INTEGER_CODEC_ID,
|
|
219
|
-
received: String(json)
|
|
220
|
-
} });
|
|
221
|
-
return json;
|
|
242
|
+
return decodeJsonInteger(SQLITE_INTEGER_CODEC_ID, json, SAFE_INTEGER_RANGE);
|
|
222
243
|
}
|
|
223
244
|
};
|
|
224
245
|
var SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -242,25 +263,21 @@ const sqliteIntegerDescriptor = new SqliteIntegerDescriptor();
|
|
|
242
263
|
const sqliteIntegerColumn = () => column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, void 0, "integer");
|
|
243
264
|
var SqliteRealCodec = class extends CodecImpl {
|
|
244
265
|
async encode(value, _ctx) {
|
|
245
|
-
return value;
|
|
266
|
+
return refuseNaN(SQLITE_REAL_CODEC_ID, value);
|
|
246
267
|
}
|
|
247
268
|
async decode(wire, _ctx) {
|
|
248
269
|
return wire;
|
|
249
270
|
}
|
|
250
271
|
encodeJson(value) {
|
|
251
|
-
return
|
|
272
|
+
return encodeJsonFloat(refuseNaN(SQLITE_REAL_CODEC_ID, value));
|
|
252
273
|
}
|
|
253
274
|
decodeJson(json) {
|
|
254
|
-
|
|
255
|
-
codecId: SQLITE_REAL_CODEC_ID,
|
|
256
|
-
received: typeof json
|
|
257
|
-
} });
|
|
258
|
-
return finiteReal(json, "RUNTIME.DECODE_FAILED");
|
|
275
|
+
return decodeJsonFloatWithoutNaN(SQLITE_REAL_CODEC_ID, json);
|
|
259
276
|
}
|
|
260
277
|
};
|
|
261
278
|
var SqliteRealDescriptor = class extends SqliteCodecDescriptor {
|
|
262
279
|
jsonProjection(expression) {
|
|
263
|
-
return expression;
|
|
280
|
+
return floatJsonProjection(expression);
|
|
264
281
|
}
|
|
265
282
|
dataType = sqliteReal.id;
|
|
266
283
|
codecId = SQLITE_REAL_CODEC_ID;
|
|
@@ -288,11 +305,8 @@ var SqliteBlobCodec = class extends CodecImpl {
|
|
|
288
305
|
return Buffer.from(value).toString("hex").toUpperCase();
|
|
289
306
|
}
|
|
290
307
|
decodeJson(json) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
received: typeof json
|
|
294
|
-
} });
|
|
295
|
-
return new Uint8Array(Buffer.from(json, "hex"));
|
|
308
|
+
const hex = decodeJsonMatching(SQLITE_BLOB_CODEC_ID, json, UPPERCASE_HEX, "uppercase hexadecimal text");
|
|
309
|
+
return new Uint8Array(Buffer.from(hex, "hex"));
|
|
296
310
|
}
|
|
297
311
|
};
|
|
298
312
|
var SqliteBlobDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -337,11 +351,9 @@ var SqliteDatetimeCodec = class extends CodecImpl {
|
|
|
337
351
|
return sqliteDatetimeCanonical(value.toISOString());
|
|
338
352
|
}
|
|
339
353
|
decodeJson(json) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
} });
|
|
344
|
-
return decodeSqliteDatetime(json);
|
|
354
|
+
const date = new Date(decodeJsonString(SQLITE_DATETIME_CODEC_ID, json));
|
|
355
|
+
if (Number.isNaN(date.getTime())) return refuseJsonValue(SQLITE_DATETIME_CODEC_ID, "a date and time string", json);
|
|
356
|
+
return date;
|
|
345
357
|
}
|
|
346
358
|
};
|
|
347
359
|
var SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -416,11 +428,7 @@ var SqliteBigintCodec = class extends CodecImpl {
|
|
|
416
428
|
return bigintEncodeJson(SQLITE_BIGINT_CODEC_ID, value);
|
|
417
429
|
}
|
|
418
430
|
decodeJson(json) {
|
|
419
|
-
|
|
420
|
-
codecId: SQLITE_BIGINT_CODEC_ID,
|
|
421
|
-
received: typeof json
|
|
422
|
-
} });
|
|
423
|
-
return BigInt(json);
|
|
431
|
+
return decodeJsonIntegerText(SQLITE_BIGINT_CODEC_ID, json, INT64_RANGE);
|
|
424
432
|
}
|
|
425
433
|
};
|
|
426
434
|
var SqliteBigintDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -472,11 +480,7 @@ var SqliteBigintNumberCodec = class extends CodecImpl {
|
|
|
472
480
|
return String(encodableSafeInteger(value));
|
|
473
481
|
}
|
|
474
482
|
decodeJson(json) {
|
|
475
|
-
|
|
476
|
-
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
477
|
-
received: typeof json
|
|
478
|
-
} });
|
|
479
|
-
return safeIntegerFromBigint(BigInt(json));
|
|
483
|
+
return Number(decodeJsonIntegerText(SQLITE_BIGINT_NUMBER_CODEC_ID, json, SAFE_INTEGER_BIGINT_RANGE));
|
|
480
484
|
}
|
|
481
485
|
};
|
|
482
486
|
var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -518,4 +522,4 @@ const codecDescriptors = defineSqliteCodecs([
|
|
|
518
522
|
//#endregion
|
|
519
523
|
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 };
|
|
520
524
|
|
|
521
|
-
//# sourceMappingURL=codecs-
|
|
525
|
+
//# sourceMappingURL=codecs-yYxIwGIT-BHW7sSHn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-yYxIwGIT-BHW7sSHn.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs-yYxIwGIT.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-B6gYWauJ.mjs\";\nimport { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from \"./codec-descriptor-CWJAw6Ck.mjs\";\nimport { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, SqlFloatCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from \"@internal/sql-relational-core/ast\";\nimport { CodecImpl, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, column, decodeJsonFloat, decodeJsonInteger, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, encodeJsonFloat, refuseJsonValue } 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]));\n/**\n* Projects a REAL as SQLite writes it in JSON, except an infinity, which SQLite writes as `9.0e+999` and which becomes the text `Infinity` or `-Infinity` that `encodeJson` writes. The test is equality with an infinity, so text or a blob that a REAL column holds outside a STRICT table passes through unchanged.\n*/\nconst floatJsonProjection = (expression) => CaseExpr.of([{\n\tcondition: BinaryExpr.eq(expression, LiteralExpr.of(Number.POSITIVE_INFINITY)),\n\tvalue: LiteralExpr.of(\"Infinity\")\n}, {\n\tcondition: BinaryExpr.eq(expression, LiteralExpr.of(Number.NEGATIVE_INFINITY)),\n\tvalue: LiteralExpr.of(\"-Infinity\")\n}], 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* SQLite stores an infinity but not NaN, which it turns into NULL, so a float codec on SQLite refuses NaN wherever it writes a value: to a parameter, and to the contract.\n*/\nfunction refuseNaN(codecId, value) {\n\tif (Number.isNaN(value)) throw sqliteError(\"RUNTIME.ENCODE_FAILED\", `${codecId} value must be a number other than NaN, which SQLite cannot store`, { meta: {\n\t\tcodecId,\n\t\treceived: \"NaN\"\n\t} });\n\treturn value;\n}\n/** Reads a float's JSON form, which on SQLite has no NaN. */\nfunction decodeJsonFloatWithoutNaN(codecId, json) {\n\tconst value = decodeJsonFloat(codecId, json);\n\tif (Number.isNaN(value)) return refuseJsonValue(codecId, \"a finite number or the text Infinity or -Infinity; SQLite cannot store NaN\", json);\n\treturn value;\n}\n/** `sql/float@1` as SQLite stores it: without NaN. */\nvar SqliteFloatCodec = class extends SqlFloatCodec {\n\tasync encode(value, ctx) {\n\t\treturn super.encode(refuseNaN(this.id, value), ctx);\n\t}\n\tencodeJson(value) {\n\t\treturn super.encodeJson(refuseNaN(this.id, value));\n\t}\n\tdecodeJson(json) {\n\t\treturn decodeJsonFloatWithoutNaN(this.id, json);\n\t}\n};\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 < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) 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};\n/**\n* Projects a `sql/char@1` value without trailing spaces, as its `decode` reads it on a flat read, so an include reads the same value. SQLite does not pad the value; the rule is the family codec's.\n*/\nconst unpaddedCharJsonProjection = (expression) => FunctionCallExpr.of(\"rtrim\", [expression, LiteralExpr.of(\" \")]);\nconst sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, {\n\tdataType: sqliteText.id,\n\tjsonProjection: unpaddedCharJsonProjection\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: floatJsonProjection,\n\tfactory: (descriptor) => () => new SqliteFloatCodec(descriptor)\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 decodeJsonString(SQLITE_TEXT_CODEC_ID, 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\treturn decodeJsonInteger(SQLITE_INTEGER_CODEC_ID, json, SAFE_INTEGER_RANGE);\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 refuseNaN(SQLITE_REAL_CODEC_ID, value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tencodeJson(value) {\n\t\treturn encodeJsonFloat(refuseNaN(SQLITE_REAL_CODEC_ID, value));\n\t}\n\tdecodeJson(json) {\n\t\treturn decodeJsonFloatWithoutNaN(SQLITE_REAL_CODEC_ID, json);\n\t}\n};\nvar SqliteRealDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn floatJsonProjection(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\tconst hex = decodeJsonMatching(SQLITE_BLOB_CODEC_ID, json, UPPERCASE_HEX, \"uppercase hexadecimal text\");\n\t\treturn new Uint8Array(Buffer.from(hex, \"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\tconst date = new Date(decodeJsonString(SQLITE_DATETIME_CODEC_ID, json));\n\t\tif (Number.isNaN(date.getTime())) return refuseJsonValue(SQLITE_DATETIME_CODEC_ID, \"a date and time string\", json);\n\t\treturn date;\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\treturn decodeJsonIntegerText(SQLITE_BIGINT_CODEC_ID, json, INT64_RANGE);\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\treturn Number(decodeJsonIntegerText(SQLITE_BIGINT_NUMBER_CODEC_ID, json, SAFE_INTEGER_BIGINT_RANGE));\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-yYxIwGIT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,IAAI,CAAC;CAC1C;CACA,WAAW,OAAO;EACjB,OAAO,OAAO,qBAAqB,KAAK,CAAC;CAC1C;CACA,WAAW,MAAM;EAChB,OAAO,OAAO,sBAAsB,+BAA+B,MAAM,yBAAyB,CAAC;CACpG;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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as sqliteDriverDescriptorMeta, t as normalizeSqliteError } from "./descriptor-meta-
|
|
1
|
+
import { n as sqliteDriverDescriptorMeta, r as sqliteParams, t as normalizeSqliteError } from "./descriptor-meta-cwy5CXTT-DSRaq_b-.mjs";
|
|
2
2
|
import { errorRuntime } from "@prisma/orm-framework/errors/execution";
|
|
3
3
|
import { DatabaseSync } from "node:sqlite";
|
|
4
4
|
import { basename } from "pathe";
|
|
@@ -14,7 +14,7 @@ var SqliteControlDriver = class {
|
|
|
14
14
|
}
|
|
15
15
|
async query(sql, params) {
|
|
16
16
|
try {
|
|
17
|
-
return { rows: this.db.prepare(sql).all(...params
|
|
17
|
+
return { rows: this.db.prepare(sql).all(...sqliteParams(params)) };
|
|
18
18
|
} catch (error) {
|
|
19
19
|
throw normalizeSqliteError(error);
|
|
20
20
|
}
|
|
@@ -48,4 +48,4 @@ const sqliteDriverDescriptor = {
|
|
|
48
48
|
//#endregion
|
|
49
49
|
export { sqliteDriverDescriptor as n, SqliteControlDriver as t };
|
|
50
50
|
|
|
51
|
-
//# sourceMappingURL=control-
|
|
51
|
+
//# sourceMappingURL=control-1rQ6mko7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-1rQ6mko7.mjs","names":[],"sources":["../../../../3-targets/7-drivers/sqlite/dist/control.mjs"],"sourcesContent":["import { n as sqliteParams, r as normalizeSqliteError, t as sqliteDriverDescriptorMeta } from \"./descriptor-meta-cwy5CXTT.mjs\";\nimport { DatabaseSync } from \"node:sqlite\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { basename } from \"pathe\";\n//#region src/core/control-driver.ts\nvar SqliteControlDriver = class {\n\tdb;\n\tlocation;\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\tconstructor(db, location) {\n\t\tthis.db = db;\n\t\tthis.location = location;\n\t}\n\tasync query(sql, params) {\n\t\ttry {\n\t\t\treturn { rows: this.db.prepare(sql).all(...sqliteParams(params)) };\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error);\n\t\t}\n\t}\n\tasync databaseName() {\n\t\tif (this.location === \":memory:\" || this.location.length === 0) return;\n\t\tconst name = basename(this.location);\n\t\treturn name.length > 0 ? name : void 0;\n\t}\n\tasync close() {\n\t\tthis.db.close();\n\t}\n};\nconst sqliteDriverDescriptor = {\n\t...sqliteDriverDescriptorMeta,\n\tasync create(pathOrMemory) {\n\t\ttry {\n\t\t\tconst db = new DatabaseSync(pathOrMemory);\n\t\t\tdb.exec(\"PRAGMA foreign_keys = ON\");\n\t\t\treturn new SqliteControlDriver(db, pathOrMemory);\n\t\t} catch (error) {\n\t\t\tthrow errorRuntime(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tfix: \"Verify the database file path exists and is accessible\",\n\t\t\t\tmeta: { path: pathOrMemory },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { SqliteControlDriver, sqliteDriverDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;AAKA,IAAI,sBAAsB,MAAM;CAC/B;CACA;CACA,WAAW;CACX,WAAW;CACX,YAAY,IAAI,UAAU;EACzB,KAAK,KAAK;EACV,KAAK,WAAW;CACjB;CACA,MAAM,MAAM,KAAK,QAAQ;EACxB,IAAI;GACH,OAAO,EAAE,MAAM,KAAK,GAAG,QAAQ,GAAG,CAAC,CAAC,IAAI,GAAG,aAAa,MAAM,CAAC,EAAE;EAClE,SAAS,OAAO;GACf,MAAM,qBAAqB,KAAK;EACjC;CACD;CACA,MAAM,eAAe;EACpB,IAAI,KAAK,aAAa,cAAc,KAAK,SAAS,WAAW,GAAG;EAChE,MAAM,OAAO,SAAS,KAAK,QAAQ;EACnC,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK;CACtC;CACA,MAAM,QAAQ;EACb,KAAK,GAAG,MAAM;CACf;AACD;AACA,MAAM,yBAAyB;CAC9B,GAAG;CACH,MAAM,OAAO,cAAc;EAC1B,IAAI;GACH,MAAM,KAAK,IAAI,aAAa,YAAY;GACxC,GAAG,KAAK,0BAA0B;GAClC,OAAO,IAAI,oBAAoB,IAAI,YAAY;EAChD,SAAS,OAAO;GACf,MAAM,aAAa,4BAA4B,8BAA8B;IAC5E,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC1D,KAAK;IACL,MAAM,EAAE,MAAM,aAAa;IAC3B,OAAO;GACR,CAAC;EACF;CACD;AACD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as SqliteCodecRegistry } from "./codecs-
|
|
2
|
-
import "./codecs-
|
|
1
|
+
import { a as SqliteCodecRegistry } from "./codecs-BURC1flo-UiOzcif2.mjs";
|
|
2
|
+
import "./codecs-CKWQYtFS.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
|
-
import { AnyQueryAst, DdlNode, LoweredStatement, LowererContext, MarkerReadResult, SqlExecuteRequest } from "@prisma/orm-family-sql/relational-core/ast";
|
|
8
|
-
import { SqlControlAdapterDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
7
|
+
import { AnyQueryAst, DdlColumn, DdlNode, LoweredStatement, LowererContext, MarkerReadResult, SqlExecuteRequest } from "@prisma/orm-family-sql/relational-core/ast";
|
|
9
8
|
import { SqlSchemaIR } from "@prisma/orm-family-sql/schema-ir/types";
|
|
10
9
|
import { SqlControlDriverInstance } from "@prisma/orm-family-sql/contract/types";
|
|
10
|
+
import { SqlControlAdapterDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
11
11
|
import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
|
|
12
12
|
import { SqlControlAdapter } from "@prisma/orm-family-sql/family/control-adapter";
|
|
13
13
|
//#region ../../../3-targets/6-adapters/sqlite/dist/control.d.mts
|
|
@@ -30,6 +30,7 @@ declare class SqliteControlAdapter implements SqlControlAdapter<'sqlite'> {
|
|
|
30
30
|
* without instantiating the runtime adapter.
|
|
31
31
|
*/
|
|
32
32
|
lower(ast: AnyQueryAst | SqliteDdlNode, context: LowererContext<unknown>): LoweredStatement;
|
|
33
|
+
renderColumnDefault(column: DdlColumn, table: string): Promise<string>;
|
|
33
34
|
/**
|
|
34
35
|
* Lower an AST all the way to a driver-ready statement. For DDL nodes,
|
|
35
36
|
* literal column defaults are formatted as inline SQL with SQLite-specific
|
|
@@ -103,4 +104,4 @@ declare class SqliteControlAdapter implements SqlControlAdapter<'sqlite'> {
|
|
|
103
104
|
declare const sqliteAdapterDescriptor: SqlControlAdapterDescriptor<'sqlite'>;
|
|
104
105
|
//#endregion
|
|
105
106
|
export { sqliteAdapterDescriptor as n, SqliteControlAdapter as t };
|
|
106
|
-
//# sourceMappingURL=control-
|
|
107
|
+
//# sourceMappingURL=control-CfS8mDnj.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-CfS8mDnj.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;EAC3E,oBAAoB,QAAQ,WAAW,gBAAgB;;;;;;;;EAQvD,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,6 +1,6 @@
|
|
|
1
1
|
import { t as SqlitePlanTargetDetails } from "./planner-target-details-xR6UfIcz-CMahymzq.mjs";
|
|
2
|
-
import { SqlControlTargetDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
3
2
|
import { SqlNamespaceBase, SqlNamespaceEntries, SqlNamespaceInput, StorageTable } from "@prisma/orm-family-sql/contract/types";
|
|
3
|
+
import { SqlControlTargetDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
4
4
|
//#region ../../../3-targets/3-targets/sqlite/dist/control.d.mts
|
|
5
5
|
//#region src/core/control-target.d.ts
|
|
6
6
|
declare const sqliteControlTargetDescriptor: SqlControlTargetDescriptor<'sqlite', SqlitePlanTargetDetails>;
|
|
@@ -58,4 +58,4 @@ declare class SqliteUnboundDatabase extends SqliteDatabase {
|
|
|
58
58
|
declare function sqliteCreateNamespace(input: SqlNamespaceInput): SqliteDatabase | SqliteUnboundDatabase;
|
|
59
59
|
//#endregion
|
|
60
60
|
export { sqliteControlTargetDescriptor as n, sqliteCreateNamespace as r, SqliteUnboundDatabase as t };
|
|
61
|
-
//# sourceMappingURL=control
|
|
61
|
+
//# sourceMappingURL=control-DAys3o_s.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control
|
|
1
|
+
{"version":3,"file":"control-DAys3o_s.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/control.d.mts"],"mappings":";;;;;cAIc,+BAA+B,qCAAqC;;;KAG7E;WACM;WACA,SAAS;;;;;;;cAON,uBAAuB;WAC1B;WACA;WACA,SAAS;EAClB,YAAY,OAAO;MACf,SAAS,SAAS,eAAe;EACrC;EACA,aAAa;;;;;;;;;;;;;;;;;;;cAmBD,8BAA8B;kBAC1B,UAAU;UAClB;;;;;;;;;;;;iBAYO,sBAAsB,OAAO,oBAAoB,iBAAiB"}
|