@prisma/orm-target-sqlite 8.0.0-rc.14-dev.35 → 8.0.0-rc.14-dev.37

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.
Files changed (136) hide show
  1. package/dist/{adapter-Bp_4Bjff-Ce3oZAN1.d.mts → adapter-Bp_4Bjff-CjV5K6YY.d.mts} +3 -3
  2. package/dist/{adapter-Bp_4Bjff-Ce3oZAN1.d.mts.map → adapter-Bp_4Bjff-CjV5K6YY.d.mts.map} +1 -1
  3. package/dist/adapter-C1WN74k-.d.mts +2 -0
  4. package/dist/{adapter-DUwfMiE4-C-kTEDXO.mjs → adapter-Dvjudmph-Dvu8g0lW.mjs} +23 -7
  5. package/dist/adapter-Dvjudmph-Dvu8g0lW.mjs.map +1 -0
  6. package/dist/adapter.d.mts +10 -10
  7. package/dist/adapter.mjs +4 -4
  8. package/dist/adapter__adapter.d.mts +2 -2
  9. package/dist/adapter__adapter.mjs +1 -1
  10. package/dist/adapter__codec-types.d.mts +3 -3
  11. package/dist/adapter__column-types.d.mts +1 -1
  12. package/dist/adapter__column-types.mjs +1 -1
  13. package/dist/adapter__control.d.mts +2 -2
  14. package/dist/adapter__control.mjs +5 -5
  15. package/dist/adapter__control.mjs.map +1 -1
  16. package/dist/adapter__runtime.d.mts +1 -1
  17. package/dist/adapter__runtime.mjs +3 -3
  18. package/dist/adapter__runtime.mjs.map +1 -1
  19. package/dist/adapter__sql-renderer.d.mts +2 -2
  20. package/dist/adapter__sql-renderer.mjs +1 -1
  21. package/dist/adapter__types.d.mts +2 -2
  22. package/dist/{codec-descriptor-BX2XRz4V-DxUIN3j3.mjs → codec-descriptor-Bf6MlyeJ-C1PfQ9LO.mjs} +3 -3
  23. package/dist/{codec-descriptor-BX2XRz4V-DxUIN3j3.mjs.map → codec-descriptor-Bf6MlyeJ-C1PfQ9LO.mjs.map} +1 -1
  24. package/dist/{codec-types-B_IhsOl9-WPSRXocH.d.mts → codec-types-0AMy_n05-BJvXpaEh.d.mts} +14 -4
  25. package/dist/codec-types-0AMy_n05-BJvXpaEh.d.mts.map +1 -0
  26. package/dist/codec-types-BV1uyhho.d.mts +1 -0
  27. package/dist/codec-types-CLFLW8jd.d.mts +2 -0
  28. package/dist/{codecs-DlI8SadA.mjs → codecs-ByvSFGut.mjs} +3 -3
  29. package/dist/{codecs-DlI8SadA.mjs.map → codecs-ByvSFGut.mjs.map} +1 -1
  30. package/dist/{codecs-r7gY3BuR-B6lXeFyH.mjs → codecs-CaOcjLon-BZ4M7GfD.mjs} +119 -45
  31. package/dist/codecs-CaOcjLon-BZ4M7GfD.mjs.map +1 -0
  32. package/dist/{codecs-hLsmWJRa-DfMCx_nO.d.mts → codecs-DeFZ_0jC-CgA8KUIS.d.mts} +37 -28
  33. package/dist/codecs-DeFZ_0jC-CgA8KUIS.d.mts.map +1 -0
  34. package/dist/codecs-xDq4DNf8.d.mts +1 -0
  35. package/dist/column-types-CWeuNngG.mjs +13 -0
  36. package/dist/column-types-CWeuNngG.mjs.map +1 -0
  37. package/dist/{column-types-iWGuW-0W.d.mts → column-types-DzzwJf7V.d.mts} +1 -8
  38. package/dist/column-types-DzzwJf7V.d.mts.map +1 -0
  39. package/dist/{control-1rQ6mko7.mjs → control-4njwExvT.mjs} +2 -1
  40. package/dist/control-4njwExvT.mjs.map +1 -0
  41. package/dist/{control-CEsPGd0f.mjs → control-B6oLQvl-.mjs} +16 -9
  42. package/dist/{control-CEsPGd0f.mjs.map → control-B6oLQvl-.mjs.map} +1 -1
  43. package/dist/{control-DgI8tIaw.d.mts → control-wWiQrj5H.d.mts} +6 -5
  44. package/dist/{control-DgI8tIaw.d.mts.map → control-wWiQrj5H.d.mts.map} +1 -1
  45. package/dist/data-type-entries-Bc09V6WN-Dc00J0G9.mjs +57 -0
  46. package/dist/data-type-entries-Bc09V6WN-Dc00J0G9.mjs.map +1 -0
  47. package/dist/{data-types-ZsgBg_Zg.d.mts → data-types-B_k5-Ohy.d.mts} +4 -11
  48. package/dist/data-types-B_k5-Ohy.d.mts.map +1 -0
  49. package/dist/data-types-pFQMl37_-B-3aK_wd.mjs +73 -0
  50. package/dist/data-types-pFQMl37_-B-3aK_wd.mjs.map +1 -0
  51. package/dist/{default-normalizer-Czg-VtmN-DEbkGbn7.mjs → default-normalizer-Ch3VFnEH-C-h1XtlJ.mjs} +6 -6
  52. package/dist/default-normalizer-Ch3VFnEH-C-h1XtlJ.mjs.map +1 -0
  53. package/dist/{descriptor-meta-AG8POta2-D-k13ZOE.mjs → descriptor-meta-C3n4Dwxu-DJiDDku0.mjs} +5 -5
  54. package/dist/{descriptor-meta-AG8POta2-D-k13ZOE.mjs.map → descriptor-meta-C3n4Dwxu-DJiDDku0.mjs.map} +1 -1
  55. package/dist/{descriptor-meta-CFPBLIHW-BwigY92R.mjs → descriptor-meta-CFPBLIHW-I-y9R_fj.mjs} +2 -2
  56. package/dist/{descriptor-meta-CFPBLIHW-BwigY92R.mjs.map → descriptor-meta-CFPBLIHW-I-y9R_fj.mjs.map} +1 -1
  57. package/dist/{descriptor-meta-runtime-CIrdwmEr-3T3t3kjc.mjs → descriptor-meta-runtime-Dqtz58eJ-BJ4UjLXW.mjs} +3 -3
  58. package/dist/{descriptor-meta-runtime-CIrdwmEr-3T3t3kjc.mjs.map → descriptor-meta-runtime-Dqtz58eJ-BJ4UjLXW.mjs.map} +1 -1
  59. package/dist/driver.mjs +1 -1
  60. package/dist/driver__control.mjs +1 -1
  61. package/dist/{migration-LE8F9qcM.d.mts → migration-Ccuxti02.d.mts} +2 -2
  62. package/dist/{migration-LE8F9qcM.d.mts.map → migration-Ccuxti02.d.mts.map} +1 -1
  63. package/dist/{migration-BA5np0wx.mjs → migration-Di-URWbl.mjs} +2 -2
  64. package/dist/{migration-BA5np0wx.mjs.map → migration-Di-URWbl.mjs.map} +1 -1
  65. package/dist/{op-factory-call-V6Wu86U8-B1Y4idhr.mjs → op-factory-call-HHnPrspy-7shWKb03.mjs} +13 -9
  66. package/dist/op-factory-call-HHnPrspy-7shWKb03.mjs.map +1 -0
  67. package/dist/{pack-B1iD7wyf.d.mts → pack-BIZIGw3P.d.mts} +2 -2
  68. package/dist/{pack-B1iD7wyf.d.mts.map → pack-BIZIGw3P.d.mts.map} +1 -1
  69. package/dist/{planner-Cm5kqc7I-CKSYA8QU.mjs → planner-BgH57J9_-DZQSi5aj.mjs} +5 -5
  70. package/dist/{planner-Cm5kqc7I-CKSYA8QU.mjs.map → planner-BgH57J9_-DZQSi5aj.mjs.map} +1 -1
  71. package/dist/{planner-B37W4Kaw.d.mts → planner-CFIbY54l.d.mts} +2 -2
  72. package/dist/{planner-B37W4Kaw.d.mts.map → planner-CFIbY54l.d.mts.map} +1 -1
  73. package/dist/{planner-produced-sqlite-migration-C6t5lWDq-DXm-Vkhf.d.mts → planner-produced-sqlite-migration-DXcx0sOR-CcMQKE7n.d.mts} +3 -3
  74. package/dist/planner-produced-sqlite-migration-DXcx0sOR-CcMQKE7n.d.mts.map +1 -0
  75. package/dist/{planner-produced-sqlite-migration-DWsg0vgl-N6_jUi2G.mjs → planner-produced-sqlite-migration-Rsg1Udsi-DMyO7zT3.mjs} +3 -3
  76. package/dist/{planner-produced-sqlite-migration-DWsg0vgl-N6_jUi2G.mjs.map → planner-produced-sqlite-migration-Rsg1Udsi-DMyO7zT3.mjs.map} +1 -1
  77. package/dist/planner-produced-sqlite-migration-sYbbeyyS.d.mts +1 -0
  78. package/dist/{runtime-CG71EORy.d.mts → runtime-612DH-du.d.mts} +2 -2
  79. package/dist/{runtime-CG71EORy.d.mts.map → runtime-612DH-du.d.mts.map} +1 -1
  80. package/dist/{runtime-B99c4n56.d.mts → runtime-8_WfNAcA.d.mts} +2 -2
  81. package/dist/{runtime-B99c4n56.d.mts.map → runtime-8_WfNAcA.d.mts.map} +1 -1
  82. package/dist/sql-renderer-fyjZG1VX.d.mts +1 -0
  83. package/dist/{sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts → sqlite-contract-view-BDw8T5Cp-CbLVOPJq.d.mts} +5 -4
  84. package/dist/sqlite-contract-view-BDw8T5Cp-CbLVOPJq.d.mts.map +1 -0
  85. package/dist/{sqlite-migration-2IEGvjRm-BQfd6NLr.d.mts → sqlite-migration-BSUZhMDG-DZU3d7bZ.d.mts} +3 -3
  86. package/dist/{sqlite-migration-2IEGvjRm-BQfd6NLr.d.mts.map → sqlite-migration-BSUZhMDG-DZU3d7bZ.d.mts.map} +1 -1
  87. package/dist/{sqlite-migration-CindFauZ-BM2X6Ha3.mjs → sqlite-migration-CJFj4Xjj-Bkj6DFpZ.mjs} +12 -11
  88. package/dist/sqlite-migration-CJFj4Xjj-Bkj6DFpZ.mjs.map +1 -0
  89. package/dist/target.d.mts +14 -14
  90. package/dist/target.mjs +13 -13
  91. package/dist/target__codec-descriptor.mjs +1 -1
  92. package/dist/target__codec-types.d.mts +3 -3
  93. package/dist/target__codecs.d.mts +2 -2
  94. package/dist/target__codecs.mjs +2 -2
  95. package/dist/target__control.mjs +1 -1
  96. package/dist/target__data-types.d.mts +2 -2
  97. package/dist/target__data-types.mjs +3 -3
  98. package/dist/target__default-normalizer.mjs +1 -1
  99. package/dist/target__migration.d.mts +2 -2
  100. package/dist/target__migration.mjs +2 -2
  101. package/dist/target__op-factory-call.mjs +1 -1
  102. package/dist/target__pack.d.mts +1 -1
  103. package/dist/target__pack.mjs +1 -1
  104. package/dist/target__planner-produced-sqlite-migration.d.mts +2 -2
  105. package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
  106. package/dist/target__planner.d.mts +1 -1
  107. package/dist/target__planner.mjs +1 -1
  108. package/dist/target__runtime.d.mts +2 -2
  109. package/dist/target__runtime.mjs +1 -1
  110. package/dist/target__runtime.mjs.map +1 -1
  111. package/dist/{types-CJW_JAJf.d.mts → types-BwhTlH8P.d.mts} +1 -1
  112. package/package.json +9 -9
  113. package/dist/adapter-C-sqCgrP.d.mts +0 -2
  114. package/dist/adapter-DUwfMiE4-C-kTEDXO.mjs.map +0 -1
  115. package/dist/codec-types-BXwJkshK.d.mts +0 -2
  116. package/dist/codec-types-B_IhsOl9-WPSRXocH.d.mts.map +0 -1
  117. package/dist/codec-types-BhSj11Hl.d.mts +0 -1
  118. package/dist/codecs-DSZbU8RG.d.mts +0 -1
  119. package/dist/codecs-hLsmWJRa-DfMCx_nO.d.mts.map +0 -1
  120. package/dist/codecs-r7gY3BuR-B6lXeFyH.mjs.map +0 -1
  121. package/dist/column-types-NVxgsjFA.mjs +0 -34
  122. package/dist/column-types-NVxgsjFA.mjs.map +0 -1
  123. package/dist/column-types-iWGuW-0W.d.mts.map +0 -1
  124. package/dist/control-1rQ6mko7.mjs.map +0 -1
  125. package/dist/data-type-entries-CL0a2goH-BCEztwoX.mjs +0 -68
  126. package/dist/data-type-entries-CL0a2goH-BCEztwoX.mjs.map +0 -1
  127. package/dist/data-types-Bs4y7eZb-B00ws2B6.mjs +0 -111
  128. package/dist/data-types-Bs4y7eZb-B00ws2B6.mjs.map +0 -1
  129. package/dist/data-types-ZsgBg_Zg.d.mts.map +0 -1
  130. package/dist/default-normalizer-Czg-VtmN-DEbkGbn7.mjs.map +0 -1
  131. package/dist/op-factory-call-V6Wu86U8-B1Y4idhr.mjs.map +0 -1
  132. package/dist/planner-produced-sqlite-migration-C6t5lWDq-DXm-Vkhf.d.mts.map +0 -1
  133. package/dist/planner-produced-sqlite-migration-D7O3_r38.d.mts +0 -1
  134. package/dist/sql-renderer-eeiux6H6.d.mts +0 -1
  135. package/dist/sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts.map +0 -1
  136. package/dist/sqlite-migration-CindFauZ-BM2X6Ha3.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { n as buildSqliteCodecDescriptorRegistry } from "./codec-descriptor-BX2XRz4V-DxUIN3j3.mjs";
2
- import { t as codecDescriptors } from "./codecs-r7gY3BuR-B6lXeFyH.mjs";
1
+ import { n as buildSqliteCodecDescriptorRegistry } from "./codec-descriptor-Bf6MlyeJ-C1PfQ9LO.mjs";
2
+ import { t as codecDescriptors } from "./codecs-CaOcjLon-BZ4M7GfD.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-DlI8SadA.mjs.map
49
+ //# sourceMappingURL=codecs-ByvSFGut.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codecs-DlI8SadA.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs.mjs"],"sourcesContent":["import { n as buildSqliteCodecDescriptorRegistry } from \"./codec-descriptor-BX2XRz4V.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-r7gY3BuR.mjs\";\nimport { n as SQLITE_NOW_EXPRESSION } from \"./datetime-text-Bniwehv-.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 { SQLITE_NOW_EXPRESSION, assembleSqliteCodecRegistry, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, jsonDocumentRetag, sqliteBigintColumn, sqliteBigintNumberColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };\n\n//# sourceMappingURL=codecs.mjs.map"],"mappings":";;;;;;;;;;AAWA,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"}
1
+ {"version":3,"file":"codecs-ByvSFGut.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs.mjs"],"sourcesContent":["import { n as buildSqliteCodecDescriptorRegistry } from \"./codec-descriptor-Bf6MlyeJ.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-CaOcjLon.mjs\";\nimport { n as SQLITE_NOW_EXPRESSION } from \"./datetime-text-Bniwehv-.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 { SQLITE_NOW_EXPRESSION, assembleSqliteCodecRegistry, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, jsonDocumentRetag, sqliteBigintColumn, sqliteBigintNumberColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };\n\n//# sourceMappingURL=codecs.mjs.map"],"mappings":";;;;;;;;;;AAWA,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"}
@@ -1,11 +1,14 @@
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-BX2XRz4V-DxUIN3j3.mjs";
3
- import { a as sqliteCharacterVarying, c as sqliteDatetimeCanonical, d as sqliteReal, f as sqliteText, l as sqliteInteger, n as sqliteBlob, r as sqliteCharacter, s as sqliteDatetime, t as sqliteBigint, u as sqliteJson } from "./data-types-Bs4y7eZb-B00ws2B6.mjs";
2
+ import { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-Bf6MlyeJ-C1PfQ9LO.mjs";
3
+ import { c as sqliteText, i as sqliteCharacterVarying, n as sqliteCharacter, o as sqliteInteger, s as sqliteReal, t as sqliteBlob } from "./data-types-pFQMl37_-B-3aK_wd.mjs";
4
4
  import { n as sqliteError } from "./errors-DnR-sMHS-KkMLIP2U.mjs";
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";
5
+ import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, SqlFloatCodec, SqlIntCodec, SqlIntDescriptor, sqlCharDescriptor, sqlFloatDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
6
+ import { structuredError } from "@prisma/orm-framework/utils/structured-error";
7
+ import { CodecImpl, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, column, decodeJsonFloat, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, encodeJsonFloat, refuseJsonValue } from "@prisma/orm-framework/components/codec";
7
8
  import { blindCast } from "@prisma/orm-framework/utils/casts";
8
- //#region ../../../3-targets/3-targets/sqlite/dist/codecs-r7gY3BuR.mjs
9
+ import { canonicalDateTime } from "@prisma/orm-family-sql/contract/data-type-support";
10
+ import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
11
+ //#region ../../../3-targets/3-targets/sqlite/dist/codecs-CaOcjLon.mjs
9
12
  /**
10
13
  * Projects the expression unchanged, for codecs whose canonical JSON is what
11
14
  * SQLite's own JSON conversion already produces.
@@ -148,32 +151,36 @@ const bigintEncodeJson = (codecId, value) => {
148
151
  /**
149
152
  * Requires an integer within ±(2^53 − 1), the range a JS `number` holds
150
153
  * exactly. The guard throws rather than rounding: past the boundary a `number`
151
- * silently loses digits, which is the failure mode this codec exists to refuse.
154
+ * silently loses digits, which is the failure mode these codecs exist to refuse.
152
155
  */
153
- const safeIntegerNumber = (value, code) => {
154
- if (!Number.isSafeInteger(value)) throw sqliteError(code, `sqlite/bigintnumber@1 value must be an integer within the safe integer range, got ${String(value)}`, { meta: {
155
- codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
156
+ const safeIntegerNumber = (codecId, value, code) => {
157
+ if (!Number.isSafeInteger(value)) throw sqliteError(code, `${codecId} value must be an integer within the safe integer range, got ${String(value)}`, { meta: {
158
+ codecId,
156
159
  received: String(value)
157
160
  } });
158
161
  if (Object.is(value, -0)) return 0;
159
162
  return value;
160
163
  };
161
- /** The application value the number-flavoured integer codec writes: the JS type it reads, within the range that type holds exactly. */
162
- const encodableSafeInteger = (value) => {
163
- requireJsType(SQLITE_BIGINT_NUMBER_CODEC_ID, "number", value);
164
- return safeIntegerNumber(value, "RUNTIME.ENCODE_FAILED");
164
+ /** The application value a number-flavoured integer codec writes: the JS type it reads, within the range that type holds exactly. */
165
+ const encodableSafeInteger = (codecId, value) => {
166
+ requireJsType(codecId, "number", value);
167
+ return safeIntegerNumber(codecId, value, "RUNTIME.ENCODE_FAILED");
165
168
  };
166
169
  /**
167
170
  * Converts an exact `bigint` into a safe-range `number`, comparing before any
168
171
  * conversion so an out-of-range value throws rather than rounds.
169
172
  */
170
- const safeIntegerFromBigint = (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: {
172
- codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
173
+ const safeIntegerFromBigint = (codecId, value) => {
174
+ if (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw sqliteError("RUNTIME.DECODE_FAILED", `${codecId} value must be an integer within the safe integer range, got ${value}`, { meta: {
175
+ codecId,
173
176
  received: value.toString()
174
177
  } });
175
178
  return Number(value);
176
179
  };
180
+ /** `sqlite/integer`'s canonical form, read into a `number`: digit text within the safe integer range. */
181
+ const safeIntegerFromDigitText = (codecId, json) => Number(decodeJsonIntegerText(codecId, json, SAFE_INTEGER_BIGINT_RANGE));
182
+ /** A `number` written as `sqlite/integer`'s canonical form. */
183
+ const digitTextOfSafeInteger = (codecId, value) => String(encodableSafeInteger(codecId, value));
177
184
  /**
178
185
  * 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
186
  */
@@ -192,9 +199,23 @@ const sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, {
192
199
  jsonProjection: identityJsonProjection,
193
200
  renderTypes: false
194
201
  });
195
- const sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, {
202
+ /** `sql/int@1` as SQLite stores it: its canonical form is `sqlite/integer`'s digit text. */
203
+ var SqliteSqlIntCodec = class extends SqlIntCodec {
204
+ encodeJson(value) {
205
+ return digitTextOfSafeInteger(this.id, value);
206
+ }
207
+ decodeJson(json) {
208
+ return safeIntegerFromDigitText(this.id, json);
209
+ }
210
+ };
211
+ var SqliteSqlIntTemplate = class extends SqlIntDescriptor {
212
+ factory() {
213
+ return () => new SqliteSqlIntCodec(this);
214
+ }
215
+ };
216
+ const sqliteSqlIntDescriptor = sqliteCodec(new SqliteSqlIntTemplate(), {
196
217
  dataType: sqliteInteger,
197
- jsonProjection: identityJsonProjection
218
+ jsonProjection: decimalTextJsonProjection
198
219
  });
199
220
  const sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, {
200
221
  dataType: sqliteReal,
@@ -232,7 +253,7 @@ var SqliteTextDescriptor = class extends SqliteCodecDescriptor {
232
253
  }
233
254
  };
234
255
  const sqliteTextDescriptor = new SqliteTextDescriptor();
235
- const sqliteTextColumn = () => column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, void 0, "text");
256
+ const sqliteTextColumn = () => column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, void 0);
236
257
  var SqliteIntegerCodec = class extends CodecImpl {
237
258
  async encode(value, _ctx) {
238
259
  return value;
@@ -241,15 +262,15 @@ var SqliteIntegerCodec = class extends CodecImpl {
241
262
  return wire;
242
263
  }
243
264
  encodeJson(value) {
244
- return value;
265
+ return digitTextOfSafeInteger(SQLITE_INTEGER_CODEC_ID, value);
245
266
  }
246
267
  decodeJson(json) {
247
- return decodeJsonInteger(SQLITE_INTEGER_CODEC_ID, json, SAFE_INTEGER_RANGE);
268
+ return safeIntegerFromDigitText(SQLITE_INTEGER_CODEC_ID, json);
248
269
  }
249
270
  };
250
271
  var SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {
251
272
  jsonProjection(expression) {
252
- return expression;
273
+ return decimalTextJsonProjection(expression);
253
274
  }
254
275
  dataType = sqliteInteger.id;
255
276
  codecId = SQLITE_INTEGER_CODEC_ID;
@@ -264,7 +285,7 @@ var SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {
264
285
  }
265
286
  };
266
287
  const sqliteIntegerDescriptor = new SqliteIntegerDescriptor();
267
- const sqliteIntegerColumn = () => column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, void 0, "integer");
288
+ const sqliteIntegerColumn = () => column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, void 0);
268
289
  var SqliteRealCodec = class extends CodecImpl {
269
290
  async encode(value, _ctx) {
270
291
  return refuseNaN(SQLITE_REAL_CODEC_ID, value);
@@ -296,7 +317,7 @@ var SqliteRealDescriptor = class extends SqliteCodecDescriptor {
296
317
  }
297
318
  };
298
319
  const sqliteRealDescriptor = new SqliteRealDescriptor();
299
- const sqliteRealColumn = () => column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, void 0, "real");
320
+ const sqliteRealColumn = () => column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, void 0);
300
321
  var SqliteBlobCodec = class extends CodecImpl {
301
322
  async encode(value, _ctx) {
302
323
  return value;
@@ -325,7 +346,21 @@ var SqliteBlobDescriptor = class extends SqliteCodecDescriptor {
325
346
  }
326
347
  };
327
348
  const sqliteBlobDescriptor = new SqliteBlobDescriptor();
328
- const sqliteBlobColumn = () => column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, void 0, "blob");
349
+ const sqliteBlobColumn = () => column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, void 0);
350
+ /**
351
+ * The canonical form of a `sqlite/datetime@1` value (ADR 254): the instant in UTC, from ISO 8601
352
+ * text with a UTC offset. The range and the millisecond precision are those of a JavaScript `Date`,
353
+ * the codec's value.
354
+ */
355
+ const sqliteDatetimeCanonical = (text) => canonicalDateTime(text, {
356
+ shape: "instant",
357
+ ownerId: SQLITE_DATETIME_CODEC_ID,
358
+ maxFractionDigits: 3,
359
+ range: {
360
+ earliest: "-271821-04-20T00:00:00Z",
361
+ latest: "+275760-09-13T00:00:00Z"
362
+ }
363
+ });
329
364
  /**
330
365
  * Reads the text SQLite holds for an instant. Rejects `Invalid Date` (NaN-time) at every decode
331
366
  * ingress so consumers never receive a Date whose downstream operations silently produce NaN.
@@ -358,11 +393,23 @@ var SqliteDatetimeCodec = class extends CodecImpl {
358
393
  return date;
359
394
  }
360
395
  };
396
+ /**
397
+ * `sqlite/text` stores this codec's values as text and declares no canonical form for them, so the
398
+ * codec declares it: written text with a UTC offset becomes the instant in UTC.
399
+ */
400
+ const datetimeCanonicalForm = (value) => {
401
+ if (typeof value === "string") return sqliteDatetimeCanonical(value);
402
+ throw structuredError("CONTRACT.CAST_REFUSED", `Expected text, got ${JSON.stringify(value)}.`, {
403
+ why: "A SQLite datetime is stored as text.",
404
+ fix: "Write the date and time as text with a UTC offset, as in \"2024-01-01T12:34:56Z\"."
405
+ });
406
+ };
361
407
  var SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {
362
408
  jsonProjection(expression) {
363
409
  return expression;
364
410
  }
365
- dataType = sqliteDatetime.id;
411
+ toCanonicalForm = datetimeCanonicalForm;
412
+ dataType = sqliteText.id;
366
413
  codecId = SQLITE_DATETIME_CODEC_ID;
367
414
  traits = ["equality", "order"];
368
415
  paramsSchema = void 0;
@@ -371,7 +418,7 @@ var SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {
371
418
  }
372
419
  };
373
420
  const sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();
374
- const sqliteDatetimeColumn = () => column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, void 0, "text");
421
+ const sqliteDatetimeColumn = () => column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, void 0);
375
422
  var SqliteJsonCodec = class extends CodecImpl {
376
423
  async encode(value, _ctx) {
377
424
  return JSON.stringify(value);
@@ -380,17 +427,46 @@ var SqliteJsonCodec = class extends CodecImpl {
380
427
  return typeof wire === "string" ? blindCast(JSON.parse(wire)) : wire;
381
428
  }
382
429
  encodeJson(value) {
383
- return value;
430
+ return canonicalizeJson(value);
384
431
  }
385
432
  decodeJson(json) {
386
- return json;
433
+ const document = typeof json === "string" ? parseJsonText(json) : void 0;
434
+ if (document === void 0) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/json@1 contract value must be the JSON text of a document", { meta: {
435
+ codecId: SQLITE_JSON_CODEC_ID,
436
+ received: typeof json
437
+ } });
438
+ return document.value;
387
439
  }
388
440
  };
441
+ function parseJsonText(text) {
442
+ try {
443
+ return { value: JSON.parse(text) };
444
+ } catch {
445
+ return;
446
+ }
447
+ }
448
+ /**
449
+ * `sqlite/text` declares no canonical form, so the codec declares the one of its values: the JSON
450
+ * text of the document, with sorted keys and no added whitespace.
451
+ */
452
+ const jsonTextCanonicalForm = (value) => {
453
+ const document = typeof value === "string" ? parseJsonText(value) : void 0;
454
+ if (document === void 0) throw structuredError("CONTRACT.CAST_REFUSED", `Expected the JSON text of a document, got ${JSON.stringify(value)}.`, {
455
+ why: "A SQLite JSON column stores the JSON text of its document.",
456
+ fix: "Write the document as JSON text, as in {\"plan\": \"free\"}."
457
+ });
458
+ return canonicalizeJson(document.value);
459
+ };
460
+ /**
461
+ * The column stores the document's JSON text and the canonical form is that text, so the stored
462
+ * value is projected as it is: a string the enclosing JSON constructor embeds as a string.
463
+ */
389
464
  var SqliteJsonDescriptor = class extends SqliteCodecDescriptor {
390
465
  jsonProjection(expression) {
391
- return jsonDocumentRetag(expression);
466
+ return expression;
392
467
  }
393
- dataType = sqliteJson.id;
468
+ toCanonicalForm = jsonTextCanonicalForm;
469
+ dataType = sqliteText.id;
394
470
  codecId = SQLITE_JSON_CODEC_ID;
395
471
  traits = ["equality"];
396
472
  paramsSchema = void 0;
@@ -399,7 +475,7 @@ var SqliteJsonDescriptor = class extends SqliteCodecDescriptor {
399
475
  }
400
476
  };
401
477
  const sqliteJsonDescriptor = new SqliteJsonDescriptor();
402
- const sqliteJsonColumn = () => column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, void 0, "text");
478
+ const sqliteJsonColumn = () => column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, void 0);
403
479
  var SqliteBigintCodec = class extends CodecImpl {
404
480
  async encode(value, _ctx) {
405
481
  requireJsType(SQLITE_BIGINT_CODEC_ID, "bigint", value);
@@ -435,7 +511,7 @@ var SqliteBigintDescriptor = class extends SqliteCodecDescriptor {
435
511
  jsonProjection(expression) {
436
512
  return decimalTextJsonProjection(expression);
437
513
  }
438
- dataType = sqliteBigint.id;
514
+ dataType = sqliteInteger.id;
439
515
  codecId = SQLITE_BIGINT_CODEC_ID;
440
516
  traits = [
441
517
  "equality",
@@ -448,19 +524,17 @@ var SqliteBigintDescriptor = class extends SqliteCodecDescriptor {
448
524
  }
449
525
  };
450
526
  const sqliteBigintDescriptor = new SqliteBigintDescriptor();
451
- const sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, void 0, "integer");
527
+ const sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, void 0);
452
528
  /**
453
529
  * A SQLite INTEGER decoded as a JS `number`, for columns whose values stay
454
530
  * within the safe integer range ±(2^53 − 1). Both directions guard rather than
455
531
  * round: decode (wire and JSON) and encode throw a structured error on
456
532
  * out-of-range or non-integral input. The canonical JSON is the decimal text
457
- * `sqlite/bigint` carries, which every codec of that data type shares. The
458
- * descriptor claims no target type, so `integer` in type position keeps its
459
- * current codecs.
533
+ * `sqlite/integer` carries, which every codec of that data type shares.
460
534
  */
461
535
  var SqliteBigintNumberCodec = class extends CodecImpl {
462
536
  async encode(value, _ctx) {
463
- return encodableSafeInteger(value);
537
+ return encodableSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, value);
464
538
  }
465
539
  /**
466
540
  * The driver hands an INTEGER over as a `number` or, in safe-integer mode, a
@@ -468,25 +542,25 @@ var SqliteBigintNumberCodec = class extends CodecImpl {
468
542
  * conversion to `number`, so an out-of-range value throws rather than rounds.
469
543
  */
470
544
  async decode(wire, _ctx) {
471
- if (typeof wire === "number") return safeIntegerNumber(wire, "RUNTIME.DECODE_FAILED");
545
+ if (typeof wire === "number") return safeIntegerNumber(SQLITE_BIGINT_NUMBER_CODEC_ID, wire, "RUNTIME.DECODE_FAILED");
472
546
  if (typeof wire === "string" && !DECIMAL_INTEGER.test(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/bigintnumber@1 wire value must be a decimal string", { meta: {
473
547
  codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
474
548
  received: wire
475
549
  } });
476
- return safeIntegerFromBigint(BigInt(wire));
550
+ return safeIntegerFromBigint(SQLITE_BIGINT_NUMBER_CODEC_ID, BigInt(wire));
477
551
  }
478
552
  encodeJson(value) {
479
- return String(encodableSafeInteger(value));
553
+ return digitTextOfSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, value);
480
554
  }
481
555
  decodeJson(json) {
482
- return Number(decodeJsonIntegerText(SQLITE_BIGINT_NUMBER_CODEC_ID, json, SAFE_INTEGER_BIGINT_RANGE));
556
+ return safeIntegerFromDigitText(SQLITE_BIGINT_NUMBER_CODEC_ID, json);
483
557
  }
484
558
  };
485
559
  var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
486
560
  jsonProjection(expression) {
487
561
  return decimalTextJsonProjection(expression);
488
562
  }
489
- dataType = sqliteBigint.id;
563
+ dataType = sqliteInteger.id;
490
564
  codecId = SQLITE_BIGINT_NUMBER_CODEC_ID;
491
565
  traits = [
492
566
  "equality",
@@ -502,7 +576,7 @@ var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
502
576
  }
503
577
  };
504
578
  const sqliteBigintNumberDescriptor = new SqliteBigintNumberDescriptor();
505
- const sqliteBigintNumberColumn = () => column(sqliteBigintNumberDescriptor.factory(), sqliteBigintNumberDescriptor.codecId, void 0, "integer");
579
+ const sqliteBigintNumberColumn = () => column(sqliteBigintNumberDescriptor.factory(), sqliteBigintNumberDescriptor.codecId, void 0);
506
580
  const codecDescriptors = defineSqliteCodecs([
507
581
  sqliteSqlCharDescriptor,
508
582
  sqliteSqlVarcharDescriptor,
@@ -520,4 +594,4 @@ const codecDescriptors = defineSqliteCodecs([
520
594
  //#endregion
521
595
  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 };
522
596
 
523
- //# sourceMappingURL=codecs-r7gY3BuR-B6lXeFyH.mjs.map
597
+ //# sourceMappingURL=codecs-CaOcjLon-BZ4M7GfD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs-CaOcjLon-BZ4M7GfD.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs-CaOcjLon.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 { c as sqliteText, i as sqliteCharacterVarying, n as sqliteCharacter, o as sqliteInteger, s as sqliteReal, t as sqliteBlob } from \"./data-types-pFQMl37_.mjs\";\nimport { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from \"./codec-descriptor-Bf6MlyeJ.mjs\";\nimport { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, SqlFloatCodec, SqlIntCodec, SqlIntDescriptor, sqlCharDescriptor, sqlFloatDescriptor, sqlVarcharDescriptor } from \"@internal/sql-relational-core/ast\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { canonicalDateTime } from \"@internal/sql-contract/data-type-support\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { CodecImpl, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, column, decodeJsonFloat, 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 these codecs exist to refuse.\n*/\nconst safeIntegerNumber = (codecId, value, code) => {\n\tif (!Number.isSafeInteger(value)) throw sqliteError(code, `${codecId} value must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(value)\n\t} });\n\tif (Object.is(value, -0)) return 0;\n\treturn value;\n};\n/** The application value a number-flavoured integer codec writes: the JS type it reads, within the range that type holds exactly. */\nconst encodableSafeInteger = (codecId, value) => {\n\trequireJsType(codecId, \"number\", value);\n\treturn safeIntegerNumber(codecId, 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 = (codecId, value) => {\n\tif (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `${codecId} value must be an integer within the safe integer range, got ${value}`, { meta: {\n\t\tcodecId,\n\t\treceived: value.toString()\n\t} });\n\treturn Number(value);\n};\n/** `sqlite/integer`'s canonical form, read into a `number`: digit text within the safe integer range. */\nconst safeIntegerFromDigitText = (codecId, json) => Number(decodeJsonIntegerText(codecId, json, SAFE_INTEGER_BIGINT_RANGE));\n/** A `number` written as `sqlite/integer`'s canonical form. */\nconst digitTextOfSafeInteger = (codecId, value) => String(encodableSafeInteger(codecId, value));\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(\" \")]);\n/**\n* SQLite does not enforce a character length, and its codec type map declares no `Char` or\n* `Varchar` type, so the two character codecs render no TypeScript type of their own.\n*/\nconst sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, {\n\tdataType: sqliteCharacter,\n\tjsonProjection: unpaddedCharJsonProjection,\n\trenderTypes: false\n});\nconst sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, {\n\tdataType: sqliteCharacterVarying,\n\tjsonProjection: identityJsonProjection,\n\trenderTypes: false\n});\n/** `sql/int@1` as SQLite stores it: its canonical form is `sqlite/integer`'s digit text. */\nvar SqliteSqlIntCodec = class extends SqlIntCodec {\n\tencodeJson(value) {\n\t\treturn digitTextOfSafeInteger(this.id, value);\n\t}\n\tdecodeJson(json) {\n\t\treturn safeIntegerFromDigitText(this.id, json);\n\t}\n};\nvar SqliteSqlIntTemplate = class extends SqlIntDescriptor {\n\tfactory() {\n\t\treturn () => new SqliteSqlIntCodec(this);\n\t}\n};\nconst sqliteSqlIntDescriptor = sqliteCodec(new SqliteSqlIntTemplate(), {\n\tdataType: sqliteInteger,\n\tjsonProjection: decimalTextJsonProjection\n});\nconst sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, {\n\tdataType: sqliteReal,\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\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);\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 digitTextOfSafeInteger(SQLITE_INTEGER_CODEC_ID, value);\n\t}\n\tdecodeJson(json) {\n\t\treturn safeIntegerFromDigitText(SQLITE_INTEGER_CODEC_ID, json);\n\t}\n};\nvar SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn decimalTextJsonProjection(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\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);\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\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);\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\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);\n/**\n* The canonical form of a `sqlite/datetime@1` value (ADR 254): the instant in UTC, from ISO 8601\n* text with a UTC offset. The range and the millisecond precision are those of a JavaScript `Date`,\n* the codec's value.\n*/\nconst sqliteDatetimeCanonical = (text) => canonicalDateTime(text, {\n\tshape: \"instant\",\n\townerId: SQLITE_DATETIME_CODEC_ID,\n\tmaxFractionDigits: 3,\n\trange: {\n\t\tearliest: \"-271821-04-20T00:00:00Z\",\n\t\tlatest: \"+275760-09-13T00:00:00Z\"\n\t}\n});\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};\n/**\n* `sqlite/text` stores this codec's values as text and declares no canonical form for them, so the\n* codec declares it: written text with a UTC offset becomes the instant in UTC.\n*/\nconst datetimeCanonicalForm = (value) => {\n\tif (typeof value === \"string\") return sqliteDatetimeCanonical(value);\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `Expected text, got ${JSON.stringify(value)}.`, {\n\t\twhy: \"A SQLite datetime is stored as text.\",\n\t\tfix: \"Write the date and time as text with a UTC offset, as in \\\"2024-01-01T12:34:56Z\\\".\"\n\t});\n};\nvar SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\ttoCanonicalForm = datetimeCanonicalForm;\n\tdataType = sqliteText.id;\n\tcodecId = SQLITE_DATETIME_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\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);\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 canonicalizeJson(value);\n\t}\n\tdecodeJson(json) {\n\t\tconst document = typeof json === \"string\" ? parseJsonText(json) : void 0;\n\t\tif (document === void 0) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/json@1 contract value must be the JSON text of a document\", { meta: {\n\t\t\tcodecId: SQLITE_JSON_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn document.value;\n\t}\n};\nfunction parseJsonText(text) {\n\ttry {\n\t\treturn { value: JSON.parse(text) };\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* `sqlite/text` declares no canonical form, so the codec declares the one of its values: the JSON\n* text of the document, with sorted keys and no added whitespace.\n*/\nconst jsonTextCanonicalForm = (value) => {\n\tconst document = typeof value === \"string\" ? parseJsonText(value) : void 0;\n\tif (document === void 0) throw structuredError(\"CONTRACT.CAST_REFUSED\", `Expected the JSON text of a document, got ${JSON.stringify(value)}.`, {\n\t\twhy: \"A SQLite JSON column stores the JSON text of its document.\",\n\t\tfix: \"Write the document as JSON text, as in {\\\"plan\\\": \\\"free\\\"}.\"\n\t});\n\treturn canonicalizeJson(document.value);\n};\n/**\n* The column stores the document's JSON text and the canonical form is that text, so the stored\n* value is projected as it is: a string the enclosing JSON constructor embeds as a string.\n*/\nvar SqliteJsonDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\ttoCanonicalForm = jsonTextCanonicalForm;\n\tdataType = sqliteText.id;\n\tcodecId = SQLITE_JSON_CODEC_ID;\n\ttraits = [\"equality\"];\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);\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 = sqliteInteger.id;\n\tcodecId = SQLITE_BIGINT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\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);\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/integer` carries, which every codec of that data type shares.\n*/\nvar SqliteBigintNumberCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn encodableSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, 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(SQLITE_BIGINT_NUMBER_CODEC_ID, 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(SQLITE_BIGINT_NUMBER_CODEC_ID, BigInt(wire));\n\t}\n\tencodeJson(value) {\n\t\treturn digitTextOfSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, value);\n\t}\n\tdecodeJson(json) {\n\t\treturn safeIntegerFromDigitText(SQLITE_BIGINT_NUMBER_CODEC_ID, json);\n\t}\n};\nvar SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn decimalTextJsonProjection(expression);\n\t}\n\tdataType = sqliteInteger.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\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);\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-CaOcjLon.mjs.map"],"mappings":";;;;;;;;;;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+B,KAAK;CACnE;CACA,WAAW,MAAM;EAChB,OAAO,yBAAyB,+BAA+B,IAAI;CACpE;AACD;AACA,IAAI,+BAA+B,cAAc,sBAAsB;CACtE,eAAe,YAAY;EAC1B,OAAO,0BAA0B,UAAU;CAC5C;CACA,WAAW,cAAc;CACzB,UAAU;CACV,SAAS;EACR;EACA;EACA;CACD;CACA,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,CAAC;AAClI,MAAM,mBAAmB,mBAAmB;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC"}
@@ -1,31 +1,11 @@
1
1
  import { i as SqliteCodecDescriptorRegistry, n as AnySqliteCodecDescriptor, r as SqliteCodecDescriptor } from "./codec-descriptor-Bux_tjPl-DBQU4lFR.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
- import { ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
4
- import { CodecCallContext, CodecImpl, CodecInstanceContext, CodecRegistry } from "@prisma/orm-framework/components/codec";
3
+ import { ProjectionExpr, SqlIntCodec } from "@prisma/orm-family-sql/relational-core/ast";
4
+ import { CodecCallContext, CodecImpl, CodecInstanceContext, CodecRegistry, ToCanonicalForm } 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-hLsmWJRa.d.mts
9
- //#region src/core/codec-helpers.d.ts
10
- /**
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.
12
- */
13
- type JsonValue$1 = string | number | boolean | null | {
14
- readonly [key: string]: JsonValue$1;
15
- } | readonly JsonValue$1[];
16
- //#endregion
17
- //#region src/core/codec-registry.d.ts
18
- type CodecContributor = Pick<ComponentMetadata, 'types'>;
19
- type SqliteCodecRegistry = CodecRegistry & SqliteCodecDescriptorRegistry;
20
- declare function assembleSqliteCodecRegistry(target: CodecContributor, extensions: ReadonlyArray<CodecContributor>): SqliteCodecRegistry;
21
- declare function createSqliteCodecRegistryWithBuiltins(codecDescriptors?: readonly AnySqliteCodecDescriptor[]): SqliteCodecRegistry;
22
- /**
23
- * Build a coherent SQLite codec registry populated with built-in descriptors only.
24
- *
25
- * 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.
26
- */
27
- declare function createSqliteBuiltinCodecLookup(): SqliteCodecRegistry;
28
- //#endregion
8
+ //#region ../../../3-targets/3-targets/sqlite/dist/codecs-DeFZ_0jC.d.mts
29
9
  //#region src/core/codecs.d.ts
30
10
  /**
31
11
  * Re-applies SQLite's JSON subtype to a document-valued expression.
@@ -48,6 +28,11 @@ declare function createSqliteBuiltinCodecLookup(): SqliteCodecRegistry;
48
28
  * value that was never a document.
49
29
  */
50
30
  declare const jsonDocumentRetag: (expression: ProjectionExpr) => ProjectionExpr;
31
+ /** `sql/int@1` as SQLite stores it: its canonical form is `sqlite/integer`'s digit text. */
32
+ declare class SqliteSqlIntCodec extends SqlIntCodec {
33
+ encodeJson(value: number): JsonValue;
34
+ decodeJson(json: JsonValue): number;
35
+ }
51
36
  declare class SqliteTextCodec extends CodecImpl<typeof SQLITE_TEXT_CODEC_ID, readonly ['equality', 'order', 'textual'], string, string> {
52
37
  encode(value: string, _ctx: CodecCallContext): Promise<string>;
53
38
  decode(wire: string, _ctx: CodecCallContext): Promise<string>;
@@ -116,6 +101,7 @@ declare class SqliteDatetimeCodec extends CodecImpl<typeof SQLITE_DATETIME_CODEC
116
101
  }
117
102
  declare class SqliteDatetimeDescriptor extends SqliteCodecDescriptor<void> {
118
103
  protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
104
+ readonly toCanonicalForm: ToCanonicalForm;
119
105
  readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
120
106
  readonly codecId: "sqlite/datetime@1";
121
107
  readonly traits: readonly ["equality", "order"];
@@ -129,8 +115,13 @@ declare class SqliteJsonCodec extends CodecImpl<typeof SQLITE_JSON_CODEC_ID, rea
129
115
  encodeJson(value: JsonValue): JsonValue;
130
116
  decodeJson(json: JsonValue): JsonValue;
131
117
  }
118
+ /**
119
+ * The column stores the document's JSON text and the canonical form is that text, so the stored
120
+ * value is projected as it is: a string the enclosing JSON constructor embeds as a string.
121
+ */
132
122
  declare class SqliteJsonDescriptor extends SqliteCodecDescriptor<void> {
133
123
  protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
124
+ readonly toCanonicalForm: ToCanonicalForm;
134
125
  readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
135
126
  readonly codecId: "sqlite/json@1";
136
127
  readonly traits: readonly ["equality"];
@@ -166,9 +157,7 @@ declare const sqliteBigintColumn: () => import("@prisma/orm-framework/components
166
157
  * within the safe integer range ±(2^53 − 1). Both directions guard rather than
167
158
  * round: decode (wire and JSON) and encode throw a structured error on
168
159
  * out-of-range or non-integral input. The canonical JSON is the decimal text
169
- * `sqlite/bigint` carries, which every codec of that data type shares. The
170
- * descriptor claims no target type, so `integer` in type position keeps its
171
- * current codecs.
160
+ * `sqlite/integer` carries, which every codec of that data type shares.
172
161
  */
173
162
  declare class SqliteBigintNumberCodec extends CodecImpl<typeof SQLITE_BIGINT_NUMBER_CODEC_ID, readonly ['equality', 'order', 'numeric'], number | bigint | string, number> {
174
163
  encode(value: number, _ctx: CodecCallContext): Promise<number>;
@@ -192,6 +181,26 @@ declare class SqliteBigintNumberDescriptor extends SqliteCodecDescriptor<void> {
192
181
  }
193
182
  declare const sqliteBigintNumberColumn: () => import("@prisma/orm-framework/components/codec").ColumnSpec<SqliteBigintNumberCodec, undefined>;
194
183
  //#endregion
184
+ //#region src/core/codec-helpers.d.ts
185
+ /**
186
+ * 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.
187
+ */
188
+ type JsonValue$1 = string | number | boolean | null | {
189
+ readonly [key: string]: JsonValue$1;
190
+ } | readonly JsonValue$1[];
191
+ //#endregion
192
+ //#region src/core/codec-registry.d.ts
193
+ type CodecContributor = Pick<ComponentMetadata, 'types'>;
194
+ type SqliteCodecRegistry = CodecRegistry & SqliteCodecDescriptorRegistry;
195
+ declare function assembleSqliteCodecRegistry(target: CodecContributor, extensions: ReadonlyArray<CodecContributor>): SqliteCodecRegistry;
196
+ declare function createSqliteCodecRegistryWithBuiltins(codecDescriptors?: readonly AnySqliteCodecDescriptor[]): SqliteCodecRegistry;
197
+ /**
198
+ * Build a coherent SQLite codec registry populated with built-in descriptors only.
199
+ *
200
+ * 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.
201
+ */
202
+ declare function createSqliteBuiltinCodecLookup(): SqliteCodecRegistry;
203
+ //#endregion
195
204
  //#region src/core/datetime-text.d.ts
196
205
  /** The SQLite expression for the current instant, as the text `encodeSqliteDatetime` writes. */
197
206
  declare const SQLITE_NOW_EXPRESSION = "strftime('%Y-%m-%dT%H:%M:%fZ','now')";
@@ -205,5 +214,5 @@ declare const SQLITE_NOW_EXPRESSION = "strftime('%Y-%m-%dT%H:%M:%fZ','now')";
205
214
  declare const sqliteCodecRegistry: CodecDescriptorRegistry;
206
215
  declare const sqliteCodecDescriptorRegistry: SqliteCodecDescriptorRegistry;
207
216
  //#endregion
208
- export { sqliteJsonColumn as C, sqliteIntegerColumn as S, sqliteTextColumn as T, sqliteBigintNumberColumn as _, SqliteBlobDescriptor as a, sqliteCodecRegistry as b, SqliteIntegerDescriptor as c, SqliteTextDescriptor as d, assembleSqliteCodecRegistry as f, sqliteBigintColumn as g, jsonDocumentRetag as h, SqliteBigintNumberDescriptor as i, SqliteJsonDescriptor as l, createSqliteCodecRegistryWithBuiltins as m, SQLITE_NOW_EXPRESSION as n, SqliteCodecRegistry as o, createSqliteBuiltinCodecLookup as p, SqliteBigintDescriptor as r, SqliteDatetimeDescriptor as s, JsonValue$1 as t, SqliteRealDescriptor as u, sqliteBlobColumn as v, sqliteRealColumn as w, sqliteDatetimeColumn as x, sqliteCodecDescriptorRegistry as y };
209
- //# sourceMappingURL=codecs-hLsmWJRa-DfMCx_nO.d.mts.map
217
+ export { sqliteIntegerColumn as C, sqliteTextColumn as E, sqliteDatetimeColumn as S, sqliteRealColumn as T, sqliteBigintColumn as _, SqliteBlobDescriptor as a, sqliteCodecDescriptorRegistry as b, SqliteIntegerDescriptor as c, SqliteSqlIntCodec as d, SqliteTextDescriptor as f, jsonDocumentRetag as g, createSqliteCodecRegistryWithBuiltins as h, SqliteBigintNumberDescriptor as i, SqliteJsonDescriptor as l, createSqliteBuiltinCodecLookup as m, SQLITE_NOW_EXPRESSION as n, SqliteCodecRegistry as o, assembleSqliteCodecRegistry as p, SqliteBigintDescriptor as r, SqliteDatetimeDescriptor as s, JsonValue$1 as t, SqliteRealDescriptor as u, sqliteBigintNumberColumn as v, sqliteJsonColumn as w, sqliteCodecRegistry as x, sqliteBlobColumn as y };
218
+ //# sourceMappingURL=codecs-DeFZ_0jC-CgA8KUIS.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3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KAMnG;YACO,cAAc;aACb;;;KAGR,mBAAmB,KAAK;KACxB,sBAAsB,gBAAgB;iBAC1B,4BAA4B,QAAQ,kBAAkB,YAAY,cAAc,oBAAoB;iBACpG,sCAAsC,4BAA4B,6BAA6B;;;;;;iBAM/F,kCAAkC;;;;cAIrC;;;;;;;;cAQA,qBAAqB;cACrB,+BAA+B"}
@@ -0,0 +1 @@
1
+ import "./codecs-DeFZ_0jC-CgA8KUIS.mjs";
@@ -0,0 +1,13 @@
1
+ import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-KMliSCRp-BhTbmbGr.mjs";
2
+ //#region ../../../3-targets/6-adapters/sqlite/dist/column-types.mjs
3
+ const textColumn = { codecId: SQLITE_TEXT_CODEC_ID };
4
+ const integerColumn = { codecId: SQLITE_INTEGER_CODEC_ID };
5
+ const realColumn = { codecId: SQLITE_REAL_CODEC_ID };
6
+ const blobColumn = { codecId: SQLITE_BLOB_CODEC_ID };
7
+ const datetimeColumn = { codecId: SQLITE_DATETIME_CODEC_ID };
8
+ const jsonColumn = { codecId: SQLITE_JSON_CODEC_ID };
9
+ const bigintColumn = { codecId: SQLITE_BIGINT_CODEC_ID };
10
+ //#endregion
11
+ export { jsonColumn as a, integerColumn as i, blobColumn as n, realColumn as o, datetimeColumn as r, textColumn as s, bigintColumn as t };
12
+
13
+ //# sourceMappingURL=column-types-CWeuNngG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-types-CWeuNngG.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/column-types.mjs"],"sourcesContent":["import { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\n//#region src/core/column-types.ts\nconst textColumn = { codecId: SQLITE_TEXT_CODEC_ID };\nconst integerColumn = { codecId: SQLITE_INTEGER_CODEC_ID };\nconst realColumn = { codecId: SQLITE_REAL_CODEC_ID };\nconst blobColumn = { codecId: SQLITE_BLOB_CODEC_ID };\nconst datetimeColumn = { codecId: SQLITE_DATETIME_CODEC_ID };\nconst jsonColumn = { codecId: SQLITE_JSON_CODEC_ID };\nconst bigintColumn = { codecId: SQLITE_BIGINT_CODEC_ID };\n//#endregion\nexport { bigintColumn, blobColumn, datetimeColumn, integerColumn, jsonColumn, realColumn, textColumn };\n\n//# sourceMappingURL=column-types.mjs.map"],"mappings":";;AAEA,MAAM,aAAa,EAAE,SAAS,qBAAqB;AACnD,MAAM,gBAAgB,EAAE,SAAS,wBAAwB;AACzD,MAAM,aAAa,EAAE,SAAS,qBAAqB;AACnD,MAAM,aAAa,EAAE,SAAS,qBAAqB;AACnD,MAAM,iBAAiB,EAAE,SAAS,yBAAyB;AAC3D,MAAM,aAAa,EAAE,SAAS,qBAAqB;AACnD,MAAM,eAAe,EAAE,SAAS,uBAAuB"}