@prisma/orm-target-postgres 8.0.0-rc.8-dev.16 → 8.0.0-rc.8-dev.17

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 (56) hide show
  1. package/dist/{adapter-CN1viBBx-EQPdOwKw.mjs → adapter-BO4-D_sb-Dv6OpO1E.mjs} +4 -4
  2. package/dist/{adapter-CN1viBBx-EQPdOwKw.mjs.map → adapter-BO4-D_sb-Dv6OpO1E.mjs.map} +1 -1
  3. package/dist/{adapter-CPesdzv0.d.mts → adapter-BQrsKoUs.d.mts} +2 -2
  4. package/dist/{adapter-CPesdzv0.d.mts.map → adapter-BQrsKoUs.d.mts.map} +1 -1
  5. package/dist/adapter.d.mts +6 -6
  6. package/dist/adapter.mjs +3 -3
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +1 -1
  9. package/dist/adapter__control.d.mts +1 -1
  10. package/dist/adapter__control.mjs +2 -2
  11. package/dist/adapter__control.mjs.map +1 -1
  12. package/dist/adapter__runtime.d.mts +1 -1
  13. package/dist/adapter__runtime.mjs +3 -3
  14. package/dist/adapter__runtime.mjs.map +1 -1
  15. package/dist/adapter__sql-renderer.d.mts +1 -1
  16. package/dist/adapter__sql-renderer.mjs +1 -1
  17. package/dist/adapter__types.d.mts +2 -2
  18. package/dist/{check-expressions-DRgG8RN5-DiA-22aC.d.mts → check-expressions-D4R7JhiZ-q-dFPGT2.d.mts} +7 -9
  19. package/dist/check-expressions-D4R7JhiZ-q-dFPGT2.d.mts.map +1 -0
  20. package/dist/{check-expressions-B3Xp6IFg-BzCFYrC9.mjs → check-expressions-DFTeR0rd-CSxSpyMV.mjs} +13 -10
  21. package/dist/check-expressions-DFTeR0rd-CSxSpyMV.mjs.map +1 -0
  22. package/dist/{control-Cak3bYTc.mjs → control-8vja0qTt.mjs} +3 -3
  23. package/dist/{control-Cak3bYTc.mjs.map → control-8vja0qTt.mjs.map} +1 -1
  24. package/dist/{control-adapter-BooAiwn7-Dvrq9-1t.mjs → control-adapter-BM70RkWS-kIC873DD.mjs} +3 -3
  25. package/dist/{control-adapter-BooAiwn7-Dvrq9-1t.mjs.map → control-adapter-BM70RkWS-kIC873DD.mjs.map} +1 -1
  26. package/dist/{control-DLTOAEHj.d.mts → control-xdW1bgaP.d.mts} +3 -3
  27. package/dist/{control-DLTOAEHj.d.mts.map → control-xdW1bgaP.d.mts.map} +1 -1
  28. package/dist/{descriptor-meta-CTUYG3H7-BupKx02f.mjs → descriptor-meta-DcyEqysx-CR7vdo-V.mjs} +3 -3
  29. package/dist/{descriptor-meta-CTUYG3H7-BupKx02f.mjs.map → descriptor-meta-DcyEqysx-CR7vdo-V.mjs.map} +1 -1
  30. package/dist/{descriptor-meta-DM5W6DNx-NUe3nNdU.mjs → descriptor-meta-zQNj82MZ-CDwEiYdj.mjs} +3 -3
  31. package/dist/{descriptor-meta-DM5W6DNx-NUe3nNdU.mjs.map → descriptor-meta-zQNj82MZ-CDwEiYdj.mjs.map} +1 -1
  32. package/dist/{pack-D56Ming6.d.mts → pack-DzIekb44.d.mts} +2 -2
  33. package/dist/{pack-D56Ming6.d.mts.map → pack-DzIekb44.d.mts.map} +1 -1
  34. package/dist/{runtime-DOXznQe0.d.mts → runtime-BdRKoWQu.d.mts} +2 -2
  35. package/dist/{runtime-DOXznQe0.d.mts.map → runtime-BdRKoWQu.d.mts.map} +1 -1
  36. package/dist/{sql-renderer-BgC0ZgLS.d.mts → sql-renderer-Cshx9dNa.d.mts} +2 -2
  37. package/dist/{sql-renderer-BgC0ZgLS.d.mts.map → sql-renderer-Cshx9dNa.d.mts.map} +1 -1
  38. package/dist/{sql-renderer-BmPxq1fp-BfTrsyXT.mjs → sql-renderer-DMMtw8lD-K9zLsg-g.mjs} +6 -80
  39. package/dist/sql-renderer-DMMtw8lD-K9zLsg-g.mjs.map +1 -0
  40. package/dist/target.d.mts +3 -3
  41. package/dist/target.mjs +2 -2
  42. package/dist/target__control.mjs +1 -1
  43. package/dist/target__pack.d.mts +1 -1
  44. package/dist/target__pack.mjs +1 -1
  45. package/dist/target__types.d.mts +2 -2
  46. package/dist/target__types.mjs +1 -1
  47. package/dist/{types-CjGjPLr5.d.mts → types-B4IkFolc.d.mts} +2 -2
  48. package/dist/{types-CjGjPLr5.d.mts.map → types-B4IkFolc.d.mts.map} +1 -1
  49. package/dist/types-C7BEZmFD.d.mts +1 -0
  50. package/dist/{types-CkryN1AS-BcQRGsDn.d.mts → types-CkryN1AS-CZtzRJFZ.d.mts} +2 -2
  51. package/dist/{types-CkryN1AS-BcQRGsDn.d.mts.map → types-CkryN1AS-CZtzRJFZ.d.mts.map} +1 -1
  52. package/package.json +9 -9
  53. package/dist/check-expressions-B3Xp6IFg-BzCFYrC9.mjs.map +0 -1
  54. package/dist/check-expressions-DRgG8RN5-DiA-22aC.d.mts.map +0 -1
  55. package/dist/sql-renderer-BmPxq1fp-BfTrsyXT.mjs.map +0 -1
  56. package/dist/types-B-4d5_4a.d.mts +0 -1
@@ -1,8 +1,8 @@
1
- import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-BmPxq1fp-BfTrsyXT.mjs";
2
- import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-BooAiwn7-Dvrq9-1t.mjs";
1
+ import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-DMMtw8lD-K9zLsg-g.mjs";
2
+ import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-BM70RkWS-kIC873DD.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-CN1viBBx.mjs
5
+ //#region ../../../3-targets/6-adapters/postgres/dist/adapter-BO4-D_sb.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-CN1viBBx-EQPdOwKw.mjs.map
95
+ //# sourceMappingURL=adapter-BO4-D_sb-Dv6OpO1E.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter-CN1viBBx-EQPdOwKw.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-CN1viBBx.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-BmPxq1fp.mjs\";\nimport { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from \"./control-adapter-BooAiwn7.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-CN1viBBx.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-BO4-D_sb-Dv6OpO1E.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-BO4-D_sb.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-DMMtw8lD.mjs\";\nimport { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from \"./control-adapter-BM70RkWS.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-BO4-D_sb.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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AwC,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,5 +1,5 @@
1
1
  import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
2
- import { c as PostgresCodecRegistry, l as PostgresLoweredStatement, s as PostgresAdapterOptions } from "./types-CkryN1AS-BcQRGsDn.mjs";
2
+ import { c as PostgresCodecRegistry, l as PostgresLoweredStatement, s as PostgresAdapterOptions } from "./types-CkryN1AS-CZtzRJFZ.mjs";
3
3
  import { h as PostgresDdlNode } from "./nodes-BU-V-aZA-RqwPH68u.mjs";
4
4
  import "./ddl-B4Rh8ntj.mjs";
5
5
  import { Adapter, AdapterProfile, AnyQueryAst, LowererContext } from "@prisma/orm-family-sql/relational-core/ast";
@@ -23,4 +23,4 @@ declare const postgresRawCodecInferer: RawCodecInferer;
23
23
  declare function createPostgresAdapter(options?: PostgresAdapterOptions): Readonly<PostgresAdapterImpl>;
24
24
  //#endregion
25
25
  export { postgresRawCodecInferer as n, createPostgresAdapter as t };
26
- //# sourceMappingURL=adapter-CPesdzv0.d.mts.map
26
+ //# sourceMappingURL=adapter-BQrsKoUs.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter-CPesdzv0.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter.d.mts"],"mappings":";;;;;;;;cAKc,+BAA+B,QAAQ,aAAa,kBAAkB;WACzE;WACA;WACA,SAAS;mBACD;EACjB,YAAY,eAAe,uBAAuB;EAClD,MAAM,KAAK,cAAc,iBAAiB,SAAS,eAAe,oBAAoB;;;;;;;cAO1E,yBAAyB;iBACtB,sBAAsB,UAAU,yBAAyB,SAAS"}
1
+ {"version":3,"file":"adapter-BQrsKoUs.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter.d.mts"],"mappings":";;;;;;;;cAKc,+BAA+B,QAAQ,aAAa,kBAAkB;WACzE;WACA;WACA,SAAS;mBACD;EACjB,YAAY,eAAe,uBAAuB;EAClD,MAAM,KAAK,cAAc,iBAAiB,SAAS,eAAe,oBAAoB;;;;;;;cAO1E,yBAAyB;iBACtB,sBAAsB,UAAU,yBAAyB,SAAS"}
@@ -1,13 +1,13 @@
1
1
  import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
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
- import { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-CPesdzv0.mjs";
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-CZtzRJFZ.mjs";
3
+ import { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-BQrsKoUs.mjs";
4
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";
8
- import { n as createPostgresBuiltinCodecLookup, r as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-DLTOAEHj.mjs";
8
+ import { n as createPostgresBuiltinCodecLookup, r as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-xdW1bgaP.mjs";
9
9
  import { t as QueryOperationTypes } from "./operation-types-BfRocNI8.mjs";
10
- import { t as SqlRuntimeAdapter } from "./runtime-DOXznQe0.mjs";
11
- import { t as renderLoweredSql } from "./sql-renderer-BgC0ZgLS.mjs";
12
- import "./types-B-4d5_4a.mjs";
10
+ import { t as SqlRuntimeAdapter } from "./runtime-BdRKoWQu.mjs";
11
+ import { t as renderLoweredSql } from "./sql-renderer-Cshx9dNa.mjs";
12
+ import "./types-C7BEZmFD.mjs";
13
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
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-BmPxq1fp-BfTrsyXT.mjs";
5
- import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-BooAiwn7-Dvrq9-1t.mjs";
6
- import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-CN1viBBx-EQPdOwKw.mjs";
4
+ import { n as renderLoweredSql } from "./sql-renderer-DMMtw8lD-K9zLsg-g.mjs";
5
+ import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-BM70RkWS-kIC873DD.mjs";
6
+ import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-BO4-D_sb-Dv6OpO1E.mjs";
7
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
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 { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-CPesdzv0.mjs";
1
+ import { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-BQrsKoUs.mjs";
2
2
  export { createPostgresAdapter, postgresRawCodecInferer };
@@ -1,2 +1,2 @@
1
- import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-CN1viBBx-EQPdOwKw.mjs";
1
+ import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-BO4-D_sb-Dv6OpO1E.mjs";
2
2
  export { createPostgresAdapter, postgresRawCodecInferer };
@@ -1,5 +1,5 @@
1
1
  import { t as parsePostgresDefault } from "./default-normalizer-B36TOul4.mjs";
2
2
  import { t as normalizeSchemaNativeType } from "./native-type-normalizer-DqJlOTeX.mjs";
3
3
  import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DW6fkczF.mjs";
4
- import { i as postgresAdapterDescriptor, n as createPostgresBuiltinCodecLookup, r as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-DLTOAEHj.mjs";
4
+ import { i as postgresAdapterDescriptor, n as createPostgresBuiltinCodecLookup, r as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-xdW1bgaP.mjs";
5
5
  export { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };
@@ -2,8 +2,8 @@ import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sq
2
2
  import { t as parsePostgresDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
3
3
  import { r as instantNowControlDescriptor } from "./authoring-BP1g8vkt-BTMgtNw-.mjs";
4
4
  import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
5
- import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-BooAiwn7-Dvrq9-1t.mjs";
6
- import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-DM5W6DNx-NUe3nNdU.mjs";
5
+ import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-BM70RkWS-kIC873DD.mjs";
6
+ import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-zQNj82MZ-CDwEiYdj.mjs";
7
7
  import { timestampNowControlDescriptor } from "@prisma/orm-family-sql/family/control";
8
8
  import { int, num, oneOf, optional, str } from "@prisma/orm-framework/psl-parser";
9
9
  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 { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from \"./control-adapter-BooAiwn7.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-DM5W6DNx.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,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AM;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,MAAM,CAAC;GACN,MAAM;GACN,M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T,SAAS;GACT,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY;GACZ,YAAY,EAAE,WAAW;IACxB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;CACA,mBAAmB;EAClB,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,YAAY;EACX,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;AACD;AACA,MAAM,yBAAyB;CAC9B,GAAG;CACH,GAAG;AACJ;AACA,SAAS,wCAAwC;CAChD,OAAO,IAAI,IAAI,sCAAsC;AACtD;AACA,SAAS,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
+ {"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-BM70RkWS.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-zQNj82MZ.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,OAAO;AAClC;AACA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5D,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,2 +1,2 @@
1
- import { n as postgresRuntimeAdapterDescriptor, t as SqlRuntimeAdapter } from "./runtime-DOXznQe0.mjs";
1
+ import { n as postgresRuntimeAdapterDescriptor, t as SqlRuntimeAdapter } from "./runtime-BdRKoWQu.mjs";
2
2
  export { SqlRuntimeAdapter, postgresRuntimeAdapterDescriptor as default };
@@ -1,8 +1,8 @@
1
1
  import { n as postgresCodecRegistry } from "./codecs-DZMfLjGe.mjs";
2
2
  import { n as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-BP1g8vkt-BTMgtNw-.mjs";
3
- import { n as assemblePostgresCodecRegistry } from "./control-adapter-BooAiwn7-Dvrq9-1t.mjs";
4
- import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-CN1viBBx-EQPdOwKw.mjs";
5
- import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta-DM5W6DNx-NUe3nNdU.mjs";
3
+ import { n as assemblePostgresCodecRegistry } from "./control-adapter-BM70RkWS-kIC873DD.mjs";
4
+ import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-BO4-D_sb-Dv6OpO1E.mjs";
5
+ import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta-zQNj82MZ-CDwEiYdj.mjs";
6
6
  import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
7
7
  import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
8
8
  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 { n as assemblePostgresCodecRegistry } from \"./control-adapter-BooAiwn7.mjs\";\nimport { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from \"./adapter-CN1viBBx.mjs\";\nimport { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-DM5W6DNx.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
+ {"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.mjs"],"sourcesContent":["import { n as assemblePostgresCodecRegistry } from \"./control-adapter-BM70RkWS.mjs\";\nimport { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from \"./adapter-BO4-D_sb.mjs\";\nimport { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-zQNj82MZ.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 { t as renderLoweredSql } from "./sql-renderer-BgC0ZgLS.mjs";
1
+ import { t as renderLoweredSql } from "./sql-renderer-Cshx9dNa.mjs";
2
2
  export { renderLoweredSql };
@@ -1,2 +1,2 @@
1
- import { n as renderLoweredSql } from "./sql-renderer-BmPxq1fp-BfTrsyXT.mjs";
1
+ import { n as renderLoweredSql } from "./sql-renderer-DMMtw8lD-K9zLsg-g.mjs";
2
2
  export { renderLoweredSql };
@@ -1,4 +1,4 @@
1
1
  import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
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
- import "./types-B-4d5_4a.mjs";
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-CZtzRJFZ.mjs";
3
+ import "./types-C7BEZmFD.mjs";
4
4
  export type { BinaryExpr, ColumnRef, Direction, Expr, OrderClause, ParamRef, PostgresAdapterOptions, PostgresCodecRegistry, PostgresContract, PostgresLoweredStatement, SelectAst, StorageColumn, StorageTable };
@@ -1,5 +1,5 @@
1
1
  import { CheckKind } from "@prisma/orm-family-sql/schema-ir/naming";
2
- //#region ../../../3-targets/3-targets/postgres/dist/check-expressions-DRgG8RN5.d.mts
2
+ //#region ../../../3-targets/3-targets/postgres/dist/check-expressions-D4R7JhiZ.d.mts
3
3
  //#region src/core/check-expressions.d.ts
4
4
  /**
5
5
  * What a rendered check enforces. The contract builder turns this into the
@@ -18,7 +18,7 @@ interface PostgresCheckExpressionInput {
18
18
  readonly tableName: string;
19
19
  readonly columnName: string;
20
20
  readonly many: boolean;
21
- readonly memberValues: readonly string[] | undefined;
21
+ readonly memberValues: readonly (string | number)[] | undefined;
22
22
  }
23
23
  /**
24
24
  * A check the target wants written. The target contributes only what it
@@ -36,19 +36,17 @@ interface PostgresCheckExpressionCandidate {
36
36
  /**
37
37
  * Renders the checks a Postgres column needs, as opaque predicate text.
38
38
  *
39
- * A text-backed domain enum has no type-level enforcement, so membership is a
39
+ * A domain enum has no type-level enforcement, so membership is a
40
40
  * predicate: `IN` for a scalar, and `<@` containment for an array — an array
41
41
  * column cannot use `IN` at all (`operator does not exist: text[] = text`),
42
42
  * and containment additionally rejects NULL elements. Every list column also
43
43
  * gets an element-non-null check, which no Postgres column type can express.
44
44
  *
45
- * The array side casts the COLUMN to `text[]` rather than assuming its element
46
- * type already is: `<@` needs both operands in one type, so a `varchar[]` or
47
- * `char[]` column meeting a bare `text[]` literal raises the same
48
- * `operator does not exist` this project exists to eliminate. The scalar `IN`
49
- * form needs no cast — `varchar = text` resolves on its own.
45
+ * Array containment casts both operands to `numeric[]` for numeric members or
46
+ * `text[]` for string members, so different storage types share an operator
47
+ * without comparing numbers as text. The scalar `IN` form needs no cast.
50
48
  */
51
49
  declare function postgresRenderCheckExpressions(input: PostgresCheckExpressionInput): readonly PostgresCheckExpressionCandidate[];
52
50
  //#endregion
53
51
  export { postgresRenderCheckExpressions as i, PostgresCheckExpressionInput as n, PostgresCheckKind as r, PostgresCheckExpressionCandidate as t };
54
- //# sourceMappingURL=check-expressions-DRgG8RN5-DiA-22aC.d.mts.map
52
+ //# sourceMappingURL=check-expressions-D4R7JhiZ-q-dFPGT2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-expressions-D4R7JhiZ-q-dFPGT2.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-D4R7JhiZ.d.mts"],"mappings":";;;;;;;;;KAQK,oBAAoB;;;;;;;UAOf;WACC;WACA;WACA;WACA;;;;;;;;UAQD;WACC,MAAM;;WAEN;;WAEA;;;;;;;;;;;;;;;iBAeM,+BAA+B,OAAO,wCAAwC"}
@@ -1,31 +1,34 @@
1
1
  import { r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
2
2
  import { invariant } from "@prisma/orm-framework/utils/assertions";
3
- //#region ../../../3-targets/3-targets/postgres/dist/check-expressions-B3Xp6IFg.mjs
3
+ //#region ../../../3-targets/3-targets/postgres/dist/check-expressions-DFTeR0rd.mjs
4
4
  /**
5
5
  * Renders the checks a Postgres column needs, as opaque predicate text.
6
6
  *
7
- * A text-backed domain enum has no type-level enforcement, so membership is a
7
+ * A domain enum has no type-level enforcement, so membership is a
8
8
  * predicate: `IN` for a scalar, and `<@` containment for an array — an array
9
9
  * column cannot use `IN` at all (`operator does not exist: text[] = text`),
10
10
  * and containment additionally rejects NULL elements. Every list column also
11
11
  * gets an element-non-null check, which no Postgres column type can express.
12
12
  *
13
- * The array side casts the COLUMN to `text[]` rather than assuming its element
14
- * type already is: `<@` needs both operands in one type, so a `varchar[]` or
15
- * `char[]` column meeting a bare `text[]` literal raises the same
16
- * `operator does not exist` this project exists to eliminate. The scalar `IN`
17
- * form needs no cast — `varchar = text` resolves on its own.
13
+ * Array containment casts both operands to `numeric[]` for numeric members or
14
+ * `text[]` for string members, so different storage types share an operator
15
+ * without comparing numbers as text. The scalar `IN` form needs no cast.
18
16
  */
19
17
  function postgresRenderCheckExpressions(input) {
20
18
  const candidates = [];
21
19
  const column = quoteIdentifier(input.columnName);
22
20
  if (input.memberValues !== void 0) {
23
21
  invariant(input.memberValues.length > 0, `check for "${input.tableName}"."${input.columnName}": empty member set; both authoring surfaces reject a member-less enum before rendering`);
24
- const members = input.memberValues.map((value) => `'${escapeLiteral(value)}'`).join(", ");
22
+ const members = input.memberValues.map((value) => {
23
+ if (typeof value === "string") return `'${escapeLiteral(value)}'`;
24
+ invariant(Number.isFinite(value), `check for "${input.tableName}"."${input.columnName}": non-finite numeric member`);
25
+ return String(value);
26
+ }).join(", ");
27
+ const arrayType = input.memberValues.every((value) => typeof value === "number") ? "numeric[]" : "text[]";
25
28
  candidates.push({
26
29
  kind: "membership",
27
30
  columnName: input.columnName,
28
- expression: input.many ? `${column}::text[] <@ ARRAY[${members}]::text[]` : `${column} IN (${members})`
31
+ expression: input.many ? `${column}::${arrayType} <@ ARRAY[${members}]::${arrayType}` : `${column} IN (${members})`
29
32
  });
30
33
  }
31
34
  if (input.many) candidates.push({
@@ -38,4 +41,4 @@ function postgresRenderCheckExpressions(input) {
38
41
  //#endregion
39
42
  export { postgresRenderCheckExpressions as t };
40
43
 
41
- //# sourceMappingURL=check-expressions-B3Xp6IFg-BzCFYrC9.mjs.map
44
+ //# sourceMappingURL=check-expressions-DFTeR0rd-CSxSpyMV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-expressions-DFTeR0rd-CSxSpyMV.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-DFTeR0rd.mjs"],"sourcesContent":["import { r as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-6j9YTLpr.mjs\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/core/check-expressions.ts\n/**\n* Renders the checks a Postgres column needs, as opaque predicate text.\n*\n* A domain enum has no type-level enforcement, so membership is a\n* predicate: `IN` for a scalar, and `<@` containment for an array — an array\n* column cannot use `IN` at all (`operator does not exist: text[] = text`),\n* and containment additionally rejects NULL elements. Every list column also\n* gets an element-non-null check, which no Postgres column type can express.\n*\n* Array containment casts both operands to `numeric[]` for numeric members or\n* `text[]` for string members, so different storage types share an operator\n* without comparing numbers as text. The scalar `IN` form needs no cast.\n*/\nfunction postgresRenderCheckExpressions(input) {\n\tconst candidates = [];\n\tconst column = quoteIdentifier(input.columnName);\n\tif (input.memberValues !== void 0) {\n\t\tinvariant(input.memberValues.length > 0, `check for \"${input.tableName}\".\"${input.columnName}\": empty member set; both authoring surfaces reject a member-less enum before rendering`);\n\t\tconst members = input.memberValues.map((value) => {\n\t\t\tif (typeof value === \"string\") return `'${escapeLiteral(value)}'`;\n\t\t\tinvariant(Number.isFinite(value), `check for \"${input.tableName}\".\"${input.columnName}\": non-finite numeric member`);\n\t\t\treturn String(value);\n\t\t}).join(\", \");\n\t\tconst arrayType = input.memberValues.every((value) => typeof value === \"number\") ? \"numeric[]\" : \"text[]\";\n\t\tcandidates.push({\n\t\t\tkind: \"membership\",\n\t\t\tcolumnName: input.columnName,\n\t\t\texpression: input.many ? `${column}::${arrayType} <@ ARRAY[${members}]::${arrayType}` : `${column} IN (${members})`\n\t\t});\n\t}\n\tif (input.many) candidates.push({\n\t\tkind: \"elementNotNull\",\n\t\tcolumnName: input.columnName,\n\t\texpression: `array_position(${column}, NULL) IS NULL`\n\t});\n\treturn candidates;\n}\n//#endregion\nexport { postgresRenderCheckExpressions as t };\n\n//# sourceMappingURL=check-expressions-DFTeR0rd.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,+BAA+B,OAAO;CAC9C,MAAM,aAAa,CAAC;CACpB,MAAM,SAAS,gBAAgB,MAAM,UAAU;CAC/C,IAAI,MAAM,iBAAiB,KAAK,GAAG;EAClC,UAAU,MAAM,aAAa,SAAS,GAAG,cAAc,MAAM,UAAU,KAAK,MAAM,WAAW,wFAAwF;EACrL,MAAM,UAAU,MAAM,aAAa,KAAK,UAAU;GACjD,IAAI,OAAO,UAAU,UAAU,OAAO,IAAI,cAAc,KAAK,EAAE;GAC/D,UAAU,OAAO,SAAS,KAAK,GAAG,cAAc,MAAM,UAAU,KAAK,MAAM,WAAW,6BAA6B;GACnH,OAAO,OAAO,KAAK;EACpB,CAAC,CAAC,CAAC,KAAK,IAAI;EACZ,MAAM,YAAY,MAAM,aAAa,OAAO,UAAU,OAAO,UAAU,QAAQ,IAAI,cAAc;EACjG,WAAW,KAAK;GACf,MAAM;GACN,YAAY,MAAM;GAClB,YAAY,MAAM,OAAO,GAAG,OAAO,IAAI,UAAU,YAAY,QAAQ,KAAK,cAAc,GAAG,OAAO,OAAO,QAAQ;EAClH,CAAC;CACF;CACA,IAAI,MAAM,MAAM,WAAW,KAAK;EAC/B,MAAM;EACN,YAAY,MAAM;EAClB,YAAY,kBAAkB,OAAO;CACtC,CAAC;CACD,OAAO;AACR"}
@@ -1,7 +1,7 @@
1
1
  import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
2
2
  import { n as postgresResolveDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
3
- import { t as postgresRenderCheckExpressions } from "./check-expressions-B3Xp6IFg-BzCFYrC9.mjs";
4
- import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-CTUYG3H7-BupKx02f.mjs";
3
+ import { t as postgresRenderCheckExpressions } from "./check-expressions-DFTeR0rd-CSxSpyMV.mjs";
4
+ import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-DcyEqysx-CR7vdo-V.mjs";
5
5
  import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
6
6
  import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
7
7
  import { r as renderDefaultLiteral } from "./planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs";
@@ -1456,4 +1456,4 @@ const postgresTargetDescriptor = {
1456
1456
  //#endregion
1457
1457
  export { postgresTargetDescriptor as n, postgresRenderDefault as t };
1458
1458
 
1459
- //# sourceMappingURL=control-Cak3bYTc.mjs.map
1459
+ //# sourceMappingURL=control-8vja0qTt.mjs.map