@prisma/orm-target-sqlite 8.0.0-rc.11-dev.42 → 8.0.0-rc.11-dev.43
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-DEYUC-KO-DO_abhIq.d.mts → adapter-DEYUC-KO-CidoiIE8.d.mts} +4 -4
- package/dist/{adapter-DEYUC-KO-DO_abhIq.d.mts.map → adapter-DEYUC-KO-CidoiIE8.d.mts.map} +1 -1
- package/dist/{adapter-_MnQpUc6-Bp3SyJYD.mjs → adapter-_MnQpUc6-BE7Ek23z.mjs} +4 -4
- package/dist/{adapter-_MnQpUc6-Bp3SyJYD.mjs.map → adapter-_MnQpUc6-BE7Ek23z.mjs.map} +1 -1
- package/dist/adapter-rEr8Kd-s.d.mts +2 -0
- package/dist/adapter.d.mts +10 -10
- package/dist/adapter.mjs +1 -1
- 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 +1 -1
- package/dist/adapter__control.mjs +17 -6
- 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 +2 -2
- package/dist/{aggregates-DWyPO7t6.mjs → aggregates-CATLYJxc.mjs} +2 -2
- package/dist/{aggregates-DWyPO7t6.mjs.map → aggregates-CATLYJxc.mjs.map} +1 -1
- package/dist/codec-descriptor-4BIWMlhf-CjIjnr76.d.mts +1 -0
- package/dist/{codec-descriptor-BcgD9f3L-yDi5nh_k.d.mts → codec-descriptor-BNC9tDro-BPWBITSr.d.mts} +8 -6
- package/dist/codec-descriptor-BNC9tDro-BPWBITSr.d.mts.map +1 -0
- package/dist/codec-descriptor-ae4jEMJI.d.mts +2 -0
- package/dist/{codec-descriptor-B9ru99aI-DTkdKFU5.mjs → codec-descriptor-iBsfn3Ib-Chscaqnm.mjs} +5 -3
- package/dist/codec-descriptor-iBsfn3Ib-Chscaqnm.mjs.map +1 -0
- package/dist/codec-types-BDASdd7Z.d.mts +1 -0
- package/dist/codec-types-BP_jt4cV.d.mts +2 -0
- package/dist/{codec-types-D7uWRvQ1-DPnvquS8.d.mts → codec-types-BmdALTGe-CH015gsn.d.mts} +5 -5
- package/dist/{codec-types-D7uWRvQ1-DPnvquS8.d.mts.map → codec-types-BmdALTGe-CH015gsn.d.mts.map} +1 -1
- package/dist/codecs-CZ668gc7.d.mts +1 -0
- package/dist/{codecs-BDdR6FbY.mjs → codecs-DpMoJnXK.mjs} +47 -31
- package/dist/codecs-DpMoJnXK.mjs.map +1 -0
- package/dist/{codecs-BQWqLgCl-CdB8t7HI.d.mts → codecs-Ke2zEuU2-B8ego8w-.d.mts} +15 -7
- package/dist/codecs-Ke2zEuU2-B8ego8w-.d.mts.map +1 -0
- package/dist/{control-CLirKz11.d.mts → control-BUqfJUxo.d.mts} +4 -4
- package/dist/{control-CLirKz11.d.mts.map → control-BUqfJUxo.d.mts.map} +1 -1
- package/dist/data-types-BOA80gRp-DV5kY9es.mjs +50 -0
- package/dist/data-types-BOA80gRp-DV5kY9es.mjs.map +1 -0
- package/dist/data-types-D3cyzV-O.d.mts +19 -0
- package/dist/data-types-D3cyzV-O.d.mts.map +1 -0
- package/dist/data-types-c3xcs6Mr.mjs +68 -0
- package/dist/data-types-c3xcs6Mr.mjs.map +1 -0
- package/dist/{descriptor-meta-CHbTkdOW-Bv1fskyU.mjs → descriptor-meta-CqCH7n4c-CZhs8PR9.mjs} +6 -4
- package/dist/descriptor-meta-CqCH7n4c-CZhs8PR9.mjs.map +1 -0
- package/dist/{pack-CgUQkxKM.d.mts → pack-EwbBcB-c.d.mts} +2 -2
- package/dist/{pack-CgUQkxKM.d.mts.map → pack-EwbBcB-c.d.mts.map} +1 -1
- package/dist/{runtime-C5J9fusd.d.mts → runtime-DxqV7w29.d.mts} +2 -2
- package/dist/{runtime-C5J9fusd.d.mts.map → runtime-DxqV7w29.d.mts.map} +1 -1
- package/dist/sql-renderer-BoOq3nw3.d.mts +1 -0
- package/dist/target.d.mts +9 -8
- package/dist/target.mjs +6 -4
- package/dist/target__aggregates.mjs +1 -1
- 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 +1 -1
- package/dist/target__data-types.d.mts +2 -0
- package/dist/target__data-types.mjs +3 -0
- package/dist/target__pack.d.mts +1 -1
- package/dist/types-Bom9kmaX.d.mts +1 -0
- package/dist/{types-C5FSREvo-CwUlKK34.d.mts → types-C5FSREvo-D12bNrqS.d.mts} +3 -3
- package/dist/{types-C5FSREvo-CwUlKK34.d.mts.map → types-C5FSREvo-D12bNrqS.d.mts.map} +1 -1
- package/package.json +10 -9
- package/dist/adapter-D7zw14p5.d.mts +0 -2
- package/dist/codec-descriptor-B9ru99aI-DTkdKFU5.mjs.map +0 -1
- package/dist/codec-descriptor-BcgD9f3L-yDi5nh_k.d.mts.map +0 -1
- package/dist/codec-descriptor-rFuZ9DzY-CKRIRxah.d.mts +0 -1
- package/dist/codec-descriptor-vwfD3BMy.d.mts +0 -2
- package/dist/codec-types-B-TDcvQc.d.mts +0 -1
- package/dist/codec-types-CS0bD1kX.d.mts +0 -2
- package/dist/codecs-BDdR6FbY.mjs.map +0 -1
- package/dist/codecs-BQWqLgCl-CdB8t7HI.d.mts.map +0 -1
- package/dist/codecs-BTv6fRXv.d.mts +0 -1
- package/dist/descriptor-meta-CHbTkdOW-Bv1fskyU.mjs.map +0 -1
- package/dist/sql-renderer-KX6hn_tg.d.mts +0 -1
- package/dist/types-B7e2QVEx.d.mts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/control.mjs"],"sourcesContent":["import { a as SqliteControlAdapter, c as createSqliteCodecRegistryWithBuiltins, o as assembleSqliteCodecRegistry, s as createSqliteBuiltinCodecLookup } from \"./adapter-_MnQpUc6.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-CHbTkdOW.mjs\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-sqlite/sql-utils\";\nimport { parseSqliteDefault } from \"@internal/target-sqlite/default-normalizer\";\nimport { normalizeSqliteNativeType } from \"@internal/target-sqlite/native-type-normalizer\";\nimport { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\nimport { sqlDefaultLiteralTagEntry, timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* SQLite spellings that all denote the same wall-clock-now value. Anything\n* matching this set when passed through `dbgenerated(\"...\")` is rewritten\n* to the canonical `now()` form before entering the contract — symmetric\n* with `parseSqliteDefault` on the introspection side, so the verifier\n* compares canonical-vs-canonical and a contract using\n* `dbgenerated(\"CURRENT_TIMESTAMP\")` doesn't drift against the schema it\n* just produced.\n*/\nconst NOW_SYNONYMS = /* @__PURE__ */ new Set([\n\t\"current_timestamp\",\n\t\"datetime('now')\",\n\t\"datetime(\\\"now\\\")\",\n\t\"now()\"\n]);\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nfunction lowerDbgenerated(input) {\n\tconst raw = input.call.args[\"expression\"];\n\tif (typeof raw !== \"string\" || raw.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\tconst trimmed = raw.trim();\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: NOW_SYNONYMS.has(trimmed.toLowerCase()) ? \"now()\" : trimmed\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = { documentation: \"Uses the current database timestamp as the default value.\" };\nconst autoincrementSig = { documentation: \"Generates an increasing integer value in the database.\" };\nconst ulidSig = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst uuidSig = {\n\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: optional(oneOf(num(4), num(7))),\n\t\tdocumentation: \"The UUID version: `4` or `7`. Defaults to `4`.\"\n\t}]\n};\nconst cuidSig = {\n\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: num(2),\n\t\tdocumentation: \"The CUID version. Only `2` is supported.\"\n\t}]\n};\nconst nanoidSig = {\n\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"size\",\n\t\ttype: optional(int({\n\t\t\tmin: 2,\n\t\t\tmax: 255\n\t\t})),\n\t\tdocumentation: \"The identifier length, from `2` through `255`. Omit to use the generator default.\"\n\t}]\n};\nconst dbgeneratedSig = {\n\tdocumentation: \"Uses a database SQL expression as the default value.\",\n\tpositional: [{\n\t\tkey: \"expression\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty SQL expression evaluated by the database.\"\n\t}]\n};\nconst sqliteDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tsignature: dbgeneratedSig,\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@default(uuid())`) never re-picks a column's storage.\n*/\nconst sqliteScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text stored as SQLite text.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An integer stored as SQLite integer and represented as a JavaScript number.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_INTEGER_CODEC_ID,\n\t\t\tnativeType: \"integer\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An integer stored as SQLite integer and represented as a JavaScript bigint.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\tnativeType: \"integer\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A floating-point number stored as SQLite real.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_REAL_CODEC_ID,\n\t\t\tnativeType: \"real\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A decimal value stored and represented as text to preserve precision.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A date and time stored as SQLite text.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value serialized to SQLite text.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_JSON_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Binary data stored as a SQLite blob.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_BLOB_CODEC_ID,\n\t\t\tnativeType: \"blob\"\n\t\t}\n\t}\n};\nfunction createSqliteDefaultFunctionRegistry() {\n\treturn new Map(sqliteDefaultFunctionRegistryEntries);\n}\nfunction createSqliteDefaultLiteralTagRegistry() {\n\treturn /* @__PURE__ */ new Map([[\"sql\", sqlDefaultLiteralTagEntry(\"sql`...`\")], [\"sqlite.sql\", sqlDefaultLiteralTagEntry(\"sqlite.sql`...`\")]]);\n}\nfunction createSqliteMutationDefaultGeneratorDescriptors() {\n\treturn [...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\tid,\n\t\tapplicableCodecIds\n\t})), timestampNowControlDescriptor()];\n}\n//#endregion\n//#region src/exports/control.ts\nconst sqliteAdapterDescriptor = {\n\t...sqliteAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: sqliteScalarAuthoringTypes,\n\t\tvalueObjectStorageType: \"Json\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createSqliteDefaultFunctionRegistry(),\n\t\tdefaultLiteralTagRegistry: createSqliteDefaultLiteralTagRegistry(),\n\t\tgeneratorDescriptors: createSqliteMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new SqliteControlAdapter(assembleSqliteCodecRegistry(stack.target, stack.extensions));\n\t}\n};\n//#endregion\nexport { SqliteControlAdapter, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, sqliteAdapterDescriptor as default, escapeLiteral, normalizeSqliteNativeType, parseSqliteDefault, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,0BAA0B,OAAO;CACzC,OAAO;EACN,IAAI;EACJ,YAAY;GACX,MAAM;GACN,SAAS,MAAM;GACf,UAAU,MAAM,QAAQ;GACxB,MAAM,MAAM;EACb;CACD;AACD;AACA,SAAS,mBAAmB,IAAI,QAAQ;CACvC,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,WAAW;IACV,MAAM;IACN;IACA,GAAG,SAAS,EAAE,OAAO,IAAI,CAAC;GAC3B;EACD;CACD;AACD;;;;;;;;;;AAUA,MAAM,+BAA+B,IAAI,IAAI;CAC5C;CACA;CACA;CACA;AACD,CAAC;AACD,SAAS,qBAAqB;CAC7B,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,WAAW;CACnB,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,MAAM;AACjC;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,MAAM,KAAK,KAAK,eAAe,IAAI,mBAAmB,QAAQ,IAAI,mBAAmB,QAAQ;AACrG;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,OAAO;AAClC;AACA,SAAS,YAAY,OAAO;CAC3B,MAAM,OAAO,MAAM,KAAK,KAAK;CAC7B,OAAO,OAA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G,CAAC,cAAc,0BAA0B,iBAAiB,CAAC,CAAC,CAAC;AAC9I;AACA,SAAS,kDAAkD;CAC1D,OAAO,CAAC,GAAG,iCAAiC,KAAK,EAAE,IAAI,0BAA0B;EAChF;EACA;CACD,EAAE,GAAG,8BAA8B,CAAC;AACrC;AAGA,MAAM,0BAA0B;CAC/B,GAAG;CACH,WAAW;EACV,MAAM;EACN,wBAAwB;CACzB;CACA,yBAAyB;EACxB,yBAAyB,oCAAoC;EAC7D,2BAA2B,sCAAsC;EACjE,sBAAsB,gDAAgD;CACvE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,qBAAqB,4BAA4B,MAAM,QAAQ,MAAM,UAAU,CAAC;CAC5F;AACD"}
|
|
1
|
+
{"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/control.mjs"],"sourcesContent":["import { a as SqliteControlAdapter, c as createSqliteCodecRegistryWithBuiltins, o as assembleSqliteCodecRegistry, s as createSqliteBuiltinCodecLookup } from \"./adapter-_MnQpUc6.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-CqCH7n4c.mjs\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-sqlite/sql-utils\";\nimport { parseSqliteDefault } from \"@internal/target-sqlite/default-normalizer\";\nimport { normalizeSqliteNativeType } from \"@internal/target-sqlite/native-type-normalizer\";\nimport { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\nimport { sqlDefaultLiteralTagEntry, timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\nimport { loweringEntryKey } from \"@internal/framework-components/authoring\";\nimport { sqliteDataTypeEntries } from \"@internal/target-sqlite/data-types\";\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* SQLite spellings that all denote the same wall-clock-now value. Anything\n* matching this set when passed through `dbgenerated(\"...\")` is rewritten\n* to the canonical `now()` form before entering the contract — symmetric\n* with `parseSqliteDefault` on the introspection side, so the verifier\n* compares canonical-vs-canonical and a contract using\n* `dbgenerated(\"CURRENT_TIMESTAMP\")` doesn't drift against the schema it\n* just produced.\n*/\nconst NOW_SYNONYMS = /* @__PURE__ */ new Set([\n\t\"current_timestamp\",\n\t\"datetime('now')\",\n\t\"datetime(\\\"now\\\")\",\n\t\"now()\"\n]);\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nfunction lowerDbgenerated(input) {\n\tconst raw = input.call.args[\"expression\"];\n\tif (typeof raw !== \"string\" || raw.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\tconst trimmed = raw.trim();\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: NOW_SYNONYMS.has(trimmed.toLowerCase()) ? \"now()\" : trimmed\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = { documentation: \"Uses the current database timestamp as the default value.\" };\nconst autoincrementSig = { documentation: \"Generates an increasing integer value in the database.\" };\nconst ulidSig = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst uuidSig = {\n\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: optional(oneOf(num(4), num(7))),\n\t\tdocumentation: \"The UUID version: `4` or `7`. Defaults to `4`.\"\n\t}]\n};\nconst cuidSig = {\n\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: num(2),\n\t\tdocumentation: \"The CUID version. Only `2` is supported.\"\n\t}]\n};\nconst nanoidSig = {\n\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"size\",\n\t\ttype: optional(int({\n\t\t\tmin: 2,\n\t\t\tmax: 255\n\t\t})),\n\t\tdocumentation: \"The identifier length, from `2` through `255`. Omit to use the generator default.\"\n\t}]\n};\nconst dbgeneratedSig = {\n\tdocumentation: \"Uses a database SQL expression as the default value.\",\n\tpositional: [{\n\t\tkey: \"expression\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty SQL expression evaluated by the database.\"\n\t}]\n};\nconst sqliteDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tsignature: dbgeneratedSig,\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@default(uuid())`) never re-picks a column's storage.\n*/\nconst sqliteScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text stored as SQLite text.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An integer stored as SQLite integer and represented as a JavaScript number.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_INTEGER_CODEC_ID,\n\t\t\tnativeType: \"integer\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An integer stored as SQLite integer and represented as a JavaScript bigint.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\tnativeType: \"integer\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A floating-point number stored as SQLite real.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_REAL_CODEC_ID,\n\t\t\tnativeType: \"real\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A decimal value stored and represented as text to preserve precision.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A date and time stored as SQLite text.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value serialized to SQLite text.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_JSON_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Binary data stored as a SQLite blob.\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_BLOB_CODEC_ID,\n\t\t\tnativeType: \"blob\"\n\t\t}\n\t}\n};\nfunction createSqliteDefaultFunctionRegistry() {\n\treturn new Map(sqliteDefaultFunctionRegistryEntries);\n}\nfunction createSqliteMutationDefaultGeneratorDescriptors() {\n\treturn [...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\tid,\n\t\tapplicableCodecIds\n\t})), timestampNowControlDescriptor()];\n}\n//#endregion\n//#region src/core/data-type-authoring.ts\n/**\n* The PSL support this adapter contributes for its target's data types: the value entries the\n* target declares, plus the two tags that lower their own bodies and name no data type, which sit\n* under reserved keys and come from the family. ADR 254.\n*/\nfunction createSqliteDataTypeEntries() {\n\treturn {\n\t\t...sqliteDataTypeEntries(),\n\t\t[loweringEntryKey(\"sql\")]: sqlDefaultLiteralTagEntry(\"sql\"),\n\t\t[loweringEntryKey(\"sqlite.sql\")]: sqlDefaultLiteralTagEntry(\"sqlite.sql\")\n\t};\n}\n//#endregion\n//#region src/exports/control.ts\nconst sqliteAdapterDescriptor = {\n\t...sqliteAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: sqliteScalarAuthoringTypes,\n\t\tdataTypes: createSqliteDataTypeEntries(),\n\t\tvalueObjectStorageType: \"Json\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createSqliteDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createSqliteMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new SqliteControlAdapter(assembleSqliteCodecRegistry(stack.target, stack.extensions));\n\t}\n};\n//#endregion\nexport { SqliteControlAdapter, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, sqliteAdapterDescriptor as default, escapeLiteral, normalizeSqliteNativeType, parseSqliteDefault, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,0BAA0B,OAAO;CACzC,OAAO;EACN,IAAI;EACJ,YAAY;GACX,MAAM;GACN,SAAS,MAAM;GACf,UAAU,MAAM,QAAQ;GACxB,MAAM,MAAM;EACb;CACD;AACD;AACA,SAAS,mBAAmB,IAAI,QAAQ;CACvC,OAAO;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qliteRuntimeAdapterInstance } from "./runtime-
|
|
1
|
+
import { n as sqliteRuntimeAdapterDescriptor, t as SqliteRuntimeAdapterInstance } from "./runtime-DxqV7w29.mjs";
|
|
2
2
|
export { type SqliteRuntimeAdapterInstance, sqliteRuntimeAdapterDescriptor as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as sqliteCodecDescriptorRegistry } from "./codecs-
|
|
2
|
-
import { c as sqliteRawCodecInferer, i as createSqliteAdapterWithCodecRegistry, n as assembleSqliteCodecRegistry } from "./adapter-_MnQpUc6-
|
|
3
|
-
import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-
|
|
1
|
+
import { a as sqliteCodecDescriptorRegistry } from "./codecs-DpMoJnXK.mjs";
|
|
2
|
+
import { c as sqliteRawCodecInferer, i as createSqliteAdapterWithCodecRegistry, n as assembleSqliteCodecRegistry } from "./adapter-_MnQpUc6-BE7Ek23z.mjs";
|
|
3
|
+
import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-CqCH7n4c-CZhs8PR9.mjs";
|
|
4
4
|
import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
|
|
5
5
|
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
|
|
6
6
|
import { generateId } from "@prisma/orm-framework/ids/runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/runtime.mjs"],"sourcesContent":["import { i as sqliteRawCodecInferer, n as createSqliteAdapterWithCodecRegistry, o as assembleSqliteCodecRegistry } from \"./adapter-_MnQpUc6.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-
|
|
1
|
+
{"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/runtime.mjs"],"sourcesContent":["import { i as sqliteRawCodecInferer, n as createSqliteAdapterWithCodecRegistry, o as assembleSqliteCodecRegistry } from \"./adapter-_MnQpUc6.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-CqCH7n4c.mjs\";\nimport { sqliteCodecDescriptorRegistry } from \"@internal/target-sqlite/codecs\";\nimport { builtinGeneratorIds } from \"@internal/ids\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-sql/runtime\";\nimport { generateId } from \"@internal/ids/runtime\";\n//#region src/core/runtime-adapter.ts\nfunction createSqliteMutationDefaultGenerators() {\n\treturn [...builtinGeneratorIds.map((id) => ({\n\t\tid,\n\t\tgenerate: (params) => {\n\t\t\treturn generateId(params ? {\n\t\t\t\tid,\n\t\t\t\tparams\n\t\t\t} : { id });\n\t\t},\n\t\tstability: \"field\"\n\t})), timestampNowRuntimeGenerator()];\n}\nconst sqliteRuntimeAdapterDescriptor = {\n\t...sqliteAdapterDescriptorMeta,\n\tcodecs: () => Array.from(sqliteCodecDescriptorRegistry.values()),\n\tmutationDefaultGenerators: createSqliteMutationDefaultGenerators,\n\trawCodecInferer: sqliteRawCodecInferer,\n\tcreate(stack) {\n\t\treturn createSqliteAdapterWithCodecRegistry(assembleSqliteCodecRegistry(stack.target, stack.extensions));\n\t}\n};\n//#endregion\nexport { sqliteRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,wCAAwC;CAChD,OAAO,CAAC,GAAG,oBAAoB,KAAK,QAAQ;EAC3C;EACA,WAAW,WAAW;GACrB,OAAO,WAAW,SAAS;IAC1B;IACA;GACD,IAAI,EAAE,GAAG,CAAC;EACX;EACA,WAAW;CACZ,EAAE,GAAG,6BAA6B,CAAC;AACpC;AACA,MAAM,iCAAiC;CACtC,GAAG;CACH,cAAc,MAAM,KAAK,8BAA8B,OAAO,CAAC;CAC/D,2BAA2B;CAC3B,iBAAiB;CACjB,OAAO,OAAO;EACb,OAAO,qCAAqC,4BAA4B,MAAM,QAAQ,MAAM,UAAU,CAAC;CACxG;AACD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { r as renderLoweredSql } from "./adapter-DEYUC-KO-
|
|
2
|
-
import "./sql-renderer-
|
|
1
|
+
import { r as renderLoweredSql } from "./adapter-DEYUC-KO-CidoiIE8.mjs";
|
|
2
|
+
import "./sql-renderer-BoOq3nw3.mjs";
|
|
3
3
|
export { renderLoweredSql };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { s as renderLoweredSql } from "./adapter-_MnQpUc6-
|
|
1
|
+
import { s as renderLoweredSql } from "./adapter-_MnQpUc6-BE7Ek23z.mjs";
|
|
2
2
|
export { renderLoweredSql };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as SqliteLoweredStatement, n as SqliteCodecRegistry, r as SqliteContract, t as SqliteAdapterOptions } from "./types-C5FSREvo-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { i as SqliteLoweredStatement, n as SqliteCodecRegistry, r as SqliteContract, t as SqliteAdapterOptions } from "./types-C5FSREvo-D12bNrqS.mjs";
|
|
2
|
+
import "./types-Bom9kmaX.mjs";
|
|
3
3
|
export type { SqliteAdapterOptions, SqliteCodecRegistry, SqliteContract, SqliteLoweredStatement };
|
|
@@ -100,7 +100,7 @@ const sqliteAggregateDescriptors = [
|
|
|
100
100
|
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID
|
|
101
101
|
},
|
|
102
102
|
nullable: false,
|
|
103
|
-
emptyResultJson: 0,
|
|
103
|
+
emptyResultJson: "0",
|
|
104
104
|
lower: castResultToText("count")
|
|
105
105
|
},
|
|
106
106
|
{
|
|
@@ -124,4 +124,4 @@ const sqliteAggregateDescriptors = [
|
|
|
124
124
|
//#endregion
|
|
125
125
|
export { sqliteAggregateDescriptors as t };
|
|
126
126
|
|
|
127
|
-
//# sourceMappingURL=aggregates-
|
|
127
|
+
//# sourceMappingURL=aggregates-CATLYJxc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregates-
|
|
1
|
+
{"version":3,"file":"aggregates-CATLYJxc.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/aggregates.mjs"],"sourcesContent":["import { a as SQLITE_INTEGER_CODEC_ID, d as SQL_INT_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, u as SQL_FLOAT_CODEC_ID } from \"./codec-ids-KMliSCRp.mjs\";\nimport { AggregateExpr, CastExpr } from \"@internal/sql-relational-core/ast\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/aggregates.ts\nconst overCodec = (codecId) => ({\n\tkind: \"codec\",\n\tcodecId\n});\nconst overTrait = (trait) => ({\n\tkind: \"trait\",\n\ttrait\n});\n/** An aggregate whose result is one of the input values, so it carries the input's codec. */\nconst preservesInput = (operation, input) => ({\n\toperation,\n\tinput,\n\toutput: { kind: \"self\" },\n\tnullable: true\n});\n/**\n* Render the aggregate as text.\n*\n* SQLite computes an aggregate into an INTEGER, and the driver reads an integer\n* no JS number can hold as an error rather than a value — so an aggregate whose\n* result is a wide integer leaves the database through this cast, which is the\n* form both integer codecs read anyway. The hook builds the expression and\n* nothing else: which codec the result carries is the descriptor's `output` to\n* declare, not this function's to choose.\n*\n* The `operation` it names is the SQL aggregate the row computes with — its own\n* name for a bare operation, its bare namesake's for a lossless variant, whose\n* name the database does not know.\n*/\nconst castResultToText = (operation) => ({ expr }) => CastExpr.as(new AggregateExpr(operation, expr), \"text\");\n/** The integer results wider than the driver's numeric reads: one read exactly, one read as a `number` and guarded against the safe range. Both leave the database as text. */\nconst WIDE_INTEGER_CODECS = [SQLITE_BIGINT_CODEC_ID, SQLITE_BIGINT_NUMBER_CODEC_ID];\n/** An aggregate whose result is a new value, named by codec and without the input's type parameters. */\nconst produces = (operation, input, codecId) => ({\n\toperation,\n\tinput,\n\toutput: {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t},\n\tnullable: true,\n\t...ifDefined(\"lower\", WIDE_INTEGER_CODECS.includes(codecId) ? castResultToText(operation) : void 0)\n});\n/** The same, for a lossless variant: an operation whose name the SQL alphabet does not carry, so its lowering names the aggregate it computes with. */\nconst producesVia = (operation, input, codecId, lower) => ({\n\toperation,\n\tinput,\n\toutput: {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t},\n\tnullable: true,\n\tlower\n});\n/** Codecs stored as SQLite integers. Their `sum` is an integer of up to 64 bits — past `sqlite/integer@1`'s range, and past the safe-integer range too, since a total of safe-range values is free to leave it. The bare form therefore guards and the lossless one carries. */\nconst INTEGER_CODECS = [\n\tSQLITE_INTEGER_CODEC_ID,\n\tSQLITE_BIGINT_CODEC_ID,\n\tSQLITE_BIGINT_NUMBER_CODEC_ID,\n\tSQL_INT_CODEC_ID\n];\n/** Codecs stored as SQLite reals. Their `sum` stays real. */\nconst REAL_CODECS = [SQLITE_REAL_CODEC_ID, SQL_FLOAT_CODEC_ID];\n/**\n* Codecs whose `min`/`max` returns the input value and whose traits do not already say so: SQLite compares blobs bytewise and text by its collation, so a datetime, a JSON document, and a blob each have a well-defined least and greatest — unlike the numeric and textual codecs, whose traits carry them.\n*/\nconst MIN_MAX_PRESERVING_CODECS = [\n\tSQLITE_DATETIME_CODEC_ID,\n\tSQLITE_JSON_CODEC_ID,\n\tSQLITE_BLOB_CODEC_ID\n];\nconst orderingDescriptors = (operation) => [\n\tpreservesInput(operation, overTrait(\"numeric\")),\n\tpreservesInput(operation, overTrait(\"textual\")),\n\t...MIN_MAX_PRESERVING_CODECS.map((codecId) => preservesInput(operation, overCodec(codecId))),\n\t{\n\t\toperation,\n\t\tinput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID\n\t\t},\n\t\toutput: { kind: \"self\" },\n\t\tnullable: true,\n\t\tlower: castResultToText(operation)\n\t}\n];\n/**\n* Every aggregate overload the SQLite target contributes. The adapter lists these on `types.aggregateDescriptors`, from where emission derives result types and the runtime builds its resolution registry.\n*/\nconst sqliteAggregateDescriptors = [\n\t{\n\t\toperation: \"count\",\n\t\tinput: { kind: \"any\" },\n\t\toutput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: SQLITE_BIGINT_NUMBER_CODEC_ID\n\t\t},\n\t\tnullable: false,\n\t\temptyResultJson: \"0\",\n\t\tlower: castResultToText(\"count\")\n\t},\n\t{\n\t\toperation: \"countBigInt\",\n\t\tinput: { kind: \"any\" },\n\t\toutput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID\n\t\t},\n\t\tnullable: false,\n\t\temptyResultJson: \"0\",\n\t\tlower: castResultToText(\"count\")\n\t},\n\t...INTEGER_CODECS.map((codecId) => produces(\"sum\", overCodec(codecId), SQLITE_BIGINT_NUMBER_CODEC_ID)),\n\t...INTEGER_CODECS.map((codecId) => producesVia(\"sumBigInt\", overCodec(codecId), SQLITE_BIGINT_CODEC_ID, castResultToText(\"sum\"))),\n\t...REAL_CODECS.map((codecId) => produces(\"sum\", overCodec(codecId), SQLITE_REAL_CODEC_ID)),\n\t...[...INTEGER_CODECS, ...REAL_CODECS].map((codecId) => produces(\"avg\", overCodec(codecId), SQLITE_REAL_CODEC_ID)),\n\t...orderingDescriptors(\"min\"),\n\t...orderingDescriptors(\"max\")\n];\n//#endregion\nexport { sqliteAggregateDescriptors };\n\n//# sourceMappingURL=aggregates.mjs.map"],"mappings":";;;;AAIA,MAAM,aAAa,aAAa;CAC/B,MAAM;CACN;AACD;AACA,MAAM,aAAa,WAAW;CAC7B,MAAM;CACN;AACD;;AAEA,MAAM,kBAAkB,WAAW,WAAW;CAC7C;CACA;CACA,QAAQ,EAAE,MAAM,OAAO;CACvB,UAAU;AACX;;;;;;;;;;;;;;;AAeA,MAAM,oBAAoB,eAAe,EAAE,WAAW,SAAS,GAAG,IAAI,cAAc,WAAW,IAAI,GAAG,M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,CAAC,CAAC;CAChI,GAAG,YAAY,KAAK,YAAY,SAAS,OAAO,UAAU,OAAO,GAAG,oBAAoB,CAAC;CACzF,GAAG,CAAC,GAAG,gBAAgB,GAAG,WAAW,CAAC,CAAC,KAAK,YAAY,SAAS,OAAO,UAAU,OAAO,GAAG,oBAAoB,CAAC;CACjH,GAAG,oBAAoB,KAAK;CAC5B,GAAG,oBAAoB,KAAK;AAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codec-descriptor-BNC9tDro-BPWBITSr.mjs";
|
package/dist/{codec-descriptor-BcgD9f3L-yDi5nh_k.d.mts → codec-descriptor-BNC9tDro-BPWBITSr.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
2
|
-
import { AnyCodecDescriptor, CodecDescriptor, CodecDescriptorImpl, CodecRef } from "@prisma/orm-framework/components/codec";
|
|
3
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codec-descriptor-
|
|
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-BNC9tDro.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 {
|
|
@@ -13,12 +13,14 @@ declare abstract class SqliteCodecDescriptor<P = void> extends CodecDescriptorIm
|
|
|
13
13
|
projectJson(expression: ProjectionExpr, ref: CodecRef): ProjectionExpr;
|
|
14
14
|
private validateParams;
|
|
15
15
|
}
|
|
16
|
-
type DescriptorParams<D extends
|
|
16
|
+
type DescriptorParams<D extends AnyCodecDescriptorTemplate> = D extends CodecDescriptorTemplate<infer P> ? P : never;
|
|
17
17
|
interface SqliteCodecOptions<P> {
|
|
18
|
+
/** The data type the adapted codec represents here. A template names none; this target does. */
|
|
19
|
+
readonly dataType: DataTypeId;
|
|
18
20
|
readonly jsonProjection: (expression: ProjectionExpr, params: P) => ProjectionExpr;
|
|
19
21
|
}
|
|
20
|
-
type AdaptedSqliteCodecDescriptor<D extends
|
|
21
|
-
declare function sqliteCodec<D extends
|
|
22
|
+
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>;
|
|
22
24
|
declare function defineSqliteCodecs<const Descriptors extends readonly AnySqliteCodecDescriptor[]>(descriptors: Descriptors): Descriptors;
|
|
23
25
|
declare function isSqliteCodecDescriptor(value: unknown): value is AnySqliteCodecDescriptor;
|
|
24
26
|
interface SqliteCodecDescriptorRegistry {
|
|
@@ -28,4 +30,4 @@ interface SqliteCodecDescriptorRegistry {
|
|
|
28
30
|
declare function buildSqliteCodecDescriptorRegistry(descriptors: ReadonlyArray<unknown>): SqliteCodecDescriptorRegistry;
|
|
29
31
|
//#endregion
|
|
30
32
|
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 };
|
|
31
|
-
//# sourceMappingURL=codec-descriptor-
|
|
33
|
+
//# sourceMappingURL=codec-descriptor-BNC9tDro-BPWBITSr.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-descriptor-BNC9tDro-BPWBITSr.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codec-descriptor-BNC9tDro.d.mts"],"mappings":";;;;cAGc;UACJ,iCAAiC;WAChC,uBAAuB;EAChC,YAAY,YAAY,gBAAgB,KAAK,WAAW;;uBAEnC,sBAAsB,kBAAkB,oBAAoB,cAAc;WACtF;qBACU,eAAe,YAAY,gBAAgB,QAAQ,IAAI;EAC1E,YAAY,YAAY,gBAAgB,KAAK,WAAW;UAChD;;KAEL,iBAAiB,UAAU,8BAA8B,UAAU,8BAA8B,KAAK;UACjG,mBAAmB;;WAElB,UAAU;WACV,iBAAiB,YAAY,gBAAgB,QAAQ,MAAM;;KAEjE,6BAA6B,UAAU,8BAA8B,KAAK,SAAS,wBAAwB,iBAAiB,OAAO,KAAK,+BAA+B,KAAK;iBAChK,YAAY,UAAU,4BAA4B,YAAY,GAAG,SAAS,mBAAmB,iBAAiB,MAAM,6BAA6B;iBACjJ,yBAAyB,6BAA6B,4BAA4B,aAAa,cAAc;iBAC7G,wBAAwB,iBAAiB,SAAS;UACzD;EACR,cAAc,kBAAkB;EAChC,UAAU,iBAAiB;;iBAEZ,mCAAmC,aAAa,yBAAyB"}
|
package/dist/{codec-descriptor-B9ru99aI-DTkdKFU5.mjs → codec-descriptor-iBsfn3Ib-Chscaqnm.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CodecDescriptorImpl, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
2
|
-
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
|
-
|
|
3
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codec-descriptor-iBsfn3Ib.mjs
|
|
5
5
|
const SQLITE_CODEC_DESCRIPTOR_KIND = "sqlite-codec";
|
|
6
6
|
var SqliteCodecDescriptor = class extends CodecDescriptorImpl {
|
|
7
7
|
descriptorKind = SQLITE_CODEC_DESCRIPTOR_KIND;
|
|
@@ -20,6 +20,7 @@ var SqliteCodecDescriptor = class extends CodecDescriptorImpl {
|
|
|
20
20
|
var SqliteCodecDescriptorAdapter = class extends SqliteCodecDescriptor {
|
|
21
21
|
descriptor;
|
|
22
22
|
options;
|
|
23
|
+
dataType;
|
|
23
24
|
codecId;
|
|
24
25
|
traits;
|
|
25
26
|
targetTypes;
|
|
@@ -31,6 +32,7 @@ var SqliteCodecDescriptorAdapter = class extends SqliteCodecDescriptor {
|
|
|
31
32
|
super();
|
|
32
33
|
this.descriptor = descriptor;
|
|
33
34
|
this.options = options;
|
|
35
|
+
this.dataType = options.dataType;
|
|
34
36
|
this.codecId = descriptor.codecId;
|
|
35
37
|
this.traits = descriptor.traits;
|
|
36
38
|
this.targetTypes = descriptor.targetTypes;
|
|
@@ -104,4 +106,4 @@ function candidateCodecId(value) {
|
|
|
104
106
|
//#endregion
|
|
105
107
|
export { sqliteCodec as a, isSqliteCodecDescriptor as i, buildSqliteCodecDescriptorRegistry as n, defineSqliteCodecs as r, SqliteCodecDescriptor as t };
|
|
106
108
|
|
|
107
|
-
//# sourceMappingURL=codec-descriptor-
|
|
109
|
+
//# sourceMappingURL=codec-descriptor-iBsfn3Ib-Chscaqnm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-descriptor-iBsfn3Ib-Chscaqnm.mjs","names":["#descriptors"],"sources":["../../../../3-targets/3-targets/sqlite/dist/codec-descriptor-iBsfn3Ib.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.descriptor.factory(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 && 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-iBsfn3Ib.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,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Aa,aAAa,SAAS,OAAO,MAAM,YAAY,cAAc,iBAAiB,SAAS,OAAO,MAAM,gBAAgB;AAC70B;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-BP_jt4cV.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as AdaptedSqliteCodecDescriptor } from "./codec-descriptor-
|
|
2
|
-
import "./codec-descriptor-
|
|
3
|
-
import { a as SqliteDatetimeDescriptor, c as SqliteRealDescriptor, i as SqliteBlobDescriptor, l as SqliteTextDescriptor, n as SqliteBigintDescriptor, o as SqliteIntegerDescriptor, r as SqliteBigintNumberDescriptor, s as SqliteJsonDescriptor } from "./codecs-
|
|
1
|
+
import { t as AdaptedSqliteCodecDescriptor } from "./codec-descriptor-BNC9tDro-BPWBITSr.mjs";
|
|
2
|
+
import "./codec-descriptor-4BIWMlhf-CjIjnr76.mjs";
|
|
3
|
+
import { a as SqliteDatetimeDescriptor, c as SqliteRealDescriptor, i as SqliteBlobDescriptor, l as SqliteTextDescriptor, n as SqliteBigintDescriptor, o as SqliteIntegerDescriptor, r as SqliteBigintNumberDescriptor, s as SqliteJsonDescriptor } from "./codecs-Ke2zEuU2-B8ego8w-.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-BmdALTGe.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-BmdALTGe-CH015gsn.d.mts.map
|
package/dist/{codec-types-D7uWRvQ1-DPnvquS8.d.mts.map → codec-types-BmdALTGe-CH015gsn.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-types-
|
|
1
|
+
{"version":3,"file":"codec-types-BmdALTGe-CH015gsn.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codec-types-BmdALTGe.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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codecs-Ke2zEuU2-B8ego8w-.mjs";
|
|
@@ -1,8 +1,9 @@
|
|
|
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, n as buildSqliteCodecDescriptorRegistry, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-
|
|
2
|
+
import { a as sqliteCodec, n as buildSqliteCodecDescriptorRegistry, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-iBsfn3Ib-Chscaqnm.mjs";
|
|
3
|
+
import { a as sqliteInteger, c as sqliteText, i as sqliteDatetime, n as sqliteBlob, o as sqliteJson, s as sqliteReal, t as sqliteBigint } from "./data-types-BOA80gRp-DV5kY9es.mjs";
|
|
3
4
|
import { n as sqliteError } from "./errors-DnR-sMHS-KkMLIP2U.mjs";
|
|
4
5
|
import { CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
-
import { CodecImpl, column,
|
|
6
|
+
import { CodecImpl, column, voidParamsSchema } from "@prisma/orm-framework/components/codec";
|
|
6
7
|
import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
|
|
7
8
|
//#region ../../../3-targets/3-targets/sqlite/dist/codecs.mjs
|
|
8
9
|
/**
|
|
@@ -25,21 +26,6 @@ const identityJsonProjection = (expression) => expression;
|
|
|
25
26
|
*/
|
|
26
27
|
const decimalTextJsonProjection = (expression) => CastExpr.as(expression, "TEXT");
|
|
27
28
|
/**
|
|
28
|
-
* Projects an integer-valued expression as a JSON number.
|
|
29
|
-
*
|
|
30
|
-
* The JSON constructor renders whatever it is handed, so the canonical form
|
|
31
|
-
* depends on the storage class the expression carries — and an aggregate whose
|
|
32
|
-
* result this codec reads arrives here already cast to text, the form that
|
|
33
|
-
* keeps a wide integer off the driver's numeric reads. The cast returns the
|
|
34
|
-
* value to the INTEGER class, where the constructor emits its digits; over a
|
|
35
|
-
* stored INTEGER it changes nothing.
|
|
36
|
-
*
|
|
37
|
-
* Digits past the safe integer range survive into the JSON text, so a value
|
|
38
|
-
* that cannot be a `number` rounds in `JSON.parse` and the codec's own guard
|
|
39
|
-
* refuses it rather than answering with the value that lost them.
|
|
40
|
-
*/
|
|
41
|
-
const integerJsonProjection = (expression) => CastExpr.as(expression, "INTEGER");
|
|
42
|
-
/**
|
|
43
29
|
* Projects a BLOB as hexadecimal text.
|
|
44
30
|
*
|
|
45
31
|
* SQLite's JSON functions reject a BLOB argument outright, so the encoding has
|
|
@@ -82,6 +68,8 @@ const jsonDocumentRetag = (expression) => isJsonRetag(expression) ? expression :
|
|
|
82
68
|
const isJsonRetag = (expression) => expression instanceof FunctionCallExpr && expression.fn === JSON_RETAG_FN && expression.args.length === 1;
|
|
83
69
|
const DECIMAL_INTEGER = /^-?\d+$/;
|
|
84
70
|
const UPPERCASE_HEX = /^(?:[0-9A-F]{2})*$/;
|
|
71
|
+
/** Renders the decimal text `sqlite/bigintnumber@1` carries, whose application type is `number`, as a number literal. */
|
|
72
|
+
const decimalTextNumberLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? value : void 0;
|
|
85
73
|
/**
|
|
86
74
|
* JSON has no spelling for an infinity or a NaN, and SQLite renders one as
|
|
87
75
|
* `9.0e+999`, which reads back as `Infinity` rather than failing. A real is
|
|
@@ -162,10 +150,22 @@ const safeIntegerFromBigint = (value) => {
|
|
|
162
150
|
} });
|
|
163
151
|
return Number(value);
|
|
164
152
|
};
|
|
165
|
-
const sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
153
|
+
const sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, {
|
|
154
|
+
dataType: sqliteText.id,
|
|
155
|
+
jsonProjection: identityJsonProjection
|
|
156
|
+
});
|
|
157
|
+
const sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, {
|
|
158
|
+
dataType: sqliteText.id,
|
|
159
|
+
jsonProjection: identityJsonProjection
|
|
160
|
+
});
|
|
161
|
+
const sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, {
|
|
162
|
+
dataType: sqliteInteger.id,
|
|
163
|
+
jsonProjection: identityJsonProjection
|
|
164
|
+
});
|
|
165
|
+
const sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, {
|
|
166
|
+
dataType: sqliteReal.id,
|
|
167
|
+
jsonProjection: identityJsonProjection
|
|
168
|
+
});
|
|
169
169
|
var SqliteTextCodec = class extends CodecImpl {
|
|
170
170
|
async encode(value, _ctx) {
|
|
171
171
|
return value;
|
|
@@ -184,6 +184,7 @@ var SqliteTextDescriptor = class extends SqliteCodecDescriptor {
|
|
|
184
184
|
jsonProjection(expression) {
|
|
185
185
|
return expression;
|
|
186
186
|
}
|
|
187
|
+
dataType = sqliteText.id;
|
|
187
188
|
codecId = SQLITE_TEXT_CODEC_ID;
|
|
188
189
|
traits = [
|
|
189
190
|
"equality",
|
|
@@ -209,6 +210,14 @@ var SqliteIntegerCodec = class extends CodecImpl {
|
|
|
209
210
|
return value;
|
|
210
211
|
}
|
|
211
212
|
decodeJson(json) {
|
|
213
|
+
if (typeof json !== "number") throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/integer@1 database JSON value must be a number", { meta: {
|
|
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
|
+
} });
|
|
212
221
|
return json;
|
|
213
222
|
}
|
|
214
223
|
};
|
|
@@ -216,6 +225,7 @@ var SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {
|
|
|
216
225
|
jsonProjection(expression) {
|
|
217
226
|
return expression;
|
|
218
227
|
}
|
|
228
|
+
dataType = sqliteInteger.id;
|
|
219
229
|
codecId = SQLITE_INTEGER_CODEC_ID;
|
|
220
230
|
traits = [
|
|
221
231
|
"equality",
|
|
@@ -252,6 +262,7 @@ var SqliteRealDescriptor = class extends SqliteCodecDescriptor {
|
|
|
252
262
|
jsonProjection(expression) {
|
|
253
263
|
return expression;
|
|
254
264
|
}
|
|
265
|
+
dataType = sqliteReal.id;
|
|
255
266
|
codecId = SQLITE_REAL_CODEC_ID;
|
|
256
267
|
traits = [
|
|
257
268
|
"equality",
|
|
@@ -288,6 +299,7 @@ var SqliteBlobDescriptor = class extends SqliteCodecDescriptor {
|
|
|
288
299
|
jsonProjection(expression) {
|
|
289
300
|
return hexJsonProjection(expression);
|
|
290
301
|
}
|
|
302
|
+
dataType = sqliteBlob.id;
|
|
291
303
|
codecId = SQLITE_BLOB_CODEC_ID;
|
|
292
304
|
traits = ["equality"];
|
|
293
305
|
targetTypes = ["blob"];
|
|
@@ -328,6 +340,7 @@ var SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {
|
|
|
328
340
|
jsonProjection(expression) {
|
|
329
341
|
return expression;
|
|
330
342
|
}
|
|
343
|
+
dataType = sqliteDatetime.id;
|
|
331
344
|
codecId = SQLITE_DATETIME_CODEC_ID;
|
|
332
345
|
traits = ["equality", "order"];
|
|
333
346
|
targetTypes = ["text"];
|
|
@@ -356,6 +369,7 @@ var SqliteJsonDescriptor = class extends SqliteCodecDescriptor {
|
|
|
356
369
|
jsonProjection(expression) {
|
|
357
370
|
return jsonDocumentRetag(expression);
|
|
358
371
|
}
|
|
372
|
+
dataType = sqliteJson.id;
|
|
359
373
|
codecId = SQLITE_JSON_CODEC_ID;
|
|
360
374
|
traits = ["equality"];
|
|
361
375
|
targetTypes = ["text"];
|
|
@@ -405,6 +419,7 @@ var SqliteBigintDescriptor = class extends SqliteCodecDescriptor {
|
|
|
405
419
|
jsonProjection(expression) {
|
|
406
420
|
return decimalTextJsonProjection(expression);
|
|
407
421
|
}
|
|
422
|
+
dataType = sqliteBigint.id;
|
|
408
423
|
codecId = SQLITE_BIGINT_CODEC_ID;
|
|
409
424
|
traits = [
|
|
410
425
|
"equality",
|
|
@@ -423,10 +438,10 @@ const sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqlite
|
|
|
423
438
|
* A SQLite INTEGER decoded as a JS `number`, for columns whose values stay
|
|
424
439
|
* within the safe integer range ±(2^53 − 1). Both directions guard rather than
|
|
425
440
|
* round: decode (wire and JSON) and encode throw a structured error on
|
|
426
|
-
* out-of-range or non-integral input. The canonical JSON is
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
441
|
+
* out-of-range or non-integral input. The canonical JSON is the decimal text
|
|
442
|
+
* `sqlite/bigint` carries, which every codec of that data type shares. The
|
|
443
|
+
* descriptor claims no target type, so `integer` in type position keeps its
|
|
444
|
+
* current codecs.
|
|
430
445
|
*/
|
|
431
446
|
var SqliteBigintNumberCodec = class extends CodecImpl {
|
|
432
447
|
async encode(value, _ctx) {
|
|
@@ -446,20 +461,21 @@ var SqliteBigintNumberCodec = class extends CodecImpl {
|
|
|
446
461
|
return safeIntegerFromBigint(BigInt(wire));
|
|
447
462
|
}
|
|
448
463
|
encodeJson(value) {
|
|
449
|
-
return encodableSafeInteger(value);
|
|
464
|
+
return String(encodableSafeInteger(value));
|
|
450
465
|
}
|
|
451
466
|
decodeJson(json) {
|
|
452
|
-
if (typeof json !== "
|
|
467
|
+
if (typeof json !== "string" || !DECIMAL_INTEGER.test(json)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/bigintnumber@1 database JSON value must be decimal text", { meta: {
|
|
453
468
|
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
454
469
|
received: typeof json
|
|
455
470
|
} });
|
|
456
|
-
return
|
|
471
|
+
return safeIntegerFromBigint(BigInt(json));
|
|
457
472
|
}
|
|
458
473
|
};
|
|
459
474
|
var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
|
|
460
475
|
jsonProjection(expression) {
|
|
461
|
-
return
|
|
476
|
+
return decimalTextJsonProjection(expression);
|
|
462
477
|
}
|
|
478
|
+
dataType = sqliteBigint.id;
|
|
463
479
|
codecId = SQLITE_BIGINT_NUMBER_CODEC_ID;
|
|
464
480
|
traits = [
|
|
465
481
|
"equality",
|
|
@@ -469,7 +485,7 @@ var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
|
|
|
469
485
|
targetTypes = [];
|
|
470
486
|
paramsSchema = voidParamsSchema;
|
|
471
487
|
renderValueLiteral(value) {
|
|
472
|
-
return
|
|
488
|
+
return decimalTextNumberLiteral(value);
|
|
473
489
|
}
|
|
474
490
|
factory() {
|
|
475
491
|
return () => new SqliteBigintNumberCodec(this);
|
|
@@ -501,4 +517,4 @@ const sqliteCodecDescriptorRegistry = buildSqliteCodecDescriptorRegistry(codecDe
|
|
|
501
517
|
//#endregion
|
|
502
518
|
export { sqliteCodecDescriptorRegistry as a, sqliteIntegerColumn as c, sqliteTextColumn as d, sqliteBlobColumn as i, sqliteJsonColumn as l, sqliteBigintColumn as n, sqliteCodecRegistry as o, sqliteBigintNumberColumn as r, sqliteDatetimeColumn as s, jsonDocumentRetag as t, sqliteRealColumn as u };
|
|
503
519
|
|
|
504
|
-
//# sourceMappingURL=codecs-
|
|
520
|
+
//# sourceMappingURL=codecs-DpMoJnXK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-DpMoJnXK.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs.mjs"],"sourcesContent":["import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BIGINT_NUMBER_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from \"./codec-ids-KMliSCRp.mjs\";\nimport { a as sqliteInteger, c as sqliteText, i as sqliteDatetime, n as sqliteBlob, o as sqliteJson, s as sqliteReal, t as sqliteBigint } from \"./data-types-BOA80gRp.mjs\";\nimport { a as sqliteCodec, n as buildSqliteCodecDescriptorRegistry, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from \"./codec-descriptor-iBsfn3Ib.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, voidParamsSchema } from \"@internal/framework-components/codec\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\n//#region src/core/codecs.ts\n/**\n* Projects the expression unchanged, for codecs whose canonical JSON is what\n* SQLite's own JSON conversion already produces.\n*\n* Identity here is a claim about the target's behaviour, not an absence of one:\n* the codec's conformance cases are what test it, including at the boundaries\n* of the representation where a native conversion would be most likely to\n* diverge.\n*/\nconst identityJsonProjection = (expression) => expression;\n/**\n* Projects an integer-valued expression as decimal text.\n*\n* The cast is part of the projected expression, so it applies before the JSON\n* constructor sees the value: handed an INTEGER directly, the constructor emits\n* a JSON number, and SQLite's 64-bit range does not survive being read back as\n* a double. Casting the constructor's result would be too late.\n*/\nconst decimalTextJsonProjection = (expression) => CastExpr.as(expression, \"TEXT\");\n/**\n* Projects a BLOB as hexadecimal text.\n*\n* SQLite's JSON functions reject a BLOB argument outright, so the encoding has\n* to replace the native conversion rather than post-process it. `hex()` emits\n* uppercase and never wraps at any length, which is the spelling `encodeJson`\n* pins.\n*\n* `hex(NULL)` is `''` rather than NULL, and `''` is the hex of an empty blob —\n* so without the NULL check an absent blob and an empty one would both project\n* as `''`, and `decodeJson` accepts `''` because zero hex pairs is a valid\n* empty blob. The check keeps the two distinguishable.\n*/\nconst hexJsonProjection = (expression) => CaseExpr.of([{\n\tcondition: NullCheckExpr.isNull(expression),\n\tvalue: LiteralExpr.of(null)\n}], FunctionCallExpr.of(\"hex\", [expression]));\nconst JSON_RETAG_FN = \"json\";\n/**\n* Re-applies SQLite's JSON subtype to a document-valued expression.\n*\n* SQLite carries \"this text is JSON\" as a subtype on the value rather than in\n* its type, and the subtype does not survive a derived table: a document that\n* `json_object` produced arrives one level out as plain text, so the enclosing\n* constructor embeds it as a *string containing JSON* rather than as a\n* document. `json()` re-applies the subtype, which is what makes the value nest\n* as a document again.\n*\n* The loss happens at the first derived-table boundary and does not compound, so\n* a retag is needed where the document is consumed rather than at every level it\n* passes through.\n*\n* Applying this twice is a no-op — SQLite's `json()` is idempotent, and the\n* wrapper collapses rather than nesting so the rendered SQL says so too. It is\n* safe on any valid JSON text, including scalars, and on NULL; it raises\n* `malformed JSON` on text that is not JSON, which is the correct failure for a\n* value that was never a document.\n*/\nconst jsonDocumentRetag = (expression) => isJsonRetag(expression) ? expression : FunctionCallExpr.of(JSON_RETAG_FN, [expression]);\n/** Whether an expression is already a retag, so applying one again would only nest. */\nconst isJsonRetag = (expression) => expression instanceof FunctionCallExpr && expression.fn === JSON_RETAG_FN && expression.args.length === 1;\nconst DECIMAL_INTEGER = /^-?\\d+$/;\nconst UPPERCASE_HEX = /^(?:[0-9A-F]{2})*$/;\n/** 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 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 = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteTextCodec(this);\n\t}\n};\nconst sqliteTextDescriptor = new SqliteTextDescriptor();\nconst sqliteTextColumn = () => column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, void 0, \"text\");\nvar SqliteIntegerCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\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 = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteIntegerCodec(this);\n\t}\n};\nconst sqliteIntegerDescriptor = new SqliteIntegerDescriptor();\nconst sqliteIntegerColumn = () => column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, void 0, \"integer\");\nvar SqliteRealCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tencodeJson(value) {\n\t\treturn finiteReal(value, \"RUNTIME.ENCODE_FAILED\");\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"number\") throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/real@1 database JSON value must be a number\", { meta: {\n\t\t\tcodecId: SQLITE_REAL_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn finiteReal(json, \"RUNTIME.DECODE_FAILED\");\n\t}\n};\nvar SqliteRealDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\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 = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteRealCodec(this);\n\t}\n};\nconst sqliteRealDescriptor = new SqliteRealDescriptor();\nconst sqliteRealColumn = () => column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, void 0, \"real\");\nvar SqliteBlobCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tencodeJson(value) {\n\t\treturn Buffer.from(value).toString(\"hex\").toUpperCase();\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"string\" || !UPPERCASE_HEX.test(json)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/blob@1 database JSON value must be uppercase hexadecimal text\", { meta: {\n\t\t\tcodecId: SQLITE_BLOB_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn new Uint8Array(Buffer.from(json, \"hex\"));\n\t}\n};\nvar SqliteBlobDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn hexJsonProjection(expression);\n\t}\n\tdataType = sqliteBlob.id;\n\tcodecId = SQLITE_BLOB_CODEC_ID;\n\ttraits = [\"equality\"];\n\ttargetTypes = [\"blob\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteBlobCodec(this);\n\t}\n};\nconst sqliteBlobDescriptor = new SqliteBlobDescriptor();\nconst sqliteBlobColumn = () => column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, void 0, \"blob\");\nvar SqliteDatetimeCodec = class extends CodecImpl {\n\tparseDate(value) {\n\t\tconst date = new Date(value);\n\t\tif (Number.isNaN(date.getTime())) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `sqlite/datetime@1 value must be a valid ISO-8601 string: ${value}`, { meta: {\n\t\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\t\treceived: value\n\t\t} });\n\t\treturn date;\n\t}\n\tasync encode(value, _ctx) {\n\t\treturn value.toISOString();\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn this.parseDate(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value.toISOString();\n\t}\n\tdecodeJson(json) {\n\t\tif (typeof json !== \"string\") throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/datetime@1 contract value must be an ISO-8601 string\", { meta: {\n\t\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn this.parseDate(json);\n\t}\n};\nvar SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tdataType = sqliteDatetime.id;\n\tcodecId = SQLITE_DATETIME_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteDatetimeCodec(this);\n\t}\n};\nconst sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();\nconst sqliteDatetimeColumn = () => column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, void 0, \"text\");\nvar SqliteJsonCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn JSON.stringify(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn typeof wire === \"string\" ? JSON.parse(wire) : wire;\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqliteJsonDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn jsonDocumentRetag(expression);\n\t}\n\tdataType = sqliteJson.id;\n\tcodecId = SQLITE_JSON_CODEC_ID;\n\ttraits = [\"equality\"];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteJsonCodec(this);\n\t}\n};\nconst sqliteJsonDescriptor = new SqliteJsonDescriptor();\nconst sqliteJsonColumn = () => column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, void 0, \"text\");\nvar SqliteBigintCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\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 = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqliteBigintCodec(this);\n\t}\n};\nconst sqliteBigintDescriptor = new SqliteBigintDescriptor();\nconst sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, void 0, \"integer\");\n/**\n* A SQLite INTEGER decoded as a JS `number`, for columns whose values stay\n* within the safe integer range ±(2^53 − 1). Both directions guard rather than\n* round: decode (wire and JSON) and encode throw a structured error on\n* out-of-range or non-integral input. The canonical JSON is 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 = voidParamsSchema;\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\n//#region src/core/registry.ts\n/**\n* Registry of every codec descriptor shipped by `@internal/target-sqlite`.\n*\n* Public consumer surface for the sqlite codec set: the sqlite adapter and any other consumer that needs to enumerate or look up a sqlite codec by id consumes this rather than the raw descriptor array. See ADR 208.\n*/\nconst sqliteCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);\nconst sqliteCodecDescriptorRegistry = buildSqliteCodecDescriptorRegistry(codecDescriptors);\n//#endregion\nexport { jsonDocumentRetag, sqliteBigintColumn, sqliteBigintNumberColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };\n\n//# sourceMappingURL=codecs.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;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,YAAY,MAAM,+CAA+C,EAAE,MAAM;EAC3G,SAAS;EACT,UAAU,OAAO,KAAK;CACvB,EAAE,CAAC;CACH,OAAO;AACR;AACA,MAAM,0BAA0B,OAAO,OAAO,gBAAgB;AAC9D,MAAM,0BAA0B,OAAO,OAAO,gBAAgB;;;;;;;;;AAS9D,MAAM,iBAAiB,SAAS,UAAU,UAAU;CACnD,IAAI,OAAO,UAAU,UAAU;CAC/B,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