@prisma/orm-target-postgres 0.17.0-dev.1 → 0.17.0-dev.3

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 (63) hide show
  1. package/dist/{adapter-DhqcO3YO-jzwDVcCv.mjs → adapter-wewzDGJh-DkJnr3kE.mjs} +4 -3
  2. package/dist/adapter-wewzDGJh-DkJnr3kE.mjs.map +1 -0
  3. package/dist/adapter.d.mts +2 -1
  4. package/dist/adapter.mjs +4 -3
  5. package/dist/adapter__adapter.mjs +1 -1
  6. package/dist/adapter__control.mjs +2 -2
  7. package/dist/adapter__control.mjs.map +1 -1
  8. package/dist/adapter__runtime.mjs +4 -4
  9. package/dist/adapter__runtime.mjs.map +1 -1
  10. package/dist/adapter__sql-renderer.d.mts +2 -0
  11. package/dist/adapter__sql-renderer.mjs +2 -0
  12. package/dist/aggregates-CgqNfj2O.d.mts +10 -0
  13. package/dist/aggregates-CgqNfj2O.d.mts.map +1 -0
  14. package/dist/aggregates-ftUgi-eC.mjs +102 -0
  15. package/dist/aggregates-ftUgi-eC.mjs.map +1 -0
  16. package/dist/{codecs-CBl0nD44-CaWPc1bd.mjs → codecs-CBl0nD44-CjInu_aV.mjs} +2 -2
  17. package/dist/{codecs-CBl0nD44-CaWPc1bd.mjs.map → codecs-CBl0nD44-CjInu_aV.mjs.map} +1 -1
  18. package/dist/{codecs-CHIVTNZs.mjs → codecs-rujsdlZR.mjs} +2 -2
  19. package/dist/{codecs-CHIVTNZs.mjs.map → codecs-rujsdlZR.mjs.map} +1 -1
  20. package/dist/{control-DRMWptiJ.mjs → control-BzDnaGim.mjs} +5 -5
  21. package/dist/{control-DRMWptiJ.mjs.map → control-BzDnaGim.mjs.map} +1 -1
  22. package/dist/{control-adapter-B9t0g7Pf-HrCxlM65.mjs → control-adapter-CipVam9p-B-E2SF8_.mjs} +9 -578
  23. package/dist/control-adapter-CipVam9p-B-E2SF8_.mjs.map +1 -0
  24. package/dist/{control-policy-Cl3RRSPg-CT3QGpR3.mjs → control-policy-Cl3RRSPg-BUi6pcI-.mjs} +3 -3
  25. package/dist/{control-policy-Cl3RRSPg-CT3QGpR3.mjs.map → control-policy-Cl3RRSPg-BUi6pcI-.mjs.map} +1 -1
  26. package/dist/{descriptor-meta-2IlVC6_d-DnV00Qd_.mjs → descriptor-meta--MCrvIgj-DFsLFDj1.mjs} +6 -4
  27. package/dist/descriptor-meta--MCrvIgj-DFsLFDj1.mjs.map +1 -0
  28. package/dist/{descriptor-meta-DnHabAS3-C53XXPQw.mjs → descriptor-meta-DnHabAS3-BiTguA3K.mjs} +2 -2
  29. package/dist/{descriptor-meta-DnHabAS3-C53XXPQw.mjs.map → descriptor-meta-DnHabAS3-BiTguA3K.mjs.map} +1 -1
  30. package/dist/{diff-database-schema-BfRs2vrG-D2o4KII0.mjs → diff-database-schema-BfRs2vrG-DInOv5LW.mjs} +2 -2
  31. package/dist/{diff-database-schema-BfRs2vrG-D2o4KII0.mjs.map → diff-database-schema-BfRs2vrG-DInOv5LW.mjs.map} +1 -1
  32. package/dist/{op-factory-call-DifL68KT-Bo6pxs-R.mjs → op-factory-call-DifL68KT-CNFEDNsf.mjs} +2 -2
  33. package/dist/{op-factory-call-DifL68KT-Bo6pxs-R.mjs.map → op-factory-call-DifL68KT-CNFEDNsf.mjs.map} +1 -1
  34. package/dist/{planner-Bmje9ii8-B99fEsNM.mjs → planner-Bmje9ii8-DdjXZxyD.mjs} +5 -5
  35. package/dist/{planner-Bmje9ii8-B99fEsNM.mjs.map → planner-Bmje9ii8-DdjXZxyD.mjs.map} +1 -1
  36. package/dist/{planner-ddl-builders-CbfICQfm-CxYiLrhX.mjs → planner-ddl-builders-CbfICQfm-CGjwaNy7.mjs} +2 -2
  37. package/dist/{planner-ddl-builders-CbfICQfm-CxYiLrhX.mjs.map → planner-ddl-builders-CbfICQfm-CGjwaNy7.mjs.map} +1 -1
  38. package/dist/{planner-produced-postgres-migration-Cicg2sXg-Ck9iDxGI.mjs → planner-produced-postgres-migration-Cicg2sXg-CZI7mdz9.mjs} +2 -2
  39. package/dist/{planner-produced-postgres-migration-Cicg2sXg-Ck9iDxGI.mjs.map → planner-produced-postgres-migration-Cicg2sXg-CZI7mdz9.mjs.map} +1 -1
  40. package/dist/{postgres-migration-CJshdIZn-DYYjgdD0.mjs → postgres-migration-CJshdIZn-CT6Cxd4x.mjs} +2 -2
  41. package/dist/{postgres-migration-CJshdIZn-DYYjgdD0.mjs.map → postgres-migration-CJshdIZn-CT6Cxd4x.mjs.map} +1 -1
  42. package/dist/sql-renderer-CZE98PJj-Bx5D-Txz.mjs +579 -0
  43. package/dist/sql-renderer-CZE98PJj-Bx5D-Txz.mjs.map +1 -0
  44. package/dist/sql-renderer-Cyls5Xy4.d.mts +19 -0
  45. package/dist/sql-renderer-Cyls5Xy4.d.mts.map +1 -0
  46. package/dist/target.d.mts +2 -1
  47. package/dist/target.mjs +13 -12
  48. package/dist/target__aggregates.d.mts +2 -0
  49. package/dist/target__aggregates.mjs +2 -0
  50. package/dist/target__codecs.mjs +2 -2
  51. package/dist/target__control.mjs +1 -1
  52. package/dist/target__diff-database-schema.mjs +1 -1
  53. package/dist/target__issue-planner.mjs +1 -1
  54. package/dist/target__migration.mjs +2 -2
  55. package/dist/target__op-factory-call.mjs +1 -1
  56. package/dist/target__pack.mjs +1 -1
  57. package/dist/target__planner-ddl-builders.mjs +1 -1
  58. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  59. package/dist/target__planner.mjs +2 -2
  60. package/package.json +11 -9
  61. package/dist/adapter-DhqcO3YO-jzwDVcCv.mjs.map +0 -1
  62. package/dist/control-adapter-B9t0g7Pf-HrCxlM65.mjs.map +0 -1
  63. package/dist/descriptor-meta-2IlVC6_d-DnV00Qd_.mjs.map +0 -1
@@ -1,7 +1,8 @@
1
- import { a as createPostgresCodecRegistryWithBuiltins, n as adapterError, o as renderLoweredSql, t as PostgresControlAdapter } from "./control-adapter-B9t0g7Pf-HrCxlM65.mjs";
1
+ import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-CZE98PJj-Bx5D-Txz.mjs";
2
+ import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-CipVam9p-B-E2SF8_.mjs";
2
3
  import { isDdlNode } from "@prisma/orm-family-sql/relational-core/ast";
3
4
  import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
4
- //#region ../../../3-targets/6-adapters/postgres/dist/adapter-DhqcO3YO.mjs
5
+ //#region ../../../3-targets/6-adapters/postgres/dist/adapter-wewzDGJh.mjs
5
6
  const defaultCapabilities = Object.freeze({
6
7
  postgres: {
7
8
  orderBy: true,
@@ -67,4 +68,4 @@ function createPostgresAdapterWithCodecRegistry(codecRegistry) {
67
68
  //#endregion
68
69
  export { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };
69
70
 
70
- //# sourceMappingURL=adapter-DhqcO3YO-jzwDVcCv.mjs.map
71
+ //# sourceMappingURL=adapter-wewzDGJh-DkJnr3kE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-wewzDGJh-DkJnr3kE.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-wewzDGJh.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-CZE98PJj.mjs\";\nimport { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from \"./control-adapter-CipVam9p.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}\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\treturn { rows: [...(await queryable.query(sql, params)).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};\n/** Codec-id lookup for bare-literal interpolations used by `fns.raw` on a postgres client. Contributed as the descriptor's static `rawCodecInferer` slot. */\nconst postgresRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return Number.isSafeInteger(value) && value % 1 === 0 ? \"pg/int4\" : \"pg/float8\";\n\t\tcase \"bigint\": return \"pg/int8\";\n\t\tcase \"string\": return \"pg/text\";\n\t\tcase \"boolean\": return \"pg/bool\";\n\t\tcase \"object\": if (value instanceof Uint8Array) return \"pg/bytea\";\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-wewzDGJh.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;CACb;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,OAAO,EAAE,MAAM,CAAC,IAAI,MAAM,UAAU,MAAM,KAAK,MAAM,EAAA,CAAG,IAAI,EAAE;IAC/D;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;;AAEA,MAAM,0BAA0B,EAAE,WAAW,OAAO;CACnD,QAAQ,OAAO,OAAf;EACC,KAAK,UAAU,OAAO,OAAO,cAAc,KAAK,KAAK,QAAQ,MAAM,IAAI,YAAY;EACnF,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"}
@@ -8,5 +8,6 @@ import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sq
8
8
  import { n as createPostgresBuiltinCodecLookup, r as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-D85zv_aY.mjs";
9
9
  import { t as QueryOperationTypes } from "./operation-types-BfRocNI8.mjs";
10
10
  import { t as SqlRuntimeAdapter } from "./runtime-BbSRVwdd.mjs";
11
+ import { t as renderLoweredSql } from "./sql-renderer-Cyls5Xy4.mjs";
11
12
  import "./types-Cp_Jf2tk.mjs";
12
- 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, 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, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeColumn, timestampColumn, timestamptzColumn, timetzColumn, varbitColumn, varcharColumn };
package/dist/adapter.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-BnBlQxyh-DaX9Nb7Z.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 { a as createPostgresCodecRegistryWithBuiltins, i as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-B9t0g7Pf-HrCxlM65.mjs";
5
- import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-DhqcO3YO-jzwDVcCv.mjs";
4
+ import { n as renderLoweredSql } from "./sql-renderer-CZE98PJj-Bx5D-Txz.mjs";
5
+ import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-CipVam9p-B-E2SF8_.mjs";
6
+ import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-wewzDGJh-DkJnr3kE.mjs";
6
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-CwAyCgp2.mjs";
7
- export { PostgresControlAdapter, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, textColumn, timeColumn, timestampColumn, timestamptzColumn, timetzColumn, varbitColumn, varcharColumn };
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 };
@@ -1,2 +1,2 @@
1
- import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-DhqcO3YO-jzwDVcCv.mjs";
1
+ import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-wewzDGJh-DkJnr3kE.mjs";
2
2
  export { createPostgresAdapter, postgresRawCodecInferer };
@@ -1,8 +1,8 @@
1
1
  import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-BnBlQxyh-DaX9Nb7Z.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 { a as createPostgresCodecRegistryWithBuiltins, i as createPostgresBuiltinCodecLookup, r as assemblePostgresCodecRegistry, t as PostgresControlAdapter } from "./control-adapter-B9t0g7Pf-HrCxlM65.mjs";
5
- import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-2IlVC6_d-DnV00Qd_.mjs";
4
+ import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-CipVam9p-B-E2SF8_.mjs";
5
+ import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta--MCrvIgj-DFsLFDj1.mjs";
6
6
  import { timestampNowControlDescriptor } from "@prisma/orm-family-sql/family/control";
7
7
  import { int, num, oneOf, optional, str } from "@prisma/orm-framework/psl-parser";
8
8
  import { builtinGeneratorRegistryMetadata } from "@prisma/orm-framework/ids";
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { a as createPostgresCodecRegistryWithBuiltins, i as createPostgresBuiltinCodecLookup, r as assemblePostgresCodecRegistry, t as PostgresControlAdapter } from \"./control-adapter-B9t0g7Pf.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-2IlVC6_d.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"],"mapp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;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-CipVam9p.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta--MCrvIgj.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;E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b;CACD;CACA,QAAQ;EACP,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,SAAS;EACR,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,OAAO;EACN,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;AACD;AACA,MAAM,+BAA+B;CACpC,SAAS;EACR,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,QAAQ;IACrB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;CACA,MAAM;EACL,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,QAAQ;IACrB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;CACA,SAAS;EACR,MAAM;EACN,MAAM,CAAC;GACN,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU;EACX,GAAG;GACF,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY;GACZ,YAAY;IACX,WAAW;KACV,MAAM;KACN,OAAO;IACR;IACA,OAAO;KACN,MAAM;KACN,OAAO;IACR;GACD;EACD;CACD;CACA,WAAW;EACV,MAAM;EACN,MA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,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,7 +1,7 @@
1
- import { n as postgresCodecRegistry } from "./codecs-CHIVTNZs.mjs";
2
- import { r as assemblePostgresCodecRegistry } from "./control-adapter-B9t0g7Pf-HrCxlM65.mjs";
3
- import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-DhqcO3YO-jzwDVcCv.mjs";
4
- import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta-2IlVC6_d-DnV00Qd_.mjs";
1
+ import { n as postgresCodecRegistry } from "./codecs-rujsdlZR.mjs";
2
+ import { n as assemblePostgresCodecRegistry } from "./control-adapter-CipVam9p-B-E2SF8_.mjs";
3
+ import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-wewzDGJh-DkJnr3kE.mjs";
4
+ import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta--MCrvIgj-DFsLFDj1.mjs";
5
5
  import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
6
6
  import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
7
7
  import { generateId } from "@prisma/orm-framework/ids/runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.mjs"],"sourcesContent":["import { r as assemblePostgresCodecRegistry } from \"./control-adapter-B9t0g7Pf.mjs\";\nimport { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from \"./adapter-DhqcO3YO.mjs\";\nimport { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-2IlVC6_d.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-CipVam9p.mjs\";\nimport { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from \"./adapter-wewzDGJh.mjs\";\nimport { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from \"./descriptor-meta--MCrvIgj.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"}
@@ -0,0 +1,2 @@
1
+ import { t as renderLoweredSql } from "./sql-renderer-Cyls5Xy4.mjs";
2
+ export { renderLoweredSql };
@@ -0,0 +1,2 @@
1
+ import { n as renderLoweredSql } from "./sql-renderer-CZE98PJj-Bx5D-Txz.mjs";
2
+ export { renderLoweredSql };
@@ -0,0 +1,10 @@
1
+ import { SqlAggregateDescriptor } from "@prisma/orm-family-sql/relational-core/aggregate-descriptor-registry";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/aggregates.d.mts
3
+ //#region src/core/aggregates.d.ts
4
+ /**
5
+ * 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.
6
+ */
7
+ declare const postgresAggregateDescriptors: ReadonlyArray<SqlAggregateDescriptor>;
8
+ //#endregion
9
+ export { postgresAggregateDescriptors as t };
10
+ //# sourceMappingURL=aggregates-CgqNfj2O.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregates-CgqNfj2O.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/aggregates.d.mts"],"mappings":";;;;;;cAKc,8BAA8B,cAAc"}
@@ -0,0 +1,102 @@
1
+ import { A as SQL_INT_CODEC_ID, C as PG_TIMETZ_CODEC_ID, D as PG_VARCHAR_CODEC_ID, M as SQL_TIMESTAMP_CODEC_ID, N as SQL_VARCHAR_CODEC_ID, S as PG_TIMESTAMP_CODEC_ID, a as PG_DATE_CODEC_ID, b as PG_TEXT_CODEC_ID, c as PG_FLOAT8_CODEC_ID, d as PG_INT2_CODEC_ID, f as PG_INT4_CODEC_ID, h as PG_INT_CODEC_ID, k as SQL_FLOAT_CODEC_ID, l as PG_FLOAT_CODEC_ID, m as PG_INTERVAL_CODEC_ID, p as PG_INT8_CODEC_ID, s as PG_FLOAT4_CODEC_ID, u as PG_INET_CODEC_ID, v as PG_NUMERIC_CODEC_ID, w as PG_TIME_CODEC_ID, x as PG_TIMESTAMPTZ_CODEC_ID, y as PG_TEXT_ARRAY_CODEC_ID } from "./codec-ids-tX7Svtz--BuOfRaVU.mjs";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/aggregates.mjs
3
+ const overCodec = (codecId) => ({
4
+ kind: "codec",
5
+ codecId
6
+ });
7
+ const overTrait = (trait) => ({
8
+ kind: "trait",
9
+ trait
10
+ });
11
+ /**
12
+ * 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)`.
13
+ */
14
+ const preservesInput = (operation, input) => ({
15
+ operation,
16
+ input,
17
+ output: { kind: "self" },
18
+ nullable: true
19
+ });
20
+ /**
21
+ * 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.
22
+ */
23
+ const produces = (operation, input, codecId) => ({
24
+ operation,
25
+ input,
26
+ output: {
27
+ kind: "codec",
28
+ codecId
29
+ },
30
+ nullable: true
31
+ });
32
+ /** Integer codecs whose `sum` widens to `bigint` — every built-in integer bar `int8`, whose sum goes to `numeric` instead. */
33
+ const SUM_WIDENS_TO_INT8 = [
34
+ PG_INT2_CODEC_ID,
35
+ PG_INT4_CODEC_ID,
36
+ PG_INT_CODEC_ID,
37
+ SQL_INT_CODEC_ID
38
+ ];
39
+ /** Every built-in integer codec: `avg` over any of them is `numeric`. */
40
+ const AVG_IS_NUMERIC = [...SUM_WIDENS_TO_INT8, PG_INT8_CODEC_ID];
41
+ /** Codecs over `double precision`, whose `sum` and `avg` stay there. */
42
+ const DOUBLE_PRECISION_CODECS = [
43
+ PG_FLOAT8_CODEC_ID,
44
+ PG_FLOAT_CODEC_ID,
45
+ SQL_FLOAT_CODEC_ID
46
+ ];
47
+ /**
48
+ * 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.
49
+ */
50
+ const MIN_MAX_PRESERVING_CODECS = [
51
+ PG_DATE_CODEC_ID,
52
+ PG_TIMESTAMP_CODEC_ID,
53
+ SQL_TIMESTAMP_CODEC_ID,
54
+ PG_TIMESTAMPTZ_CODEC_ID,
55
+ PG_TIME_CODEC_ID,
56
+ PG_TIMETZ_CODEC_ID,
57
+ PG_INTERVAL_CODEC_ID,
58
+ PG_INET_CODEC_ID,
59
+ PG_TEXT_ARRAY_CODEC_ID
60
+ ];
61
+ /**
62
+ * `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.
63
+ */
64
+ const MIN_MAX_WIDENS_TO_TEXT = [PG_VARCHAR_CODEC_ID, SQL_VARCHAR_CODEC_ID];
65
+ const orderingDescriptors = (operation) => [
66
+ preservesInput(operation, overTrait("numeric")),
67
+ preservesInput(operation, overTrait("textual")),
68
+ ...MIN_MAX_WIDENS_TO_TEXT.map((codecId) => produces(operation, overCodec(codecId), PG_TEXT_CODEC_ID)),
69
+ ...MIN_MAX_PRESERVING_CODECS.map((codecId) => preservesInput(operation, overCodec(codecId)))
70
+ ];
71
+ /**
72
+ * 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.
73
+ */
74
+ const postgresAggregateDescriptors = [
75
+ {
76
+ operation: "count",
77
+ input: { kind: "any" },
78
+ output: {
79
+ kind: "codec",
80
+ codecId: PG_INT8_CODEC_ID
81
+ },
82
+ nullable: false
83
+ },
84
+ ...SUM_WIDENS_TO_INT8.map((codecId) => produces("sum", overCodec(codecId), PG_INT8_CODEC_ID)),
85
+ produces("sum", overCodec(PG_INT8_CODEC_ID), PG_NUMERIC_CODEC_ID),
86
+ produces("sum", overCodec(PG_FLOAT4_CODEC_ID), PG_FLOAT4_CODEC_ID),
87
+ ...DOUBLE_PRECISION_CODECS.map((codecId) => produces("sum", overCodec(codecId), PG_FLOAT8_CODEC_ID)),
88
+ produces("sum", overCodec(PG_NUMERIC_CODEC_ID), PG_NUMERIC_CODEC_ID),
89
+ produces("sum", overCodec(PG_INTERVAL_CODEC_ID), PG_INTERVAL_CODEC_ID),
90
+ produces("sum", overCodec(PG_TIME_CODEC_ID), PG_INTERVAL_CODEC_ID),
91
+ ...AVG_IS_NUMERIC.map((codecId) => produces("avg", overCodec(codecId), PG_NUMERIC_CODEC_ID)),
92
+ ...[PG_FLOAT4_CODEC_ID, ...DOUBLE_PRECISION_CODECS].map((codecId) => produces("avg", overCodec(codecId), PG_FLOAT8_CODEC_ID)),
93
+ produces("avg", overCodec(PG_NUMERIC_CODEC_ID), PG_NUMERIC_CODEC_ID),
94
+ produces("avg", overCodec(PG_INTERVAL_CODEC_ID), PG_INTERVAL_CODEC_ID),
95
+ produces("avg", overCodec(PG_TIME_CODEC_ID), PG_INTERVAL_CODEC_ID),
96
+ ...orderingDescriptors("min"),
97
+ ...orderingDescriptors("max")
98
+ ];
99
+ //#endregion
100
+ export { postgresAggregateDescriptors as t };
101
+
102
+ //# sourceMappingURL=aggregates-ftUgi-eC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregates-ftUgi-eC.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/aggregates.mjs"],"sourcesContent":["import { A as SQL_INT_CODEC_ID, C as PG_TIMETZ_CODEC_ID, D as PG_VARCHAR_CODEC_ID, M as SQL_TIMESTAMP_CODEC_ID, N as SQL_VARCHAR_CODEC_ID, S as PG_TIMESTAMP_CODEC_ID, a as PG_DATE_CODEC_ID, b as PG_TEXT_CODEC_ID, c as PG_FLOAT8_CODEC_ID, d as PG_INT2_CODEC_ID, f as PG_INT4_CODEC_ID, h as PG_INT_CODEC_ID, k as SQL_FLOAT_CODEC_ID, l as PG_FLOAT_CODEC_ID, m as PG_INTERVAL_CODEC_ID, p as PG_INT8_CODEC_ID, s as PG_FLOAT4_CODEC_ID, u as PG_INET_CODEC_ID, v as PG_NUMERIC_CODEC_ID, w as PG_TIME_CODEC_ID, x as PG_TIMESTAMPTZ_CODEC_ID, y as PG_TEXT_ARRAY_CODEC_ID } from \"./codec-ids-tX7Svtz-.mjs\";\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/** Integer codecs whose `sum` widens to `bigint` — every built-in integer bar `int8`, 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/** Every built-in integer codec: `avg` over any of them is `numeric`. */\nconst AVG_IS_NUMERIC = [...SUM_WIDENS_TO_INT8, PG_INT8_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_DATE_CODEC_ID,\n\tPG_TIMESTAMP_CODEC_ID,\n\tSQL_TIMESTAMP_CODEC_ID,\n\tPG_TIMESTAMPTZ_CODEC_ID,\n\tPG_TIME_CODEC_ID,\n\tPG_TIMETZ_CODEC_ID,\n\tPG_INTERVAL_CODEC_ID,\n\tPG_INET_CODEC_ID,\n\tPG_TEXT_ARRAY_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_CODEC_ID\n\t\t},\n\t\tnullable: false\n\t},\n\t...SUM_WIDENS_TO_INT8.map((codecId) => produces(\"sum\", overCodec(codecId), PG_INT8_CODEC_ID)),\n\tproduces(\"sum\", overCodec(PG_INT8_CODEC_ID), PG_NUMERIC_CODEC_ID),\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_INTERVAL_CODEC_ID), PG_INTERVAL_CODEC_ID),\n\tproduces(\"sum\", overCodec(PG_TIME_CODEC_ID), PG_INTERVAL_CODEC_ID),\n\t...AVG_IS_NUMERIC.map((codecId) => produces(\"avg\", overCodec(codecId), PG_NUMERIC_CODEC_ID)),\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_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":";;AAEA,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,YAAY,WAAW,OAAO,aAAa;CAChD;CACA;CACA,QAAQ;EACP,MAAM;EACN;CACD;CACA,UAAU;AACX;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;AACD;;AAEA,MAAM,iBAAiB,CAAC,GAAG,oBAAoB,gBAAgB;;AAE/D,MAAM,0BAA0B;CAC/B;CACA;CACA;AACD;;;;AAIA,MAAM,4BAA4B;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;AAIA,MAAM,yBAAyB,CAAC,qBAAqB,oBAAoB;AACzE,MAAM,uBAAuB,cAAc;CAC1C,eAAe,WAAW,UAAU,SAAS,CAAC;CAC9C,eAAe,WAAW,UAAU,SAAS,CAAC;CAC9C,GAAG,uBAAuB,KAAK,YAAY,SAAS,WAAW,UAAU,OAAO,GAAG,gBAAgB,CAAC;CACpG,GAAG,0BAA0B,KAAK,YAAY,eAAe,WAAW,UAAU,OAAO,CAAC,CAAC;AAC5F;;;;AAIA,MAAM,+BAA+B;CACpC;EACC,WAAW;EACX,OAAO,EAAE,MAAM,MAAM;EACrB,QAAQ;GACP,MAAM;GACN,SAAS;EACV;EACA,UAAU;CACX;CACA,GAAG,mBAAmB,KAAK,YAAY,SAAS,OAAO,UAAU,OAAO,GAAG,gBAAgB,CAAC;CAC5F,SAAS,OAAO,UAAU,gBAAgB,GAAG,mBAAmB;CAChE,SAAS,OAAO,UAAU,kBAAkB,GAAG,kBAAkB;CACjE,GAAG,wBAAwB,KAAK,YAAY,SAAS,OAAO,UAAU,OAAO,GAAG,kBAAkB,CAAC;CACnG,SAAS,OAAO,UAAU,mBAAmB,GAAG,mBAAmB;CACnE,SAAS,OAAO,UAAU,oBAAoB,GAAG,oBAAoB;CACrE,SAAS,OAAO,UAAU,gBAAgB,GAAG,oBAAoB;CACjE,GAAG,eAAe,KAAK,YAAY,SAAS,OAAO,UAAU,OAAO,GAAG,mBAAmB,CAAC;CAC3F,GAAG,CAAC,oBAAoB,GAAG,uBAAuB,CAAC,CAAC,KAAK,YAAY,SAAS,OAAO,UAAU,OAAO,GAAG,kBAAkB,CAAC;CAC5H,SAAS,OAAO,UAAU,mBAAmB,GAAG,mBAAmB;CACnE,SAAS,OAAO,UAAU,oBAAoB,GAAG,oBAAoB;CACrE,SAAS,OAAO,UAAU,gBAAgB,GAAG,oBAAoB;CACjE,GAAG,oBAAoB,KAAK;CAC5B,GAAG,oBAAoB,KAAK;AAC7B"}
@@ -1,5 +1,5 @@
1
- import { a as postgresCodec, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs";
2
1
  import { C as PG_TIMETZ_CODEC_ID, D as PG_VARCHAR_CODEC_ID, E as PG_VARBIT_CODEC_ID, S as PG_TIMESTAMP_CODEC_ID, T as PG_UUID_CODEC_ID, _ as PG_JSON_CODEC_ID, a as PG_DATE_CODEC_ID, b as PG_TEXT_CODEC_ID, c as PG_FLOAT8_CODEC_ID, d as PG_INT2_CODEC_ID, f as PG_INT4_CODEC_ID, g as PG_JSONB_CODEC_ID, h as PG_INT_CODEC_ID, i as PG_CHAR_CODEC_ID, l as PG_FLOAT_CODEC_ID, m as PG_INTERVAL_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_ENUM_CODEC_ID, p as PG_INT8_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_FLOAT4_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INET_CODEC_ID, v as PG_NUMERIC_CODEC_ID, w as PG_TIME_CODEC_ID, x as PG_TIMESTAMPTZ_CODEC_ID, y as PG_TEXT_ARRAY_CODEC_ID } from "./codec-ids-tX7Svtz--BuOfRaVU.mjs";
2
+ import { a as postgresCodec, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs";
3
3
  import { n as postgresError } from "./errors-kYxOQjdD-D4T3rbVp.mjs";
4
4
  import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
5
5
  import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, OrExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlVarcharCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlTextDescriptor, sqlTimestampDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
@@ -1483,4 +1483,4 @@ const codecDescriptors = definePostgresCodecs([
1483
1483
  //#endregion
1484
1484
  export { pgTimestamptzColumn as C, pgVarcharColumn as D, pgVarbitColumn as E, postgresQualifyColumnType as O, pgTimestampColumn as S, pgUuidColumn as T, pgJsonColumn as _, pgCharColumn as a, pgTextColumn as b, pgFloat4Column as c, pgInetColumn as d, pgInt2Column as f, pgIntervalColumn as g, pgIntColumn as h, pgBoolColumn as i, pgFloat8Column as l, pgInt8Column as m, isPgEnumParams as n, pgDateColumn as o, pgInt4Column as p, pgBitColumn as r, pgEnumDescriptor as s, codecDescriptors as t, pgFloatColumn as u, pgJsonbColumn as v, pgTimetzColumn as w, pgTimeColumn as x, pgNumericColumn as y };
1485
1485
 
1486
- //# sourceMappingURL=codecs-CBl0nD44-CaWPc1bd.mjs.map
1486
+ //# sourceMappingURL=codecs-CBl0nD44-CjInu_aV.mjs.map