@prisma/orm-target-postgres 8.0.0-rc.5-dev.2 → 8.0.0-rc.5-dev.4

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 (151) hide show
  1. package/dist/{adapter-CEEGgfaS-4MeZ7odP.mjs → adapter-fu5NLR5q-BGMHGbUv.mjs} +4 -4
  2. package/dist/{adapter-CEEGgfaS-4MeZ7odP.mjs.map → adapter-fu5NLR5q-BGMHGbUv.mjs.map} +1 -1
  3. package/dist/adapter.d.mts +2 -2
  4. package/dist/adapter.mjs +6 -6
  5. package/dist/adapter__adapter.mjs +1 -1
  6. package/dist/adapter__column-types.d.mts +2 -2
  7. package/dist/adapter__column-types.mjs +2 -2
  8. package/dist/adapter__control.mjs +78 -12
  9. package/dist/adapter__control.mjs.map +1 -1
  10. package/dist/adapter__runtime.mjs +23 -14
  11. package/dist/adapter__runtime.mjs.map +1 -1
  12. package/dist/adapter__sql-renderer.mjs +1 -1
  13. package/dist/{aggregates-Dh6HPdvC.mjs → aggregates-Ckjhz1o7.mjs} +15 -10
  14. package/dist/aggregates-Ckjhz1o7.mjs.map +1 -0
  15. package/dist/{authoring-BOpdZa2N-ClrLFiXw.mjs → authoring-DayoLvZs-BZzesJbW.mjs} +47 -12
  16. package/dist/authoring-DayoLvZs-BZzesJbW.mjs.map +1 -0
  17. package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs → check-expressions-B3Xp6IFg-BzCFYrC9.mjs} +3 -3
  18. package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs.map → check-expressions-B3Xp6IFg-BzCFYrC9.mjs.map} +1 -1
  19. package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts +39 -0
  20. package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts.map +1 -0
  21. package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs +39 -0
  22. package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs.map +1 -0
  23. package/dist/codec-ids-cWPqrkcF.d.mts +1 -0
  24. package/dist/{codec-types-BRU4F-7t-BaJbKF_i.d.mts → codec-types-X0ENu4sQ-C6GS_WDR.d.mts} +21 -9
  25. package/dist/codec-types-X0ENu4sQ-C6GS_WDR.d.mts.map +1 -0
  26. package/dist/codec-types-Zel4Dk7S.d.mts +2 -0
  27. package/dist/{codecs-BmPCJWqb-DveZGJvm.mjs → codecs-CxWg7WrX-DtVAuuXA.mjs} +351 -255
  28. package/dist/codecs-CxWg7WrX-DtVAuuXA.mjs.map +1 -0
  29. package/dist/{codecs-B1HgsJZ2.mjs → codecs-DZMfLjGe.mjs} +2 -2
  30. package/dist/codecs-DZMfLjGe.mjs.map +1 -0
  31. package/dist/{codecs-D8tLswBi-_nbo-Z8x.d.mts → codecs-bwX5JaME-ByuPNLC5.d.mts} +146 -86
  32. package/dist/codecs-bwX5JaME-ByuPNLC5.d.mts.map +1 -0
  33. package/dist/{codecs-DmCKO7dg.d.mts → codecs-ePpDWH7z.d.mts} +2 -2
  34. package/dist/codecs-ePpDWH7z.d.mts.map +1 -0
  35. package/dist/{column-types-BH-MU6uU.d.mts → column-types-CwjYfNCi.d.mts} +33 -7
  36. package/dist/column-types-CwjYfNCi.d.mts.map +1 -0
  37. package/dist/{column-types-Bh92dNjD.mjs → column-types-DU7C_gwa.mjs} +37 -9
  38. package/dist/column-types-DU7C_gwa.mjs.map +1 -0
  39. package/dist/{contract-free-aQ4nT-_R.mjs → contract-free-CzTZEwpt.mjs} +5 -5
  40. package/dist/contract-free-CzTZEwpt.mjs.map +1 -0
  41. package/dist/{control-2F195jJk.d.mts → control-ByalKcpe.d.mts} +2 -1
  42. package/dist/control-ByalKcpe.d.mts.map +1 -0
  43. package/dist/{control-V7OkAC55.mjs → control-CwOI5ZH9.mjs} +8 -8
  44. package/dist/control-CwOI5ZH9.mjs.map +1 -0
  45. package/dist/{control-adapter-DGLvLCp7-DaglJOfk.mjs → control-adapter-BvycZgCj-DH90lxuD.mjs} +9 -9
  46. package/dist/control-adapter-BvycZgCj-DH90lxuD.mjs.map +1 -0
  47. package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs → control-policy-HgW6zNnz-Ds9U3rSS.mjs} +6 -6
  48. package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs.map → control-policy-HgW6zNnz-Ds9U3rSS.mjs.map} +1 -1
  49. package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs → ddl-GXbCrKp_-CBKFkq1r.mjs} +4 -4
  50. package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs.map → ddl-GXbCrKp_-CBKFkq1r.mjs.map} +1 -1
  51. package/dist/{descriptor-meta-KVX21fsl-DBDoB4eg.mjs → descriptor-meta-BJvQzm-A-BdYGq2QU.mjs} +50 -21
  52. package/dist/descriptor-meta-BJvQzm-A-BdYGq2QU.mjs.map +1 -0
  53. package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs → descriptor-meta-DInZZgUC-Cq-SJvwE.mjs} +6 -6
  54. package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map → descriptor-meta-DInZZgUC-Cq-SJvwE.mjs.map} +1 -1
  55. package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs → diff-database-schema-B27W13mM-DmRNUFyg.mjs} +6 -6
  56. package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs.map → diff-database-schema-B27W13mM-DmRNUFyg.mjs.map} +1 -1
  57. package/dist/driver.mjs +1 -1
  58. package/dist/driver__runtime.mjs +1 -1
  59. package/dist/{errors-CU4xIwwk.d.mts → errors-5fMq0U66.d.mts} +2 -2
  60. package/dist/{errors-CU4xIwwk.d.mts.map → errors-5fMq0U66.d.mts.map} +1 -1
  61. package/dist/errors-DYyzTYzE-39CV_aMo.mjs +92 -0
  62. package/dist/errors-DYyzTYzE-39CV_aMo.mjs.map +1 -0
  63. package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts +9 -0
  64. package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts.map +1 -0
  65. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  66. package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs → op-factory-call-CSkQdszU-C43tr0rP.mjs} +7 -7
  67. package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs.map → op-factory-call-CSkQdszU-C43tr0rP.mjs.map} +1 -1
  68. package/dist/{pack-CySS3DQU.d.mts → pack-DaQJIP6O.d.mts} +143 -11
  69. package/dist/pack-DaQJIP6O.d.mts.map +1 -0
  70. package/dist/{planner-D0uogzvT-1WyGIC5p.mjs → planner-CqeT-P2q-DVglsvwu.mjs} +8 -8
  71. package/dist/{planner-D0uogzvT-1WyGIC5p.mjs.map → planner-CqeT-P2q-DVglsvwu.mjs.map} +1 -1
  72. package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs} +5 -5
  73. package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs.map → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs.map} +1 -1
  74. package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs → planner-produced-postgres-migration-Dsri3SjC-DZynrNO-.mjs} +4 -4
  75. package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map → planner-produced-postgres-migration-Dsri3SjC-DZynrNO-.mjs.map} +1 -1
  76. package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs} +4 -4
  77. package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs.map → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs.map} +1 -1
  78. package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs → postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs} +5 -5
  79. package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map → postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs.map} +1 -1
  80. package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs → postgres-migration-DHvU3Jkt-Eah72PD4.mjs} +6 -6
  81. package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map → postgres-migration-DHvU3Jkt-Eah72PD4.mjs.map} +1 -1
  82. package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs → postgres-schema-B3t7Zr52-CMlY9aGw.mjs} +4 -4
  83. package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs.map → postgres-schema-B3t7Zr52-CMlY9aGw.mjs.map} +1 -1
  84. package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs → render-ops-D2vJApKB-B281fzmn.mjs} +3 -3
  85. package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs.map → render-ops-D2vJApKB-B281fzmn.mjs.map} +1 -1
  86. package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs} +3 -3
  87. package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs.map → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs.map} +1 -1
  88. package/dist/{runtime-C-Hh2m1R.mjs → runtime-BJrfP1e8.mjs} +43 -5
  89. package/dist/runtime-BJrfP1e8.mjs.map +1 -0
  90. package/dist/{runtime-_TfO66h5.d.mts → runtime-bbCw9Omq.d.mts} +2 -1
  91. package/dist/runtime-bbCw9Omq.d.mts.map +1 -0
  92. package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs → sql-renderer-ComgusFq-DfvXlBce.mjs} +3 -3
  93. package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs.map → sql-renderer-ComgusFq-DfvXlBce.mjs.map} +1 -1
  94. package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs → sql-utils-6j9YTLpr-BCyCBPBg.mjs} +3 -3
  95. package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs.map → sql-utils-6j9YTLpr-BCyCBPBg.mjs.map} +1 -1
  96. package/dist/target.d.mts +12 -11
  97. package/dist/target.mjs +24 -23
  98. package/dist/target__aggregates.mjs +1 -1
  99. package/dist/target__codec-ids.d.mts +3 -3
  100. package/dist/target__codec-ids.mjs +2 -2
  101. package/dist/target__codec-types.d.mts +4 -4
  102. package/dist/target__codecs.d.mts +3 -3
  103. package/dist/target__codecs.mjs +3 -3
  104. package/dist/target__contract-free.mjs +3 -3
  105. package/dist/target__control.d.mts +3 -2
  106. package/dist/target__control.mjs +3 -2
  107. package/dist/target__diff-database-schema.mjs +1 -1
  108. package/dist/target__errors.d.mts +1 -1
  109. package/dist/target__errors.mjs +1 -1
  110. package/dist/target__issue-planner.mjs +1 -1
  111. package/dist/target__migration.mjs +2 -2
  112. package/dist/target__op-factory-call.mjs +1 -1
  113. package/dist/target__pack.d.mts +1 -1
  114. package/dist/target__pack.mjs +1 -1
  115. package/dist/target__planner-ddl-builders.mjs +1 -1
  116. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  117. package/dist/target__planner-sql-checks.mjs +1 -1
  118. package/dist/target__planner.mjs +2 -2
  119. package/dist/target__render-ops.mjs +1 -1
  120. package/dist/target__runtime.d.mts +3 -2
  121. package/dist/target__runtime.mjs +3 -2
  122. package/dist/target__runtime.mjs.map +1 -1
  123. package/dist/target__schema-ir-annotations.mjs +1 -1
  124. package/dist/target__sql-utils.mjs +1 -1
  125. package/dist/target__types.mjs +2 -2
  126. package/package.json +9 -9
  127. package/dist/aggregates-Dh6HPdvC.mjs.map +0 -1
  128. package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs.map +0 -1
  129. package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts +0 -35
  130. package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts.map +0 -1
  131. package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs +0 -35
  132. package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs.map +0 -1
  133. package/dist/codec-ids-DJ6j6pZc.d.mts +0 -1
  134. package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts.map +0 -1
  135. package/dist/codec-types-bX63JRLf.d.mts +0 -2
  136. package/dist/codecs-B1HgsJZ2.mjs.map +0 -1
  137. package/dist/codecs-BmPCJWqb-DveZGJvm.mjs.map +0 -1
  138. package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts.map +0 -1
  139. package/dist/codecs-DmCKO7dg.d.mts.map +0 -1
  140. package/dist/column-types-BH-MU6uU.d.mts.map +0 -1
  141. package/dist/column-types-Bh92dNjD.mjs.map +0 -1
  142. package/dist/contract-free-aQ4nT-_R.mjs.map +0 -1
  143. package/dist/control-2F195jJk.d.mts.map +0 -1
  144. package/dist/control-V7OkAC55.mjs.map +0 -1
  145. package/dist/control-adapter-DGLvLCp7-DaglJOfk.mjs.map +0 -1
  146. package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs.map +0 -1
  147. package/dist/errors-DKjQzNaN-DFcF1thx.mjs +0 -39
  148. package/dist/errors-DKjQzNaN-DFcF1thx.mjs.map +0 -1
  149. package/dist/pack-CySS3DQU.d.mts.map +0 -1
  150. package/dist/runtime-C-Hh2m1R.mjs.map +0 -1
  151. package/dist/runtime-_TfO66h5.d.mts.map +0 -1
@@ -1,8 +1,8 @@
1
- import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-ComgusFq-BBlqM1fw.mjs";
2
- import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-DGLvLCp7-DaglJOfk.mjs";
1
+ import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-ComgusFq-DfvXlBce.mjs";
2
+ import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-BvycZgCj-DH90lxuD.mjs";
3
3
  import { isDdlNode } from "@prisma/orm-family-sql/relational-core/ast";
4
4
  import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
5
- //#region ../../../3-targets/6-adapters/postgres/dist/adapter-CEEGgfaS.mjs
5
+ //#region ../../../3-targets/6-adapters/postgres/dist/adapter-fu5NLR5q.mjs
6
6
  const defaultCapabilities = Object.freeze({
7
7
  postgres: {
8
8
  orderBy: true,
@@ -92,4 +92,4 @@ function createPostgresAdapterWithCodecRegistry(codecRegistry) {
92
92
  //#endregion
93
93
  export { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };
94
94
 
95
- //# sourceMappingURL=adapter-CEEGgfaS-4MeZ7odP.mjs.map
95
+ //# sourceMappingURL=adapter-fu5NLR5q-BGMHGbUv.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter-CEEGgfaS-4MeZ7odP.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-CEEGgfaS.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-ComgusFq.mjs\";\nimport { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from \"./control-adapter-DGLvLCp7.mjs\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { isDdlNode } from \"@internal/sql-relational-core/ast\";\n//#region src/core/adapter.ts\nconst defaultCapabilities = Object.freeze({\n\tpostgres: {\n\t\torderBy: true,\n\t\tlimit: true,\n\t\tlateral: true,\n\t\tjsonAgg: true,\n\t\treturning: true,\n\t\tdistinctOn: true\n\t},\n\tsql: {\n\t\tenums: true,\n\t\treturning: true,\n\t\tdefaultInInsert: true,\n\t\tlateral: true,\n\t\tscalarList: true,\n\t\tcheckConstraint: true\n\t}\n});\nvar PostgresAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\tprofile;\n\tcodecRegistry;\n\tconstructor(codecRegistry, profileId) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tconst controlAdapter = new PostgresControlAdapter(codecRegistry);\n\t\tthis.profile = Object.freeze({\n\t\t\tid: profileId ?? \"postgres/default@1\",\n\t\t\ttarget: \"postgres\",\n\t\t\tcapabilities: defaultCapabilities,\n\t\t\treadMarker: (queryable) => controlAdapter.readMarkerDiscriminated({\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tquery: async (sql, params) => {\n\t\t\t\t\tconst rows = [];\n\t\t\t\t\tfor await (const row of queryable.query({\n\t\t\t\t\t\tsql,\n\t\t\t\t\t\t...params === void 0 ? {} : { params }\n\t\t\t\t\t})) rows.push(row);\n\t\t\t\t\treturn { rows };\n\t\t\t\t},\n\t\t\t\tclose: async () => {}\n\t\t\t}, APP_SPACE_ID)\n\t\t});\n\t}\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw adapterError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() does not lower DDL on the runtime adapter — DDL lowering is a control-plane concern handled by the control adapter.\", { meta: { surface: \"runtime-adapter\" } });\n\t\treturn renderLoweredSql(ast, context.contract, this.codecRegistry);\n\t}\n};\nconst INT4_MIN = -2147483648;\nconst INT4_MAX = 2147483647;\n/**\n* The codec a bare JS number is bound through.\n*\n* An integer picks the narrowest column type that holds it: `int4` while it\n* fits the signed 32-bit range, `int8` (number-valued) up to the safe-integer\n* limit. Past that limit a JS number is no longer an exact integer, so it\n* binds as `float8` rather than pretending to a precision it does not have.\n*/\nfunction inferNumberCodecId(value) {\n\tif (!Number.isSafeInteger(value)) return \"pg/float8@1\";\n\treturn value >= INT4_MIN && value <= INT4_MAX ? \"pg/int4@1\" : \"pg/int8number@1\";\n}\n/**\n* Codec-id lookup for bare-literal interpolations used by `fns.raw` on a postgres client. Contributed as the descriptor's static `rawCodecInferer` slot.\n*\n* The ids are versioned because that is how the codec registry keys them: lowering resolves an interpolated value's codec by exact id through `descriptorFor`.\n*/\nconst postgresRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return inferNumberCodecId(value);\n\t\tcase \"bigint\": return \"pg/int8@1\";\n\t\tcase \"string\": return \"pg/text@1\";\n\t\tcase \"boolean\": return \"pg/bool@1\";\n\t\tcase \"object\": if (value instanceof Uint8Array) return \"pg/bytea@1\";\n\t}\n\tthrow adapterError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\", { meta: { valueType: typeof value } });\n} };\nfunction createPostgresAdapter(options) {\n\tconst codecRegistry = createPostgresCodecRegistryWithBuiltins(options?.codecDescriptors);\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry, options?.profileId));\n}\nfunction createPostgresAdapterWithCodecRegistry(codecRegistry) {\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry));\n}\n//#endregion\nexport { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };\n\n//# sourceMappingURL=adapter-CEEGgfaS.mjs.map"],"mappings":";;;;;AAKA,MAAM,sBAAsB,OAAO,OAAO;CACzC,UAAU;EACT,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,WAAW;EACX,YAAY;CACb;CACA,KAAK;EACJ,OAAO;EACP,WAAW;EACX,iBAAiB;EACjB,SAAS;EACT,YAAY;EACZ,iBAAiB;CAClB;AACD,CAAC;AACD,IAAI,sBAAsB,MAAM;CAC/B,WAAW;CACX,WAAW;CACX;CACA;CACA,YAAY,eAAe,WAAW;EACrC,KAAK,gBAAgB;EACrB,MAAM,iBAAiB,IAAI,uBAAuB,aAAa;EAC/D,KAAK,UAAU,OAAO,OAAO;GAC5B,IAAI,aAAa;GACjB,QAAQ;GACR,cAAc;GACd,aAAa,cAAc,eAAe,wBAAwB;IACjE,UAAU;IACV,UAAU;IACV,OAAO,OAAO,KAAK,WAAW;KAC7B,MAAM,OAAO,CAAC;KACd,WAAW,MAAM,OAAO,UAAU,MAAM;MACvC;MACA,GAAG,WAAW,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO;KACtC,CAAC,GAAG,KAAK,KAAK,GAAG;KACjB,OAAO,EAAE,KAAK;IACf;IACA,OAAO,YAAY,CAAC;GACrB,GAAG,YAAY;EAChB,CAAC;CACF;CACA,MAAM,KAAK,SAAS;EACnB,IAAI,UAAU,GAAG,GAAG,MAAM,aAAa,2BAA2B,+HAA+H,EAAE,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;EACzO,OAAO,iBAAiB,KAAK,QAAQ,UAAU,KAAK,aAAa;CAClE;AACD;AACA,MAAM,WAAW;AACjB,MAAM,WAAW;;;;;;;;;AASjB,SAAS,mBAAmB,OAAO;CAClC,IAAI,CAAC,OAAO,cAAc,KAAK,GAAG,OAAO;CACzC,OAAO,SAAS,YAAY,SAAS,WAAW,cAAc;AAC/D;;;;;;AAMA,MAAM,0BAA0B,EAAE,WAAW,OAAO;CACnD,QAAQ,OAAO,OAAf;EACC,KAAK,UAAU,OAAO,mBAAmB,KAAK;EAC9C,KAAK,UAAU,OAAO;EACtB,KAAK,UAAU,OAAO;EACtB,KAAK,WAAW,OAAO;EACvB,KAAK,UAAU,IAAI,iBAAiB,YAAY,OAAO;CACxD;CACA,MAAM,aAAa,6CAA6C,+GAA+G,EAAE,MAAM,EAAE,WAAW,OAAO,MAAM,EAAE,CAAC;AACrN,EAAE;AACF,SAAS,sBAAsB,SAAS;CACvC,MAAM,gBAAgB,wCAAwC,SAAS,gBAAgB;CACvF,OAAO,OAAO,OAAO,IAAI,oBAAoB,eAAe,SAAS,SAAS,CAAC;AAChF;AACA,SAAS,uCAAuC,eAAe;CAC9D,OAAO,OAAO,OAAO,IAAI,oBAAoB,aAAa,CAAC;AAC5D"}
1
+ {"version":3,"file":"adapter-fu5NLR5q-BGMHGbUv.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-fu5NLR5q.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-ComgusFq.mjs\";\nimport { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from \"./control-adapter-BvycZgCj.mjs\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { isDdlNode } from \"@internal/sql-relational-core/ast\";\n//#region src/core/adapter.ts\nconst defaultCapabilities = Object.freeze({\n\tpostgres: {\n\t\torderBy: true,\n\t\tlimit: true,\n\t\tlateral: true,\n\t\tjsonAgg: true,\n\t\treturning: true,\n\t\tdistinctOn: true\n\t},\n\tsql: {\n\t\tenums: true,\n\t\treturning: true,\n\t\tdefaultInInsert: true,\n\t\tlateral: true,\n\t\tscalarList: true,\n\t\tcheckConstraint: true\n\t}\n});\nvar PostgresAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\tprofile;\n\tcodecRegistry;\n\tconstructor(codecRegistry, profileId) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tconst controlAdapter = new PostgresControlAdapter(codecRegistry);\n\t\tthis.profile = Object.freeze({\n\t\t\tid: profileId ?? \"postgres/default@1\",\n\t\t\ttarget: \"postgres\",\n\t\t\tcapabilities: defaultCapabilities,\n\t\t\treadMarker: (queryable) => controlAdapter.readMarkerDiscriminated({\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tquery: async (sql, params) => {\n\t\t\t\t\tconst rows = [];\n\t\t\t\t\tfor await (const row of queryable.query({\n\t\t\t\t\t\tsql,\n\t\t\t\t\t\t...params === void 0 ? {} : { params }\n\t\t\t\t\t})) rows.push(row);\n\t\t\t\t\treturn { rows };\n\t\t\t\t},\n\t\t\t\tclose: async () => {}\n\t\t\t}, APP_SPACE_ID)\n\t\t});\n\t}\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw adapterError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() does not lower DDL on the runtime adapter — DDL lowering is a control-plane concern handled by the control adapter.\", { meta: { surface: \"runtime-adapter\" } });\n\t\treturn renderLoweredSql(ast, context.contract, this.codecRegistry);\n\t}\n};\nconst INT4_MIN = -2147483648;\nconst INT4_MAX = 2147483647;\n/**\n* The codec a bare JS number is bound through.\n*\n* An integer picks the narrowest column type that holds it: `int4` while it\n* fits the signed 32-bit range, `int8` (number-valued) up to the safe-integer\n* limit. Past that limit a JS number is no longer an exact integer, so it\n* binds as `float8` rather than pretending to a precision it does not have.\n*/\nfunction inferNumberCodecId(value) {\n\tif (!Number.isSafeInteger(value)) return \"pg/float8@1\";\n\treturn value >= INT4_MIN && value <= INT4_MAX ? \"pg/int4@1\" : \"pg/int8number@1\";\n}\n/**\n* Codec-id lookup for bare-literal interpolations used by `fns.raw` on a postgres client. Contributed as the descriptor's static `rawCodecInferer` slot.\n*\n* The ids are versioned because that is how the codec registry keys them: lowering resolves an interpolated value's codec by exact id through `descriptorFor`.\n*/\nconst postgresRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return inferNumberCodecId(value);\n\t\tcase \"bigint\": return \"pg/int8@1\";\n\t\tcase \"string\": return \"pg/text@1\";\n\t\tcase \"boolean\": return \"pg/bool@1\";\n\t\tcase \"object\": if (value instanceof Uint8Array) return \"pg/bytea@1\";\n\t}\n\tthrow adapterError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\", { meta: { valueType: typeof value } });\n} };\nfunction createPostgresAdapter(options) {\n\tconst codecRegistry = createPostgresCodecRegistryWithBuiltins(options?.codecDescriptors);\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry, options?.profileId));\n}\nfunction createPostgresAdapterWithCodecRegistry(codecRegistry) {\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry));\n}\n//#endregion\nexport { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };\n\n//# sourceMappingURL=adapter-fu5NLR5q.mjs.map"],"mappings":";;;;;AAKA,MAAM,sBAAsB,OAAO,OAAO;CACzC,UAAU;EACT,SAAS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AW,OAAO;EACvB,KAAK,UAAU,IAAI,iBAAiB,YAAY,OAAO;CACxD;CACA,MAAM,aAAa,6CAA6C,+GAA+G,EAAE,MAAM,EAAE,WAAW,OAAO,MAAM,EAAE,CAAC;AACrN,EAAE;AACF,SAAS,sBAAsB,SAAS;CACvC,MAAM,gBAAgB,wCAAwC,SAAS,gBAAgB;CACvF,OAAO,OAAO,OAAO,IAAI,oBAAoB,eAAe,SAAS,SAAS,CAAC;AAChF;AACA,SAAS,uCAAuC,eAAe;CAC9D,OAAO,OAAO,OAAO,IAAI,oBAAoB,aAAa,CAAC;AAC5D"}
@@ -1,7 +1,7 @@
1
1
  import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
2
2
  import { a as OrderClause, c as PostgresCodecRegistry, d as StorageColumn, f as StorageTable, i as Expr, l as PostgresLoweredStatement, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as SelectAst } from "./types-CkryN1AS-BcQRGsDn.mjs";
3
3
  import { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-CPesdzv0.mjs";
4
- import { _ as timestamptzColumn, a as float4Column, b as varcharColumn, c as int4Column, d as jsonColumn, f as jsonbColumn, g as timestampColumn, h as timeColumn, i as charColumn, l as int8Column, m as textColumn, n as boolColumn, o as float8Column, p as numericColumn, r as byteaColumn, s as int2Column, t as bitColumn, u as intervalColumn, v as timetzColumn, y as varbitColumn } from "./column-types-BH-MU6uU.mjs";
4
+ import { C as timetzColumn, S as timestamptzTemporalColumn, T as varcharColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as varbitColumn, x as timestamptzStringColumn, y as timestampStringColumn } from "./column-types-CwjYfNCi.mjs";
5
5
  import { t as parsePostgresDefault } from "./default-normalizer-B36TOul4.mjs";
6
6
  import { t as normalizeSchemaNativeType } from "./native-type-normalizer-DqJlOTeX.mjs";
7
7
  import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DW6fkczF.mjs";
@@ -10,4 +10,4 @@ import { t as QueryOperationTypes } from "./operation-types-BfRocNI8.mjs";
10
10
  import { t as SqlRuntimeAdapter } from "./runtime-DOXznQe0.mjs";
11
11
  import { t as renderLoweredSql } from "./sql-renderer-BgC0ZgLS.mjs";
12
12
  import "./types-B-4d5_4a.mjs";
13
- export { type BinaryExpr, type ColumnRef, type Direction, type Expr, type OrderClause, type ParamRef, type PostgresAdapterOptions, type PostgresCodecRegistry, type PostgresContract, PostgresControlAdapter, type PostgresLoweredStatement, type QueryOperationTypes, type SelectAst, SqlRuntimeAdapter, type StorageColumn, type StorageTable, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeColumn, timestampColumn, timestamptzColumn, timetzColumn, varbitColumn, varcharColumn };
13
+ export { type BinaryExpr, type ColumnRef, type Direction, type Expr, type OrderClause, type ParamRef, type PostgresAdapterOptions, type PostgresCodecRegistry, type PostgresContract, PostgresControlAdapter, type PostgresLoweredStatement, type QueryOperationTypes, type SelectAst, SqlRuntimeAdapter, type StorageColumn, type StorageTable, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, dateStringColumn, dateTemporalColumn, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
package/dist/adapter.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DuzN3JZg-DiXy4Vah.mjs";
1
+ import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
2
2
  import { t as parsePostgresDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
3
3
  import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
4
- import { n as renderLoweredSql } from "./sql-renderer-ComgusFq-BBlqM1fw.mjs";
5
- import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-DGLvLCp7-DaglJOfk.mjs";
6
- import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-CEEGgfaS-4MeZ7odP.mjs";
7
- import { _ as timestamptzColumn, a as float4Column, b as varcharColumn, c as int4Column, d as jsonColumn, f as jsonbColumn, g as timestampColumn, h as timeColumn, i as charColumn, l as int8Column, m as textColumn, n as boolColumn, o as float8Column, p as numericColumn, r as byteaColumn, s as int2Column, t as bitColumn, u as intervalColumn, v as timetzColumn, y as varbitColumn } from "./column-types-Bh92dNjD.mjs";
8
- export { PostgresControlAdapter, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeColumn, timestampColumn, timestamptzColumn, timetzColumn, varbitColumn, varcharColumn };
4
+ import { n as renderLoweredSql } from "./sql-renderer-ComgusFq-DfvXlBce.mjs";
5
+ import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-BvycZgCj-DH90lxuD.mjs";
6
+ import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-fu5NLR5q-BGMHGbUv.mjs";
7
+ import { C as timetzColumn, S as timestamptzTemporalColumn, T as varcharColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as varbitColumn, x as timestamptzStringColumn, y as timestampStringColumn } from "./column-types-DU7C_gwa.mjs";
8
+ export { PostgresControlAdapter, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, dateStringColumn, dateTemporalColumn, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
@@ -1,2 +1,2 @@
1
- import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-CEEGgfaS-4MeZ7odP.mjs";
1
+ import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-fu5NLR5q-BGMHGbUv.mjs";
2
2
  export { createPostgresAdapter, postgresRawCodecInferer };
@@ -1,2 +1,2 @@
1
- import { _ as timestamptzColumn, a as float4Column, b as varcharColumn, c as int4Column, d as jsonColumn, f as jsonbColumn, g as timestampColumn, h as timeColumn, i as charColumn, l as int8Column, m as textColumn, n as boolColumn, o as float8Column, p as numericColumn, r as byteaColumn, s as int2Column, t as bitColumn, u as intervalColumn, v as timetzColumn, y as varbitColumn } from "./column-types-BH-MU6uU.mjs";
2
- export { bitColumn, boolColumn, byteaColumn, charColumn, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, numericColumn, textColumn, timeColumn, timestampColumn, timestamptzColumn, timetzColumn, varbitColumn, varcharColumn };
1
+ import { C as timetzColumn, S as timestamptzTemporalColumn, T as varcharColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as varbitColumn, x as timestamptzStringColumn, y as timestampStringColumn } from "./column-types-CwjYfNCi.mjs";
2
+ export { bitColumn, boolColumn, byteaColumn, charColumn, dateStringColumn, dateTemporalColumn, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, numericColumn, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
@@ -1,2 +1,2 @@
1
- import { _ as timestamptzColumn, a as float4Column, b as varcharColumn, c as int4Column, d as jsonColumn, f as jsonbColumn, g as timestampColumn, h as timeColumn, i as charColumn, l as int8Column, m as textColumn, n as boolColumn, o as float8Column, p as numericColumn, r as byteaColumn, s as int2Column, t as bitColumn, u as intervalColumn, v as timetzColumn, y as varbitColumn } from "./column-types-Bh92dNjD.mjs";
2
- export { bitColumn, boolColumn, byteaColumn, charColumn, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, numericColumn, textColumn, timeColumn, timestampColumn, timestamptzColumn, timetzColumn, varbitColumn, varcharColumn };
1
+ import { C as timetzColumn, S as timestamptzTemporalColumn, T as varcharColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as varbitColumn, x as timestamptzStringColumn, y as timestampStringColumn } from "./column-types-DU7C_gwa.mjs";
2
+ export { bitColumn, boolColumn, byteaColumn, charColumn, dateStringColumn, dateTemporalColumn, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, numericColumn, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
@@ -1,8 +1,9 @@
1
- import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DuzN3JZg-DiXy4Vah.mjs";
1
+ import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
2
2
  import { t as parsePostgresDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
3
+ import { r as instantNowControlDescriptor } from "./authoring-DayoLvZs-BZzesJbW.mjs";
3
4
  import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
4
- import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-DGLvLCp7-DaglJOfk.mjs";
5
- import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-KVX21fsl-DBDoB4eg.mjs";
5
+ import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-BvycZgCj-DH90lxuD.mjs";
6
+ import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-BJvQzm-A-BdYGq2QU.mjs";
6
7
  import { timestampNowControlDescriptor } from "@prisma/orm-family-sql/family/control";
7
8
  import { int, num, oneOf, optional, str } from "@prisma/orm-framework/psl-parser";
8
9
  import { builtinGeneratorRegistryMetadata } from "@prisma/orm-framework/ids";
@@ -203,7 +204,7 @@ const postgresScalarAuthoringTypes = {
203
204
  DateTime: {
204
205
  kind: "typeConstructor",
205
206
  output: {
206
- codecId: "pg/timestamptz@1",
207
+ codecId: "pg/timestamptz-temporal@1",
207
208
  nativeType: "timestamptz"
208
209
  }
209
210
  },
@@ -306,7 +307,7 @@ const postgresNativeAuthoringTypes = {
306
307
  optional: true
307
308
  }],
308
309
  output: {
309
- codecId: "pg/timestamp@1",
310
+ codecId: "pg/timestamp-temporal@1",
310
311
  nativeType: "timestamp",
311
312
  typeParams: { precision: {
312
313
  kind: "arg",
@@ -324,7 +325,7 @@ const postgresNativeAuthoringTypes = {
324
325
  optional: true
325
326
  }],
326
327
  output: {
327
- codecId: "pg/timestamptz@1",
328
+ codecId: "pg/timestamptz-temporal@1",
328
329
  nativeType: "timestamptz",
329
330
  typeParams: { precision: {
330
331
  kind: "arg",
@@ -342,7 +343,7 @@ const postgresNativeAuthoringTypes = {
342
343
  optional: true
343
344
  }],
344
345
  output: {
345
- codecId: "pg/time@1",
346
+ codecId: "pg/time-temporal@1",
346
347
  nativeType: "time",
347
348
  typeParams: { precision: {
348
349
  kind: "arg",
@@ -399,9 +400,70 @@ const postgresNativeAuthoringTypes = {
399
400
  Date: {
400
401
  kind: "typeConstructor",
401
402
  output: {
402
- codecId: "pg/date@1",
403
+ codecId: "pg/date-temporal@1",
403
404
  nativeType: "date"
404
405
  }
406
+ },
407
+ DateString: {
408
+ kind: "typeConstructor",
409
+ output: {
410
+ codecId: "pg/date-string@1",
411
+ nativeType: "date"
412
+ }
413
+ },
414
+ TimestampString: {
415
+ kind: "typeConstructor",
416
+ args: [{
417
+ kind: "number",
418
+ name: "precision",
419
+ integer: true,
420
+ minimum: 0,
421
+ optional: true
422
+ }],
423
+ output: {
424
+ codecId: "pg/timestamp-string@1",
425
+ nativeType: "timestamp",
426
+ typeParams: { precision: {
427
+ kind: "arg",
428
+ index: 0
429
+ } }
430
+ }
431
+ },
432
+ TimestamptzString: {
433
+ kind: "typeConstructor",
434
+ args: [{
435
+ kind: "number",
436
+ name: "precision",
437
+ integer: true,
438
+ minimum: 0,
439
+ optional: true
440
+ }],
441
+ output: {
442
+ codecId: "pg/timestamptz-string@1",
443
+ nativeType: "timestamptz",
444
+ typeParams: { precision: {
445
+ kind: "arg",
446
+ index: 0
447
+ } }
448
+ }
449
+ },
450
+ TimeString: {
451
+ kind: "typeConstructor",
452
+ args: [{
453
+ kind: "number",
454
+ name: "precision",
455
+ integer: true,
456
+ minimum: 0,
457
+ optional: true
458
+ }],
459
+ output: {
460
+ codecId: "pg/time-string@1",
461
+ nativeType: "time",
462
+ typeParams: { precision: {
463
+ kind: "arg",
464
+ index: 0
465
+ } }
466
+ }
405
467
  }
406
468
  };
407
469
  const postgresAuthoringTypes = {
@@ -412,10 +474,14 @@ function createPostgresDefaultFunctionRegistry() {
412
474
  return new Map(postgresDefaultFunctionRegistryEntries);
413
475
  }
414
476
  function createPostgresMutationDefaultGeneratorDescriptors() {
415
- return [...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({
416
- id,
417
- applicableCodecIds
418
- })), timestampNowControlDescriptor()];
477
+ return [
478
+ ...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({
479
+ id,
480
+ applicableCodecIds
481
+ })),
482
+ timestampNowControlDescriptor(),
483
+ instantNowControlDescriptor()
484
+ ];
419
485
  }
420
486
  const postgresAdapterDescriptor = {
421
487
  ...postgresAdapterDescriptorMeta,
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from \"./control-adapter-DGLvLCp7.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-KVX21fsl.mjs\";\nimport { parsePostgresDefault } from \"@internal/target-postgres/default-normalizer\";\nimport { normalizeSchemaNativeType } from \"@internal/target-postgres/native-type-normalizer\";\nimport { escapeLiteral, qualifyName, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { 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}\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 expression = input.call.args[\"expression\"];\n\tif (typeof expression !== \"string\" || expression.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\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\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = {};\nconst autoincrementSig = {};\nconst ulidSig = {};\nconst uuidSig = { positional: [{\n\tkey: \"version\",\n\ttype: optional(oneOf(num(4), num(7)))\n}] };\nconst cuidSig = { positional: [{\n\tkey: \"version\",\n\ttype: num(2)\n}] };\nconst nanoidSig = { positional: [{\n\tkey: \"size\",\n\ttype: optional(int({\n\t\tmin: 2,\n\t\tmax: 255\n\t}))\n}] };\nconst dbgeneratedSig = { positional: [{\n\tkey: \"expression\",\n\ttype: str()\n}] };\nconst postgresDefaultFunctionRegistryEntries = [\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 postgresScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/text@1\",\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int4@1\",\n\t\t\tnativeType: \"int4\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float8@1\",\n\t\t\tnativeType: \"float8\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/json@1\",\n\t\t\tnativeType: \"json\"\n\t\t}\n\t},\n\tJsonb: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/jsonb@1\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bytea@1\",\n\t\t\tnativeType: \"bytea\"\n\t\t}\n\t}\n};\nconst postgresNativeAuthoringTypes = {\n\tVarChar: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\tnativeType: \"character varying\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tChar: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/char@1\",\n\t\t\tnativeType: \"character\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tNumeric: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"number\",\n\t\t\tname: \"scale\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\",\n\t\t\ttypeParams: {\n\t\t\t\tprecision: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t},\n\t\t\t\tscale: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tTimestamp: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptz: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTime: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimetz: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timetz@1\",\n\t\t\tnativeType: \"timetz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tUuid: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\tnativeType: \"uuid\"\n\t\t}\n\t},\n\tInet: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/inet@1\",\n\t\t\tnativeType: \"inet\"\n\t\t}\n\t},\n\tSmallInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int2@1\",\n\t\t\tnativeType: \"int2\"\n\t\t}\n\t},\n\tReal: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float4@1\",\n\t\t\tnativeType: \"float4\"\n\t\t}\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t}\n};\nconst postgresAuthoringTypes = {\n\t...postgresScalarAuthoringTypes,\n\t...postgresNativeAuthoringTypes\n};\nfunction createPostgresDefaultFunctionRegistry() {\n\treturn new Map(postgresDefaultFunctionRegistryEntries);\n}\nfunction createPostgresMutationDefaultGeneratorDescriptors() {\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 postgresAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tvalueObjectStorageType: \"Jsonb\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new PostgresControlAdapter(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;AASA,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;AACA,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;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ACxB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;CACA,QAAQ;EACP,MAAM;EACN,MAAM,CAAC;GACN,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY;GACZ,YAAY,EAAE,WAAW;IACxB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;CACA,MAAM;EACL,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,MAAM;EACL,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,UAAU;EACT,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,MAAM;EACL,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,MAAM;EACL,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;AACD;AACA,MAAM,yBAAyB;CAC9B,GAAG;CACH,GAAG;AACJ;AACA,SAAS,wCAAwC;CAChD,OAAO,IAAI,IAAI,sCAAsC;AACtD;AACA,SAAS,oDAAoD;CAC5D,OAAO,CAAC,GAAG,iCAAiC,KAAK,EAAE,IAAI,0BAA0B;EAChF;EACA;CACD,EAAE,GAAG,8BAA8B,CAAC;AACrC;AAGA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,wBAAwB;CACzB;CACA,yBAAyB;EACxB,yBAAyB,sCAAsC;EAC/D,sBAAsB,kDAAkD;CACzE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,uBAAuB,8BAA8B;GAC/D,MAAM;GACN,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
1
+ {"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from \"./control-adapter-BvycZgCj.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-BJvQzm-A.mjs\";\nimport { parsePostgresDefault } from \"@internal/target-postgres/default-normalizer\";\nimport { normalizeSchemaNativeType } from \"@internal/target-postgres/native-type-normalizer\";\nimport { escapeLiteral, qualifyName, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\nimport { instantNowControlDescriptor } from \"@internal/target-postgres/control\";\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}\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 expression = input.call.args[\"expression\"];\n\tif (typeof expression !== \"string\" || expression.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\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\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = {};\nconst autoincrementSig = {};\nconst ulidSig = {};\nconst uuidSig = { positional: [{\n\tkey: \"version\",\n\ttype: optional(oneOf(num(4), num(7)))\n}] };\nconst cuidSig = { positional: [{\n\tkey: \"version\",\n\ttype: num(2)\n}] };\nconst nanoidSig = { positional: [{\n\tkey: \"size\",\n\ttype: optional(int({\n\t\tmin: 2,\n\t\tmax: 255\n\t}))\n}] };\nconst dbgeneratedSig = { positional: [{\n\tkey: \"expression\",\n\ttype: str()\n}] };\nconst postgresDefaultFunctionRegistryEntries = [\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 postgresScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/text@1\",\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int4@1\",\n\t\t\tnativeType: \"int4\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float8@1\",\n\t\t\tnativeType: \"float8\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/json@1\",\n\t\t\tnativeType: \"json\"\n\t\t}\n\t},\n\tJsonb: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/jsonb@1\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bytea@1\",\n\t\t\tnativeType: \"bytea\"\n\t\t}\n\t}\n};\nconst postgresNativeAuthoringTypes = {\n\tVarChar: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\tnativeType: \"character varying\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tChar: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/char@1\",\n\t\t\tnativeType: \"character\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tNumeric: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"number\",\n\t\t\tname: \"scale\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\",\n\t\t\ttypeParams: {\n\t\t\t\tprecision: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t},\n\t\t\t\tscale: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tTimestamp: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-temporal@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptz: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTime: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-temporal@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimetz: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timetz@1\",\n\t\t\tnativeType: \"timetz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tUuid: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\tnativeType: \"uuid\"\n\t\t}\n\t},\n\tInet: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/inet@1\",\n\t\t\tnativeType: \"inet\"\n\t\t}\n\t},\n\tSmallInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int2@1\",\n\t\t\tnativeType: \"int2\"\n\t\t}\n\t},\n\tReal: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float4@1\",\n\t\t\tnativeType: \"float4\"\n\t\t}\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-temporal@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-string@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tTimestampString: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-string@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzString: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-string@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimeString: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-string@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t}\n};\nconst postgresAuthoringTypes = {\n\t...postgresScalarAuthoringTypes,\n\t...postgresNativeAuthoringTypes\n};\nfunction createPostgresDefaultFunctionRegistry() {\n\treturn new Map(postgresDefaultFunctionRegistryEntries);\n}\nfunction createPostgresMutationDefaultGeneratorDescriptors() {\n\treturn [\n\t\t...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\t\tid,\n\t\t\tapplicableCodecIds\n\t\t})),\n\t\ttimestampNowControlDescriptor(),\n\t\tinstantNowControlDescriptor()\n\t];\n}\n//#endregion\n//#region src/exports/control.ts\nconst postgresAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tvalueObjectStorageType: \"Jsonb\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new PostgresControlAdapter(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, 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;AACA,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,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AS,oDAAoD;CAC5D,OAAO;EACN,GAAG,iCAAiC,KAAK,EAAE,IAAI,0BAA0B;GACxE;GACA;EACD,EAAE;EACF,8BAA8B;EAC9B,4BAA4B;CAC7B;AACD;AAGA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,wBAAwB;CACzB;CACA,yBAAyB;EACxB,yBAAyB,sCAAsC;EAC/D,sBAAsB,kDAAkD;CACzE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,uBAAuB,8BAA8B;GAC/D,MAAM;GACN,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
@@ -1,22 +1,31 @@
1
- import { n as postgresCodecRegistry } from "./codecs-B1HgsJZ2.mjs";
2
- import { n as assemblePostgresCodecRegistry } from "./control-adapter-DGLvLCp7-DaglJOfk.mjs";
3
- import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-CEEGgfaS-4MeZ7odP.mjs";
4
- import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta-KVX21fsl-DBDoB4eg.mjs";
1
+ import { n as postgresCodecRegistry } from "./codecs-DZMfLjGe.mjs";
2
+ import { n as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-DayoLvZs-BZzesJbW.mjs";
3
+ import { n as assemblePostgresCodecRegistry } from "./control-adapter-BvycZgCj-DH90lxuD.mjs";
4
+ import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-fu5NLR5q-BGMHGbUv.mjs";
5
+ import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta-BJvQzm-A-BdYGq2QU.mjs";
5
6
  import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
6
7
  import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
7
8
  import { generateId } from "@prisma/orm-framework/ids/runtime";
8
9
  //#region ../../../3-targets/6-adapters/postgres/dist/runtime.mjs
9
10
  function createPostgresMutationDefaultGenerators() {
10
- return [...builtinGeneratorIds.map((id) => ({
11
- id,
12
- generate: (params) => {
13
- return generateId(params ? {
14
- id,
15
- params
16
- } : { id });
17
- },
18
- stability: "field"
19
- })), timestampNowRuntimeGenerator()];
11
+ return [
12
+ ...builtinGeneratorIds.map((id) => ({
13
+ id,
14
+ generate: (params) => {
15
+ return generateId(params ? {
16
+ id,
17
+ params
18
+ } : { id });
19
+ },
20
+ stability: "field"
21
+ })),
22
+ timestampNowRuntimeGenerator(),
23
+ {
24
+ id: INSTANT_NOW_GENERATOR_ID,
25
+ generate: () => instantNow(),
26
+ stability: "query"
27
+ }
28
+ ];
20
29
  }
21
30
  const postgresRuntimeAdapterDescriptor = {
22
31
  ...postgresAdapterDescriptorMeta,
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.mjs"],"sourcesContent":["import { n as assemblePostgresCodecRegistry } from \"./control-adapter-DGLvLCp7.mjs\";\nimport { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from \"./adapter-CEEGgfaS.mjs\";\nimport { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-KVX21fsl.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { builtinGeneratorIds } from \"@internal/ids\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-sql/runtime\";\nimport { generateId } from \"@internal/ids/runtime\";\n//#region src/exports/runtime.ts\nfunction createPostgresMutationDefaultGenerators() {\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 postgresRuntimeAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tcodecs: () => Array.from(postgresCodecRegistry.values()),\n\tqueryOperations: () => postgresQueryOperations(),\n\tmutationDefaultGenerators: createPostgresMutationDefaultGenerators,\n\trawCodecInferer: postgresRawCodecInferer,\n\tcreate(stack) {\n\t\treturn createPostgresAdapterWithCodecRegistry(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\tstack.adapter,\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { postgresRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,0CAA0C;CAClD,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,mCAAmC;CACxC,GAAG;CACH,cAAc,MAAM,KAAK,sBAAsB,OAAO,CAAC;CACvD,uBAAuB,wBAAwB;CAC/C,2BAA2B;CAC3B,iBAAiB;CACjB,OAAO,OAAO;EACb,OAAO,uCAAuC,8BAA8B;GAC3E,MAAM;GACN,MAAM;GACN,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
1
+ {"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.mjs"],"sourcesContent":["import { n as assemblePostgresCodecRegistry } from \"./control-adapter-BvycZgCj.mjs\";\nimport { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from \"./adapter-fu5NLR5q.mjs\";\nimport { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-BJvQzm-A.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { builtinGeneratorIds } from \"@internal/ids\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-sql/runtime\";\nimport { generateId } from \"@internal/ids/runtime\";\nimport { INSTANT_NOW_GENERATOR_ID, instantNow } from \"@internal/target-postgres/runtime\";\n//#region src/exports/runtime.ts\nfunction createPostgresMutationDefaultGenerators() {\n\treturn [\n\t\t...builtinGeneratorIds.map((id) => ({\n\t\t\tid,\n\t\t\tgenerate: (params) => {\n\t\t\t\treturn generateId(params ? {\n\t\t\t\t\tid,\n\t\t\t\t\tparams\n\t\t\t\t} : { id });\n\t\t\t},\n\t\t\tstability: \"field\"\n\t\t})),\n\t\ttimestampNowRuntimeGenerator(),\n\t\t{\n\t\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\t\tgenerate: () => instantNow(),\n\t\t\tstability: \"query\"\n\t\t}\n\t];\n}\nconst postgresRuntimeAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tcodecs: () => Array.from(postgresCodecRegistry.values()),\n\tqueryOperations: () => postgresQueryOperations(),\n\tmutationDefaultGenerators: createPostgresMutationDefaultGenerators,\n\trawCodecInferer: postgresRawCodecInferer,\n\tcreate(stack) {\n\t\treturn createPostgresAdapterWithCodecRegistry(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\tstack.adapter,\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { postgresRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,0CAA0C;CAClD,OAAO;EACN,GAAG,oBAAoB,KAAK,QAAQ;GACnC;GACA,WAAW,WAAW;IACrB,OAAO,WAAW,SAAS;KAC1B;KACA;IACD,IAAI,EAAE,GAAG,CAAC;GACX;GACA,WAAW;EACZ,EAAE;EACF,6BAA6B;EAC7B;GACC,IAAI;GACJ,gBAAgB,WAAW;GAC3B,WAAW;EACZ;CACD;AACD;AACA,MAAM,mCAAmC;CACxC,GAAG;CACH,cAAc,MAAM,KAAK,sBAAsB,OAAO,CAAC;CACvD,uBAAuB,wBAAwB;CAC/C,2BAA2B;CAC3B,iBAAiB;CACjB,OAAO,OAAO;EACb,OAAO,uCAAuC,8BAA8B;GAC3E,MAAM;GACN,MAAM;GACN,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
@@ -1,2 +1,2 @@
1
- import { n as renderLoweredSql } from "./sql-renderer-ComgusFq-BBlqM1fw.mjs";
1
+ import { n as renderLoweredSql } from "./sql-renderer-ComgusFq-DfvXlBce.mjs";
2
2
  export { renderLoweredSql };
@@ -1,4 +1,4 @@
1
- import { C as PG_TIMESTAMP_CODEC_ID, E as PG_UNBOUNDED_INT_CODEC_ID, F as SQL_VARCHAR_CODEC_ID, M as SQL_INT_CODEC_ID, P as SQL_TIMESTAMP_CODEC_ID, S as PG_TIMESTAMPTZ_CODEC_ID, T as PG_TIME_CODEC_ID, a as PG_DATE_CODEC_ID, b as PG_TEXT_ARRAY_CODEC_ID, c as PG_FLOAT8_CODEC_ID, d as PG_INT2_CODEC_ID, f as PG_INT4_CODEC_ID, g as PG_INT_CODEC_ID, h as PG_INTERVAL_CODEC_ID, j as SQL_FLOAT_CODEC_ID, k as PG_VARCHAR_CODEC_ID, l as PG_FLOAT_CODEC_ID, m as PG_INT8_NUMBER_CODEC_ID, p as PG_INT8_CODEC_ID, s as PG_FLOAT4_CODEC_ID, u as PG_INET_CODEC_ID, w as PG_TIMETZ_CODEC_ID, x as PG_TEXT_CODEC_ID, y as PG_NUMERIC_CODEC_ID } from "./codec-ids-C5Rkltkw-DMf87l9s.mjs";
1
+ import { A as PG_UNBOUNDED_INT_CODEC_ID, C as PG_TIMESTAMPTZ_STRING_CODEC_ID, D as PG_TIMETZ_CODEC_ID, E as PG_TIMESTAMP_TEMPORAL_CODEC_ID, F as SQL_FLOAT_CODEC_ID, I as SQL_INT_CODEC_ID, N as PG_VARCHAR_CODEC_ID, O as PG_TIME_STRING_CODEC_ID, R as SQL_VARCHAR_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMP_STRING_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, h as PG_INT8_NUMBER_CODEC_ID, k as PG_TIME_TEMPORAL_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, u as PG_FLOAT_CODEC_ID, w as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, x as PG_TEXT_ARRAY_CODEC_ID } from "./codec-ids-D3ZEAmt2-DjoKUAas.mjs";
2
2
  import { AggregateExpr, CastExpr } from "@prisma/orm-family-sql/relational-core/ast";
3
3
  //#region ../../../3-targets/3-targets/postgres/dist/aggregates.mjs
4
4
  const overCodec = (codecId) => ({
@@ -62,15 +62,18 @@ const DOUBLE_PRECISION_CODECS = [
62
62
  * Codecs whose `min`/`max` returns the input type and whose traits do not already say so: the temporal types, `inet`, and `text[]` advertise `order` or `equality`, which `uuid`, `bit`, `bit varying`, `bool`, `bytea`, `json`, and `jsonb` also advertise while having no `min`/`max` at all. An exact overload per supported codec is therefore the only honest shape — a trait fallback over `order` would claim the unsupported ones too.
63
63
  */
64
64
  const MIN_MAX_PRESERVING_CODECS = [
65
- PG_DATE_CODEC_ID,
66
- PG_TIMESTAMP_CODEC_ID,
67
- SQL_TIMESTAMP_CODEC_ID,
68
- PG_TIMESTAMPTZ_CODEC_ID,
69
- PG_TIME_CODEC_ID,
70
65
  PG_TIMETZ_CODEC_ID,
71
66
  PG_INTERVAL_CODEC_ID,
72
67
  PG_INET_CODEC_ID,
73
- PG_TEXT_ARRAY_CODEC_ID
68
+ PG_TEXT_ARRAY_CODEC_ID,
69
+ PG_DATE_STRING_CODEC_ID,
70
+ PG_TIMESTAMP_STRING_CODEC_ID,
71
+ PG_TIMESTAMPTZ_STRING_CODEC_ID,
72
+ PG_TIME_STRING_CODEC_ID,
73
+ PG_DATE_TEMPORAL_CODEC_ID,
74
+ PG_TIMESTAMP_TEMPORAL_CODEC_ID,
75
+ PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,
76
+ PG_TIME_TEMPORAL_CODEC_ID
74
77
  ];
75
78
  /**
76
79
  * `min`/`max` over the character types, where the trait rung does hold: every `textual` codec returns its input type — except the two `varchar` codecs, whose result PostgreSQL widens to `text`, and which therefore claim themselves exactly and shadow the fallback.
@@ -116,17 +119,19 @@ const postgresAggregateDescriptors = [
116
119
  produces("sum", overCodec(PG_NUMERIC_CODEC_ID), PG_NUMERIC_CODEC_ID),
117
120
  produces("sum", overCodec(PG_UNBOUNDED_INT_CODEC_ID), PG_UNBOUNDED_INT_CODEC_ID),
118
121
  produces("sum", overCodec(PG_INTERVAL_CODEC_ID), PG_INTERVAL_CODEC_ID),
119
- produces("sum", overCodec(PG_TIME_CODEC_ID), PG_INTERVAL_CODEC_ID),
122
+ produces("sum", overCodec(PG_TIME_STRING_CODEC_ID), PG_INTERVAL_CODEC_ID),
123
+ produces("sum", overCodec(PG_TIME_TEMPORAL_CODEC_ID), PG_INTERVAL_CODEC_ID),
120
124
  ...INTEGER_CODECS.map((codecId) => producesVia("avg", overCodec(codecId), PG_FLOAT8_CODEC_ID, avgCastToFloat8)),
121
125
  ...[...INTEGER_CODECS, PG_NUMERIC_CODEC_ID].map((codecId) => producesVia("avgDecimal", overCodec(codecId), PG_NUMERIC_CODEC_ID, computedWith("avg"))),
122
126
  ...[PG_FLOAT4_CODEC_ID, ...DOUBLE_PRECISION_CODECS].map((codecId) => produces("avg", overCodec(codecId), PG_FLOAT8_CODEC_ID)),
123
127
  produces("avg", overCodec(PG_NUMERIC_CODEC_ID), PG_NUMERIC_CODEC_ID),
124
128
  produces("avg", overCodec(PG_INTERVAL_CODEC_ID), PG_INTERVAL_CODEC_ID),
125
- produces("avg", overCodec(PG_TIME_CODEC_ID), PG_INTERVAL_CODEC_ID),
129
+ produces("avg", overCodec(PG_TIME_STRING_CODEC_ID), PG_INTERVAL_CODEC_ID),
130
+ produces("avg", overCodec(PG_TIME_TEMPORAL_CODEC_ID), PG_INTERVAL_CODEC_ID),
126
131
  ...orderingDescriptors("min"),
127
132
  ...orderingDescriptors("max")
128
133
  ];
129
134
  //#endregion
130
135
  export { postgresAggregateDescriptors as t };
131
136
 
132
- //# sourceMappingURL=aggregates-Dh6HPdvC.mjs.map
137
+ //# sourceMappingURL=aggregates-Ckjhz1o7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregates-Ckjhz1o7.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/aggregates.mjs"],"sourcesContent":["import { A as PG_UNBOUNDED_INT_CODEC_ID, C as PG_TIMESTAMPTZ_STRING_CODEC_ID, D as PG_TIMETZ_CODEC_ID, E as PG_TIMESTAMP_TEMPORAL_CODEC_ID, F as SQL_FLOAT_CODEC_ID, I as SQL_INT_CODEC_ID, N as PG_VARCHAR_CODEC_ID, O as PG_TIME_STRING_CODEC_ID, R as SQL_VARCHAR_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMP_STRING_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, h as PG_INT8_NUMBER_CODEC_ID, k as PG_TIME_TEMPORAL_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, u as PG_FLOAT_CODEC_ID, w as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, x as PG_TEXT_ARRAY_CODEC_ID } from \"./codec-ids-D3ZEAmt2.mjs\";\nimport { AggregateExpr, CastExpr } from \"@internal/sql-relational-core/ast\";\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/**\n* An aggregate whose result is one of the input values, so it carries the input's codec — type parameters included, since a `numeric(10,3)` minimum is still a `numeric(10,3)`.\n*/\nconst preservesInput = (operation, input) => ({\n\toperation,\n\tinput,\n\toutput: { kind: \"self\" },\n\tnullable: true\n});\n/**\n* An aggregate whose result is a new value. It names its result codec without type parameters: a sum leaves the input's width behind (a `numeric(10,3)` column sums to an unconstrained `numeric`), so carrying the input's parameters into the result would understate the range.\n*/\nconst produces = (operation, input, codecId) => ({\n\toperation,\n\tinput,\n\toutput: {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t},\n\tnullable: true\n});\n/** The same, for an operation that builds its own expression. */\nconst producesVia = (operation, input, codecId, lower) => ({\n\t...produces(operation, input, codecId),\n\tlower\n});\n/** The SQL aggregate a lossless variant computes with. `sumBigInt` is a `sum` read exactly, `countBigInt` a `count`, `avgDecimal` an `avg`: the variants differ in how the result is read, never in what the database computes. */\nconst computedWith = (fn) => ({ expr }) => new AggregateExpr(fn, expr);\n/** `avg` over an integer column, rounded once. PostgreSQL computes the exact `numeric` mean and the cast turns that one value into the `double precision` the result codec reads; casting the input instead would round every value before it was accumulated. */\nconst avgCastToFloat8 = ({ expr }) => CastExpr.as(new AggregateExpr(\"avg\", expr), \"float8\");\n/** Integer codecs whose `sum` widens to `bigint` — every built-in integer bar the 64-bit ones, whose sum goes to `numeric` instead. */\nconst SUM_WIDENS_TO_INT8 = [\n\tPG_INT2_CODEC_ID,\n\tPG_INT4_CODEC_ID,\n\tPG_INT_CODEC_ID,\n\tSQL_INT_CODEC_ID\n];\n/** The 64-bit integer codecs: PostgreSQL computes their `sum` as a `numeric`, a total free to leave the range an `int8` holds. */\nconst SUM_WIDENS_TO_NUMERIC = [PG_INT8_CODEC_ID, PG_INT8_NUMBER_CODEC_ID];\n/** The integer codecs a `sum` reads back as a `number`: every fixed-width one, whatever its own application type. */\nconst FIXED_WIDTH_INTEGER_CODECS = [...SUM_WIDENS_TO_INT8, ...SUM_WIDENS_TO_NUMERIC];\n/** Every built-in integer codec, the unbounded one included: `avg` over any of them is a `numeric` mean. */\nconst INTEGER_CODECS = [...FIXED_WIDTH_INTEGER_CODECS, PG_UNBOUNDED_INT_CODEC_ID];\n/** Codecs over `double precision`, whose `sum` and `avg` stay there. */\nconst DOUBLE_PRECISION_CODECS = [\n\tPG_FLOAT8_CODEC_ID,\n\tPG_FLOAT_CODEC_ID,\n\tSQL_FLOAT_CODEC_ID\n];\n/**\n* Codecs whose `min`/`max` returns the input type and whose traits do not already say so: the temporal types, `inet`, and `text[]` advertise `order` or `equality`, which `uuid`, `bit`, `bit varying`, `bool`, `bytea`, `json`, and `jsonb` also advertise while having no `min`/`max` at all. An exact overload per supported codec is therefore the only honest shape — a trait fallback over `order` would claim the unsupported ones too.\n*/\nconst MIN_MAX_PRESERVING_CODECS = [\n\tPG_TIMETZ_CODEC_ID,\n\tPG_INTERVAL_CODEC_ID,\n\tPG_INET_CODEC_ID,\n\tPG_TEXT_ARRAY_CODEC_ID,\n\tPG_DATE_STRING_CODEC_ID,\n\tPG_TIMESTAMP_STRING_CODEC_ID,\n\tPG_TIMESTAMPTZ_STRING_CODEC_ID,\n\tPG_TIME_STRING_CODEC_ID,\n\tPG_DATE_TEMPORAL_CODEC_ID,\n\tPG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\tPG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\tPG_TIME_TEMPORAL_CODEC_ID\n];\n/**\n* `min`/`max` over the character types, where the trait rung does hold: every `textual` codec returns its input type — except the two `varchar` codecs, whose result PostgreSQL widens to `text`, and which therefore claim themselves exactly and shadow the fallback.\n*/\nconst MIN_MAX_WIDENS_TO_TEXT = [PG_VARCHAR_CODEC_ID, SQL_VARCHAR_CODEC_ID];\nconst orderingDescriptors = (operation) => [\n\tpreservesInput(operation, overTrait(\"numeric\")),\n\tpreservesInput(operation, overTrait(\"textual\")),\n\t...MIN_MAX_WIDENS_TO_TEXT.map((codecId) => produces(operation, overCodec(codecId), PG_TEXT_CODEC_ID)),\n\t...MIN_MAX_PRESERVING_CODECS.map((codecId) => preservesInput(operation, overCodec(codecId)))\n];\n/**\n* Every aggregate overload the PostgreSQL target contributes. The adapter lists these on `types.aggregateDescriptors`, from where emission derives result types and the runtime builds its resolution registry.\n*/\nconst postgresAggregateDescriptors = [\n\t{\n\t\toperation: \"count\",\n\t\tinput: { kind: \"any\" },\n\t\toutput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: PG_INT8_NUMBER_CODEC_ID\n\t\t},\n\t\tnullable: false,\n\t\temptyResultJson: 0\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: PG_INT8_CODEC_ID\n\t\t},\n\t\tnullable: false,\n\t\temptyResultJson: \"0\",\n\t\tlower: computedWith(\"count\")\n\t},\n\t...FIXED_WIDTH_INTEGER_CODECS.map((codecId) => produces(\"sum\", overCodec(codecId), PG_INT8_NUMBER_CODEC_ID)),\n\t...SUM_WIDENS_TO_INT8.map((codecId) => producesVia(\"sumBigInt\", overCodec(codecId), PG_INT8_CODEC_ID, computedWith(\"sum\"))),\n\t...SUM_WIDENS_TO_NUMERIC.map((codecId) => producesVia(\"sumBigInt\", overCodec(codecId), PG_UNBOUNDED_INT_CODEC_ID, computedWith(\"sum\"))),\n\tproducesVia(\"sumBigInt\", overCodec(PG_UNBOUNDED_INT_CODEC_ID), PG_UNBOUNDED_INT_CODEC_ID, computedWith(\"sum\")),\n\tproduces(\"sum\", overCodec(PG_FLOAT4_CODEC_ID), PG_FLOAT4_CODEC_ID),\n\t...DOUBLE_PRECISION_CODECS.map((codecId) => produces(\"sum\", overCodec(codecId), PG_FLOAT8_CODEC_ID)),\n\tproduces(\"sum\", overCodec(PG_NUMERIC_CODEC_ID), PG_NUMERIC_CODEC_ID),\n\tproduces(\"sum\", overCodec(PG_UNBOUNDED_INT_CODEC_ID), PG_UNBOUNDED_INT_CODEC_ID),\n\tproduces(\"sum\", overCodec(PG_INTERVAL_CODEC_ID), PG_INTERVAL_CODEC_ID),\n\tproduces(\"sum\", overCodec(PG_TIME_STRING_CODEC_ID), PG_INTERVAL_CODEC_ID),\n\tproduces(\"sum\", overCodec(PG_TIME_TEMPORAL_CODEC_ID), PG_INTERVAL_CODEC_ID),\n\t...INTEGER_CODECS.map((codecId) => producesVia(\"avg\", overCodec(codecId), PG_FLOAT8_CODEC_ID, avgCastToFloat8)),\n\t...[...INTEGER_CODECS, PG_NUMERIC_CODEC_ID].map((codecId) => producesVia(\"avgDecimal\", overCodec(codecId), PG_NUMERIC_CODEC_ID, computedWith(\"avg\"))),\n\t...[PG_FLOAT4_CODEC_ID, ...DOUBLE_PRECISION_CODECS].map((codecId) => produces(\"avg\", overCodec(codecId), PG_FLOAT8_CODEC_ID)),\n\tproduces(\"avg\", overCodec(PG_NUMERIC_CODEC_ID), PG_NUMERIC_CODEC_ID),\n\tproduces(\"avg\", overCodec(PG_INTERVAL_CODEC_ID), PG_INTERVAL_CODEC_ID),\n\tproduces(\"avg\", overCodec(PG_TIME_STRING_CODEC_ID), PG_INTERVAL_CODEC_ID),\n\tproduces(\"avg\", overCodec(PG_TIME_TEMPORAL_CODEC_ID), PG_INTERVAL_CODEC_ID),\n\t...orderingDescriptors(\"min\"),\n\t...orderingDescriptors(\"max\")\n];\n//#endregion\nexport { postgresAggregateDescriptors };\n\n//# sourceMappingURL=aggregates.mjs.map"],"mappings":";;;AAGA,MAAM,aAAa,aAAa;CAC/B,MAAM;CACN;AACD;AACA,MAAM,aAAa,WAAW;CAC7B,MAAM;CACN;AACD;;;;AAIA,MAAM,kBAAkB,WAAW,WAAW;CAC7C;CACA;CACA,QAAQ,EAAE,MAAM,OAAO;CACvB,UAAU;AACX;;;;AAIA,MAAM,YAA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K;CAC5B,GAAG,oBAAoB,KAAK;AAC7B"}
@@ -1,17 +1,37 @@
1
- import { o as PG_ENUM_CODEC_ID } from "./codec-ids-C5Rkltkw-DMf87l9s.mjs";
2
- import { n as postgresError } from "./errors-DKjQzNaN-DFcF1thx.mjs";
1
+ import { s as PG_ENUM_CODEC_ID } from "./codec-ids-D3ZEAmt2-DjoKUAas.mjs";
2
+ import { i as errorTemporalUnavailableForDefault, s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
3
3
  import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
4
- import { a as PostgresRlsPolicySchema, i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole, r as PostgresRlsEnablementSchema, s as PostgresRoleSchema, t as PostgresNativeEnumSchema } from "./postgres-schema-CF0yHESb-D7n2X21R.mjs";
4
+ import { a as PostgresRlsPolicySchema, i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole, r as PostgresRlsEnablementSchema, s as PostgresRoleSchema, t as PostgresNativeEnumSchema } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
5
5
  import { n as computeContentHash, t as POLICY_OPERATION_PREDICATES } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
6
6
  import { blindCast } from "@prisma/orm-framework/utils/casts";
7
7
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
8
8
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
9
9
  import { assertWireNamePrefixLength, normalizeSqlBody } from "@prisma/orm-family-sql/schema-ir/naming";
10
10
  import { assertDefined } from "@prisma/orm-framework/utils/assertions";
11
- import { temporalAuthoringPresets, temporalCodecPresetWithPrecision } from "@prisma/orm-family-sql/family/control";
11
+ import { temporalAuthoringPresets, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from "@prisma/orm-family-sql/family/control";
12
12
  import { modelAttribute } from "@prisma/orm-framework/psl-parser";
13
13
  import { exactNameBodyWarning } from "@prisma/orm-family-sql/contract/index-naming";
14
- //#region ../../../3-targets/3-targets/postgres/dist/authoring-BOpdZa2N.mjs
14
+ //#region ../../../3-targets/3-targets/postgres/dist/authoring-DayoLvZs.mjs
15
+ const INSTANT_NOW_GENERATOR_ID = "instantNow";
16
+ function instantNowControlDescriptor() {
17
+ return {
18
+ id: INSTANT_NOW_GENERATOR_ID,
19
+ buildPhases: () => ({
20
+ onCreate: {
21
+ kind: "generator",
22
+ id: INSTANT_NOW_GENERATOR_ID
23
+ },
24
+ onUpdate: {
25
+ kind: "generator",
26
+ id: INSTANT_NOW_GENERATOR_ID
27
+ }
28
+ })
29
+ };
30
+ }
31
+ function instantNow() {
32
+ if (typeof Temporal === "undefined") throw errorTemporalUnavailableForDefault(INSTANT_NOW_GENERATOR_ID);
33
+ return Temporal.Now.instant();
34
+ }
15
35
  const PSL_RLS_PREDICATE_NOT_FOR_OPERATION = "PSL_RLS_PREDICATE_NOT_FOR_OPERATION";
16
36
  const PSL_POLICY_INVALID_MAP = "PSL_POLICY_INVALID_MAP";
17
37
  const PSL_NATIVE_ENUM_INVALID_MAP = "PSL_NATIVE_ENUM_INVALID_MAP";
@@ -595,21 +615,36 @@ const postgresAuthoringFieldPresets = {
595
615
  dateTime: {
596
616
  kind: "fieldPreset",
597
617
  output: {
598
- codecId: "pg/timestamptz@1",
618
+ codecId: "pg/timestamptz-temporal@1",
599
619
  nativeType: "timestamptz"
600
620
  }
601
621
  },
602
622
  temporal: {
603
623
  .../* @__PURE__ */ temporalAuthoringPresets({
604
- codecId: "pg/timestamptz@1",
624
+ codecId: "pg/timestamptz-temporal@1",
625
+ nativeType: "timestamptz",
626
+ generatorId: INSTANT_NOW_GENERATOR_ID
627
+ }),
628
+ .../* @__PURE__ */ temporalStringAuthoringPresets({
629
+ codecId: "pg/timestamptz-string@1",
605
630
  nativeType: "timestamptz"
606
631
  }),
607
632
  timestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({
608
- codecId: "pg/timestamp@1",
609
- nativeType: "timestamp"
633
+ codecId: "pg/timestamp-temporal@1",
634
+ nativeType: "timestamp",
635
+ generatorId: INSTANT_NOW_GENERATOR_ID
610
636
  }),
611
637
  timestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({
612
- codecId: "pg/timestamptz@1",
638
+ codecId: "pg/timestamptz-temporal@1",
639
+ nativeType: "timestamptz",
640
+ generatorId: INSTANT_NOW_GENERATOR_ID
641
+ }),
642
+ timestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({
643
+ codecId: "pg/timestamp-string@1",
644
+ nativeType: "timestamp"
645
+ }),
646
+ timestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({
647
+ codecId: "pg/timestamptz-string@1",
613
648
  nativeType: "timestamptz"
614
649
  })
615
650
  },
@@ -768,6 +803,6 @@ function postgresLowerEntityHandles(input) {
768
803
  return rows;
769
804
  }
770
805
  //#endregion
771
- export { postgresAuthoringTypes as a, postgresAuthoringPslBlockDescriptors as i, postgresAuthoringFieldPresets as n, postgresLowerEntityHandles as o, postgresAuthoringModelAttributes as r, postgresAuthoringEntityTypes as t };
806
+ export { postgresAuthoringFieldPresets as a, postgresAuthoringTypes as c, postgresAuthoringEntityTypes as i, postgresLowerEntityHandles as l, instantNow as n, postgresAuthoringModelAttributes as o, instantNowControlDescriptor as r, postgresAuthoringPslBlockDescriptors as s, INSTANT_NOW_GENERATOR_ID as t };
772
807
 
773
- //# sourceMappingURL=authoring-BOpdZa2N-ClrLFiXw.mjs.map
808
+ //# sourceMappingURL=authoring-DayoLvZs-BZzesJbW.mjs.map