@prisma/orm-target-postgres 8.0.0-rc.5-dev.1 → 8.0.0-rc.5-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.
- package/dist/{adapter-CEEGgfaS-4MeZ7odP.mjs → adapter-fu5NLR5q-BGMHGbUv.mjs} +4 -4
- package/dist/{adapter-CEEGgfaS-4MeZ7odP.mjs.map → adapter-fu5NLR5q-BGMHGbUv.mjs.map} +1 -1
- package/dist/adapter.d.mts +2 -2
- package/dist/adapter.mjs +6 -6
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__column-types.d.mts +2 -2
- package/dist/adapter__column-types.mjs +2 -2
- package/dist/adapter__control.mjs +78 -12
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +23 -14
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{aggregates-Dh6HPdvC.mjs → aggregates-Ckjhz1o7.mjs} +15 -10
- package/dist/aggregates-Ckjhz1o7.mjs.map +1 -0
- package/dist/{authoring-BOpdZa2N-ClrLFiXw.mjs → authoring-DayoLvZs-BZzesJbW.mjs} +47 -12
- package/dist/authoring-DayoLvZs-BZzesJbW.mjs.map +1 -0
- package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs → check-expressions-B3Xp6IFg-BzCFYrC9.mjs} +3 -3
- package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs.map → check-expressions-B3Xp6IFg-BzCFYrC9.mjs.map} +1 -1
- package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts +39 -0
- package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts.map +1 -0
- package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs +39 -0
- package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs.map +1 -0
- package/dist/codec-ids-cWPqrkcF.d.mts +1 -0
- package/dist/{codec-types-BRU4F-7t-BaJbKF_i.d.mts → codec-types-X0ENu4sQ-C6GS_WDR.d.mts} +21 -9
- package/dist/codec-types-X0ENu4sQ-C6GS_WDR.d.mts.map +1 -0
- package/dist/codec-types-Zel4Dk7S.d.mts +2 -0
- package/dist/{codecs-BmPCJWqb-DveZGJvm.mjs → codecs-CxWg7WrX-DtVAuuXA.mjs} +351 -255
- package/dist/codecs-CxWg7WrX-DtVAuuXA.mjs.map +1 -0
- package/dist/{codecs-B1HgsJZ2.mjs → codecs-DZMfLjGe.mjs} +2 -2
- package/dist/codecs-DZMfLjGe.mjs.map +1 -0
- package/dist/{codecs-D8tLswBi-_nbo-Z8x.d.mts → codecs-bwX5JaME-ByuPNLC5.d.mts} +146 -86
- package/dist/codecs-bwX5JaME-ByuPNLC5.d.mts.map +1 -0
- package/dist/{codecs-DmCKO7dg.d.mts → codecs-ePpDWH7z.d.mts} +2 -2
- package/dist/codecs-ePpDWH7z.d.mts.map +1 -0
- package/dist/{column-types-BH-MU6uU.d.mts → column-types-CwjYfNCi.d.mts} +33 -7
- package/dist/column-types-CwjYfNCi.d.mts.map +1 -0
- package/dist/{column-types-Bh92dNjD.mjs → column-types-DU7C_gwa.mjs} +37 -9
- package/dist/column-types-DU7C_gwa.mjs.map +1 -0
- package/dist/{contract-free-aQ4nT-_R.mjs → contract-free-CzTZEwpt.mjs} +5 -5
- package/dist/contract-free-CzTZEwpt.mjs.map +1 -0
- package/dist/{control-2F195jJk.d.mts → control-ByalKcpe.d.mts} +2 -1
- package/dist/control-ByalKcpe.d.mts.map +1 -0
- package/dist/{control-V7OkAC55.mjs → control-CwOI5ZH9.mjs} +8 -8
- package/dist/control-CwOI5ZH9.mjs.map +1 -0
- package/dist/{control-adapter-DGLvLCp7-DaglJOfk.mjs → control-adapter-BvycZgCj-DH90lxuD.mjs} +9 -9
- package/dist/control-adapter-BvycZgCj-DH90lxuD.mjs.map +1 -0
- package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs → control-policy-HgW6zNnz-Ds9U3rSS.mjs} +6 -6
- package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs.map → control-policy-HgW6zNnz-Ds9U3rSS.mjs.map} +1 -1
- package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs → ddl-GXbCrKp_-CBKFkq1r.mjs} +4 -4
- package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs.map → ddl-GXbCrKp_-CBKFkq1r.mjs.map} +1 -1
- package/dist/{descriptor-meta-KVX21fsl-DBDoB4eg.mjs → descriptor-meta-BJvQzm-A-BdYGq2QU.mjs} +50 -21
- package/dist/descriptor-meta-BJvQzm-A-BdYGq2QU.mjs.map +1 -0
- package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs → descriptor-meta-DInZZgUC-Cq-SJvwE.mjs} +6 -6
- package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map → descriptor-meta-DInZZgUC-Cq-SJvwE.mjs.map} +1 -1
- package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs → diff-database-schema-B27W13mM-DmRNUFyg.mjs} +6 -6
- package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs.map → diff-database-schema-B27W13mM-DmRNUFyg.mjs.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__runtime.mjs +1 -1
- package/dist/{errors-CU4xIwwk.d.mts → errors-5fMq0U66.d.mts} +2 -2
- package/dist/{errors-CU4xIwwk.d.mts.map → errors-5fMq0U66.d.mts.map} +1 -1
- package/dist/errors-DYyzTYzE-39CV_aMo.mjs +92 -0
- package/dist/errors-DYyzTYzE-39CV_aMo.mjs.map +1 -0
- package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts +9 -0
- package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts.map +1 -0
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs → op-factory-call-CSkQdszU-C43tr0rP.mjs} +7 -7
- package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs.map → op-factory-call-CSkQdszU-C43tr0rP.mjs.map} +1 -1
- package/dist/{pack-CySS3DQU.d.mts → pack-DaQJIP6O.d.mts} +143 -11
- package/dist/pack-DaQJIP6O.d.mts.map +1 -0
- package/dist/{planner-D0uogzvT-1WyGIC5p.mjs → planner-CqeT-P2q-DVglsvwu.mjs} +8 -8
- package/dist/{planner-D0uogzvT-1WyGIC5p.mjs.map → planner-CqeT-P2q-DVglsvwu.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs} +5 -5
- package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs.map → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs → planner-produced-postgres-migration-Dsri3SjC-DZynrNO-.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map → planner-produced-postgres-migration-Dsri3SjC-DZynrNO-.mjs.map} +1 -1
- package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs} +4 -4
- package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs.map → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs.map} +1 -1
- package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs → postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs} +5 -5
- package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map → postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs.map} +1 -1
- package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs → postgres-migration-DHvU3Jkt-Eah72PD4.mjs} +6 -6
- package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map → postgres-migration-DHvU3Jkt-Eah72PD4.mjs.map} +1 -1
- package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs → postgres-schema-B3t7Zr52-CMlY9aGw.mjs} +4 -4
- package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs.map → postgres-schema-B3t7Zr52-CMlY9aGw.mjs.map} +1 -1
- package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs → render-ops-D2vJApKB-B281fzmn.mjs} +3 -3
- package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs.map → render-ops-D2vJApKB-B281fzmn.mjs.map} +1 -1
- package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs} +3 -3
- package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs.map → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs.map} +1 -1
- package/dist/{runtime-C-Hh2m1R.mjs → runtime-BJrfP1e8.mjs} +43 -5
- package/dist/runtime-BJrfP1e8.mjs.map +1 -0
- package/dist/{runtime-_TfO66h5.d.mts → runtime-bbCw9Omq.d.mts} +2 -1
- package/dist/runtime-bbCw9Omq.d.mts.map +1 -0
- package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs → sql-renderer-ComgusFq-DfvXlBce.mjs} +3 -3
- package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs.map → sql-renderer-ComgusFq-DfvXlBce.mjs.map} +1 -1
- package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs → sql-utils-6j9YTLpr-BCyCBPBg.mjs} +3 -3
- package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs.map → sql-utils-6j9YTLpr-BCyCBPBg.mjs.map} +1 -1
- package/dist/target.d.mts +12 -11
- package/dist/target.mjs +24 -23
- package/dist/target__aggregates.mjs +1 -1
- package/dist/target__codec-ids.d.mts +3 -3
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +4 -4
- package/dist/target__codecs.d.mts +3 -3
- package/dist/target__codecs.mjs +3 -3
- package/dist/target__contract-free.mjs +3 -3
- package/dist/target__control.d.mts +3 -2
- package/dist/target__control.mjs +3 -2
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__errors.d.mts +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner-sql-checks.mjs +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.d.mts +3 -2
- package/dist/target__runtime.mjs +3 -2
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/target__types.mjs +2 -2
- package/package.json +9 -9
- package/dist/aggregates-Dh6HPdvC.mjs.map +0 -1
- package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs.map +0 -1
- package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts +0 -35
- package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts.map +0 -1
- package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs +0 -35
- package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs.map +0 -1
- package/dist/codec-ids-DJ6j6pZc.d.mts +0 -1
- package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts.map +0 -1
- package/dist/codec-types-bX63JRLf.d.mts +0 -2
- package/dist/codecs-B1HgsJZ2.mjs.map +0 -1
- package/dist/codecs-BmPCJWqb-DveZGJvm.mjs.map +0 -1
- package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts.map +0 -1
- package/dist/codecs-DmCKO7dg.d.mts.map +0 -1
- package/dist/column-types-BH-MU6uU.d.mts.map +0 -1
- package/dist/column-types-Bh92dNjD.mjs.map +0 -1
- package/dist/contract-free-aQ4nT-_R.mjs.map +0 -1
- package/dist/control-2F195jJk.d.mts.map +0 -1
- package/dist/control-V7OkAC55.mjs.map +0 -1
- package/dist/control-adapter-DGLvLCp7-DaglJOfk.mjs.map +0 -1
- package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs.map +0 -1
- package/dist/errors-DKjQzNaN-DFcF1thx.mjs +0 -39
- package/dist/errors-DKjQzNaN-DFcF1thx.mjs.map +0 -1
- package/dist/pack-CySS3DQU.d.mts.map +0 -1
- package/dist/runtime-C-Hh2m1R.mjs.map +0 -1
- package/dist/runtime-_TfO66h5.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-sql-checks-
|
|
1
|
+
{"version":3,"file":"planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks-Bcngv5YZ.mjs"],"sourcesContent":["import { i as postgresCreateNamespace } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { r as quoteIdentifier } from \"./sql-utils-6j9YTLpr.mjs\";\nimport { t as resolveColumnTypeMetadata } from \"./planner-type-resolution-Bt2f_q-F.mjs\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\nconst FORMAT_TYPE_DISPLAY = /* @__PURE__ */ new Map([\n\t[\"int2\", \"smallint\"],\n\t[\"int4\", \"integer\"],\n\t[\"int8\", \"bigint\"],\n\t[\"float4\", \"real\"],\n\t[\"float8\", \"double precision\"],\n\t[\"bool\", \"boolean\"],\n\t[\"timestamp\", \"timestamp without time zone\"],\n\t[\"timestamptz\", \"timestamp with time zone\"],\n\t[\"time\", \"time without time zone\"],\n\t[\"timetz\", \"time with time zone\"]\n]);\nconst UNQUOTED_POSTGRES_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/;\nconst POSTGRES_RESERVED_IDENTIFIER_WORDS = /* @__PURE__ */ new Set([\n\t\"all\",\n\t\"analyse\",\n\t\"analyze\",\n\t\"and\",\n\t\"any\",\n\t\"array\",\n\t\"as\",\n\t\"asc\",\n\t\"asymmetric\",\n\t\"authorization\",\n\t\"between\",\n\t\"binary\",\n\t\"both\",\n\t\"case\",\n\t\"cast\",\n\t\"check\",\n\t\"collate\",\n\t\"column\",\n\t\"constraint\",\n\t\"create\",\n\t\"current_catalog\",\n\t\"current_date\",\n\t\"current_role\",\n\t\"current_time\",\n\t\"current_timestamp\",\n\t\"current_user\",\n\t\"default\",\n\t\"deferrable\",\n\t\"desc\",\n\t\"distinct\",\n\t\"do\",\n\t\"else\",\n\t\"end\",\n\t\"except\",\n\t\"false\",\n\t\"fetch\",\n\t\"for\",\n\t\"foreign\",\n\t\"freeze\",\n\t\"from\",\n\t\"full\",\n\t\"grant\",\n\t\"group\",\n\t\"having\",\n\t\"ilike\",\n\t\"in\",\n\t\"initially\",\n\t\"inner\",\n\t\"intersect\",\n\t\"into\",\n\t\"is\",\n\t\"isnull\",\n\t\"join\",\n\t\"lateral\",\n\t\"leading\",\n\t\"left\",\n\t\"like\",\n\t\"limit\",\n\t\"localtime\",\n\t\"localtimestamp\",\n\t\"natural\",\n\t\"not\",\n\t\"notnull\",\n\t\"null\",\n\t\"offset\",\n\t\"on\",\n\t\"only\",\n\t\"or\",\n\t\"order\",\n\t\"outer\",\n\t\"overlaps\",\n\t\"placing\",\n\t\"primary\",\n\t\"references\",\n\t\"right\",\n\t\"select\",\n\t\"session_user\",\n\t\"similar\",\n\t\"some\",\n\t\"symmetric\",\n\t\"table\",\n\t\"then\",\n\t\"to\",\n\t\"trailing\",\n\t\"true\",\n\t\"union\",\n\t\"unique\",\n\t\"user\",\n\t\"using\",\n\t\"variadic\",\n\t\"verbose\",\n\t\"when\",\n\t\"where\",\n\t\"window\",\n\t\"with\"\n]);\nfunction formatUserDefinedTypeName(identifier) {\n\tif (UNQUOTED_POSTGRES_IDENTIFIER_PATTERN.test(identifier) && !POSTGRES_RESERVED_IDENTIFIER_WORDS.has(identifier)) return identifier;\n\treturn quoteIdentifier(identifier);\n}\nfunction buildExpectedFormatType(column, codecHooks, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tif (resolved.typeParams && resolved.codecId) {\n\t\tconst hooks = codecHooks.get(resolved.codecId);\n\t\tif (hooks?.expandNativeType) return hooks.expandNativeType({\n\t\t\tnativeType: resolved.nativeType,\n\t\t\tcodecId: resolved.codecId,\n\t\t\ttypeParams: resolved.typeParams\n\t\t});\n\t}\n\tif (column.typeRef) return formatUserDefinedTypeName(resolved.nativeType);\n\treturn FORMAT_TYPE_DISPLAY.get(resolved.nativeType) ?? resolved.nativeType;\n}\n//#endregion\nexport { qualifyTableName as n, buildExpectedFormatType as t };\n\n//# sourceMappingURL=planner-sql-checks-Bcngv5YZ.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;AACA,MAAM,sCAAsC,IAAI,IAAI;CACnD,CAAC,QAAQ,UAAU;CACnB,CAAC,QAAQ,SAAS;CAClB,CAAC,QAAQ,QAAQ;CACjB,CAAC,UAAU,MAAM;CACjB,CAAC,UAAU,kBAAkB;CAC7B,CAAC,QAAQ,SAAS;CAClB,CAAC,aAAa,6BAA6B;CAC3C,CAAC,eAAe,0BAA0B;CAC1C,CAAC,QAAQ,wBAAwB;CACjC,CAAC,UAAU,qBAAqB;AACjC,CAAC;AACD,MAAM,uCAAuC;AAC7C,MAAM,qDAAqD,IAAI,IAAI;CAClE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,SAAS,0BAA0B,YAAY;CAC9C,IAAI,qCAAqC,KAAK,UAAU,KAAK,CAAC,mCAAmC,IAAI,UAAU,GAAG,OAAO;CACzH,OAAO,gBAAgB,UAAU;AAClC;AACA,SAAS,wBAAwB,QAAQ,YAAY,eAAe,CAAC,GAAG;CACvE,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,IAAI,SAAS,cAAc,SAAS,SAAS;EAC5C,MAAM,QAAQ,WAAW,IAAI,SAAS,OAAO;EAC7C,IAAI,OAAO,kBAAkB,OAAO,MAAM,iBAAiB;GAC1D,YAAY,SAAS;GACrB,SAAS,SAAS;GAClB,YAAY,SAAS;EACtB,CAAC;CACF;CACA,IAAI,OAAO,SAAS,OAAO,0BAA0B,SAAS,UAAU;CACxE,OAAO,oBAAoB,IAAI,SAAS,UAAU,KAAK,SAAS;AACjE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-
|
|
3
|
-
import {
|
|
1
|
+
import { S as PG_TEXT_CODEC_ID, _ as PG_INT_CODEC_ID } from "./codec-ids-D3ZEAmt2-DjoKUAas.mjs";
|
|
2
|
+
import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
|
|
3
|
+
import { i as postgresAuthoringEntityTypes } from "./authoring-DayoLvZs-BZzesJbW.mjs";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
5
5
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
6
6
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
@@ -9,7 +9,7 @@ import { createPreserveEmptyPredicate } from "@prisma/orm-framework/contract/has
|
|
|
9
9
|
import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
|
|
10
10
|
import { isAuthoringEntityTypeDescriptor } from "@prisma/orm-framework/components/authoring";
|
|
11
11
|
import { sqlContractCanonicalizationHooks } from "@prisma/orm-family-sql/contract/canonicalization-hooks";
|
|
12
|
-
//#region ../../../3-targets/3-targets/postgres/dist/postgres-contract-view-
|
|
12
|
+
//#region ../../../3-targets/3-targets/postgres/dist/postgres-contract-view-CzWRnkxb.mjs
|
|
13
13
|
const POSTGRES_AUTHORING_CTX = {
|
|
14
14
|
family: "sql",
|
|
15
15
|
target: "postgres",
|
|
@@ -141,4 +141,4 @@ const PostgresContractView = {
|
|
|
141
141
|
//#endregion
|
|
142
142
|
export { PostgresContractView as n, PostgresContractSerializer as t };
|
|
143
143
|
|
|
144
|
-
//# sourceMappingURL=postgres-contract-view-
|
|
144
|
+
//# sourceMappingURL=postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-contract-view-
|
|
1
|
+
{"version":3,"file":"postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-contract-view-CzWRnkxb.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID, _ as PG_INT_CODEC_ID } from \"./codec-ids-D3ZEAmt2.mjs\";\nimport { t as postgresAuthoringEntityTypes } from \"./authoring-DayoLvZs.mjs\";\nimport { a as nativeEnumEntityKind, c as roleEntityKind, o as policyEntityKind, s as rlsEnablementEntityKind, t as PostgresSchema } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { buildSqlSchemaQualifiedView } from \"@internal/sql-contract/contract-view\";\nimport { createPreserveEmptyPredicate } from \"@internal/contract/hashing-utils\";\nimport { SqlContractSerializerBase } from \"@internal/family-sql/ir\";\nimport { isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\n//#region src/core/postgres-contract-serializer.ts\nconst POSTGRES_AUTHORING_CTX = {\n\tfamily: \"sql\",\n\ttarget: \"postgres\",\n\tenumInferenceCodecs: {\n\t\ttext: PG_TEXT_CODEC_ID,\n\t\tint: PG_INT_CODEC_ID\n\t}\n};\nfunction isAuthoringEntityTypeFactoryOutput(output) {\n\treturn typeof output === \"object\" && output !== null && \"factory\" in output && typeof output.factory === \"function\";\n}\n/**\n* Walks a pack's entity-type namespace tree and emits hydration factories\n* keyed by the descriptor's `discriminator`. Used for `storage.types`\n* (codec-triple hydration). Namespace entries hydration dispatches by\n* entries key, not discriminator — handled by `hydrateNamespaceEntities`.\n*/\nfunction collectStorageTypesHydrators(namespace) {\n\tconst registry = /* @__PURE__ */ new Map();\n\tconst walk = (node) => {\n\t\tfor (const value of Object.values(node)) {\n\t\t\tif (isAuthoringEntityTypeDescriptor(value)) {\n\t\t\t\tif (isAuthoringEntityTypeFactoryOutput(value.output)) {\n\t\t\t\t\tconst { factory } = value.output;\n\t\t\t\t\tregistry.set(value.discriminator, (raw) => factory(raw, POSTGRES_AUTHORING_CTX));\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (typeof value === \"object\" && value !== null) walk(value);\n\t\t}\n\t};\n\twalk(namespace);\n\treturn registry;\n}\n/**\n* The canonicalization walk drops a field whose value equals its type's\n* default, which for a required field of an entity kind means the emitted\n* contract fails that kind's own schema on the next read (a RESTRICTIVE\n* policy's `permissive: false` is the live case). The set of fields that must\n* survive is therefore the required keys of the registered entity kinds —\n* read off the schemas rather than listed by hand, so a kind that gains a\n* required field is covered the day it gains one.\n*/\nfunction requiredEntityFieldsSurviveDefaults(kinds) {\n\treturn createPreserveEmptyPredicate(kinds.flatMap((kind) => requiredKeysOf(kind.schema).map((key) => [\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\tkind.kind,\n\t\t\"*\",\n\t\tkey\n\t])));\n}\nfunction isSchemaPropList(value) {\n\treturn Array.isArray(value) && value.every((prop) => prop !== null && (typeof prop === \"object\" || typeof prop === \"function\") && \"kind\" in prop && \"key\" in prop);\n}\nfunction requiredKeysOf(schema) {\n\tconst props = \"props\" in schema ? schema.props : void 0;\n\tif (!isSchemaPropList(props)) throw new InternalError(\"entity-kind schema does not expose arktype object props; the required-field preserve set cannot be derived\");\n\treturn props.flatMap((prop) => prop.kind === \"required\" && typeof prop.key === \"string\" ? [prop.key] : []);\n}\nvar PostgresContractSerializer = class extends SqlContractSerializerBase {\n\tshouldPreserveEmpty;\n\tconstructor(extraPackEntityKinds = []) {\n\t\tconst storageTypesHydrators = collectStorageTypesHydrators(postgresAuthoringEntityTypes);\n\t\tconst entityKinds = [\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind,\n\t\t\t...extraPackEntityKinds\n\t\t];\n\t\tsuper(storageTypesHydrators, entityKinds);\n\t\tconst preserveRequired = requiredEntityFieldsSurviveDefaults(entityKinds);\n\t\tthis.shouldPreserveEmpty = (path) => preserveRequired(path) || sqlContractCanonicalizationHooks.shouldPreserveEmpty(path);\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\tconst { id, entries } = blindCast(super.hydrateSqlNamespaceEntry(nsId, raw));\n\t\tconst allSlotsEmpty = Object.values(entries).every((slot) => slot === void 0 || Object.keys(slot).length === 0);\n\t\tif (id === UNBOUND_NAMESPACE_ID && allSlotsEmpty) return PostgresSchema.unbound;\n\t\tconst valueSetSlot = entries[\"valueSet\"];\n\t\tconst hasValueSets = valueSetSlot !== void 0 && Object.keys(valueSetSlot).length > 0;\n\t\treturn new PostgresSchema({\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\t...entries,\n\t\t\t\ttable: entries[\"table\"] ?? {},\n\t\t\t\t...hasValueSets ? { valueSet: valueSetSlot } : {}\n\t\t\t}\n\t\t});\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst isUnboundSlot = ns.id === UNBOUND_NAMESPACE_ID;\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: isUnboundSlot ? \"postgres-unbound-schema\" : \"postgres-schema\",\n\t\t\t\tentries: this.serializeNamespaceEntries(ns.entries)\n\t\t\t};\n\t\t}\n\t\tconst storageOut = {\n\t\t\tstorageHash: String(storage.storageHash),\n\t\t\tnamespaces: namespacesJson\n\t\t};\n\t\tif (storage.types !== void 0) {\n\t\t\tconst typesOut = {};\n\t\t\tfor (const [name, entry] of Object.entries(storage.types)) typesOut[name] = this.serializeJsonObject(entry);\n\t\t\tstorageOut[\"types\"] = typesOut;\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: storageOut\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/postgres-contract-view.ts\nconst PostgresContractView = {\n\t/** Wrap an already-deserialized Postgres contract in a schema-qualified view. */\n\tfrom(contract) {\n\t\treturn buildSqlSchemaQualifiedView(contract);\n\t},\n\t/** Deserialize a Postgres contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildSqlSchemaQualifiedView(new PostgresContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer as n, PostgresContractView as t };\n\n//# sourceMappingURL=postgres-contract-view-CzWRnkxb.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,yBAAyB;CAC9B,QAAQ;CACR,QAAQ;CACR,qBAAqB;EACpB,MAAM;EACN,KAAK;CACN;AACD;AACA,SAAS,mCAAmC,QAAQ;CACnD,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,aAAa,UAAU,OAAO,OAAO,YAAY;AAC1G;;;;;;;AAOA,SAAS,6BAA6B,WAAW;CAChD,MAAM,2BAA2B,IAAI,IAAI;CACzC,MAAM,QAAQ,SAAS;EACtB,KAAK,MAAM,SAAS,OAAO,OAAO,IAAI,GAAG;GACxC,IAAI,gCAAgC,KAAK,GAAG;IAC3C,IAAI,mCAAmC,MAAM,MAAM,GAAG;KACrD,MAAM,EAAE,YAAY,MAAM;KAC1B,SAAS,IAAI,MAAM,gBAAgB,QAAQ,QAAQ,KAAK,sBAAsB,CAAC;IAChF;IACA;GACD;GACA,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,KAAK,KAAK;EAC5D;CACD;CACA,KAAK,SAAS;CACd,OAAO;AACR;;;;;;;;;;AAUA,SAAS,oCAAoC,OAAO;CACnD,OAAO,6BAA6B,MAAM,SAAS,SAAS,eAAe,KAAK,MAAM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H,OAAO,QAAQ,YAAY,CAAC;IAC5B,GAAG,eAAe,EAAE,UAAU,aAAa,IAAI,CAAC;GACjD;EACD,CAAC;CACF;CACA,kBAAkB,UAAU;EAC3B,MAAM,EAAE,SAAS,GAAG,SAAS;EAC7B,MAAM,iBAAiB,CAAC;EACxB,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,QAAQ,UAAU,GAAG;GAC5D,MAAM,gBAAgB,GAAG,OAAO;GAChC,eAAe,QAAQ;IACtB,IAAI,GAAG;IACP,MAAM,gBAAgB,4BAA4B;IAClD,SAAS,KAAK,0BAA0B,GAAG,OAAO;GACnD;EACD;EACA,MAAM,aAAa;GAClB,aAAa,OAAO,QAAQ,WAAW;GACvC,YAAY;EACb;EACA,IAAI,QAAQ,UAAU,KAAK,GAAG;GAC7B,MAAM,WAAW,CAAC;GAClB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,KAAK,GAAG,SAAS,QAAQ,KAAK,oBAAoB,KAAK;GAC1G,WAAW,WAAW;EACvB;EACA,OAAO,UAAU;GAChB,GAAG;GACH,SAAS;EACV,CAAC;CACF;AACD;AAGA,MAAM,uBAAuB;;CAE5B,KAAK,UAAU;EACd,OAAO,4BAA4B,QAAQ;CAC5C;;CAEA,SAAS,MAAM;EACd,OAAO,4BAA4B,IAAI,2BAA2B,CAAC,CAAC,oBAAoB,IAAI,CAAC;CAC9F;AACD"}
|
package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs → postgres-migration-DHvU3Jkt-Eah72PD4.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as errorPostgresMigrationStackMissing } from "./errors-
|
|
2
|
-
import { i as PostgresRlsPolicy } from "./postgres-schema-
|
|
3
|
-
import { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, I as installExtension, M as SetDefaultCall, N as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-
|
|
4
|
-
import { n as PostgresContractView } from "./postgres-contract-view-
|
|
1
|
+
import { t as errorPostgresMigrationStackMissing } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
2
|
+
import { i as PostgresRlsPolicy } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
|
|
3
|
+
import { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, I as installExtension, M as SetDefaultCall, N as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-CSkQdszU-C43tr0rP.mjs";
|
|
4
|
+
import { n as PostgresContractView } from "./postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs";
|
|
5
5
|
import { t as dataTransform } from "./data-transform-ChZzy2dP-CxVCat_8.mjs";
|
|
6
6
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
7
7
|
import { Migration } from "@prisma/orm-family-sql/family/migration";
|
|
8
8
|
import { MigrationContractViews } from "@prisma/orm-toolchain/migration-tools/migration";
|
|
9
|
-
//#region ../../../3-targets/3-targets/postgres/dist/postgres-migration-
|
|
9
|
+
//#region ../../../3-targets/3-targets/postgres/dist/postgres-migration-DHvU3Jkt.mjs
|
|
10
10
|
/**
|
|
11
11
|
* Target-owned base class for Postgres migrations.
|
|
12
12
|
*
|
|
@@ -202,4 +202,4 @@ var PostgresMigration = class extends Migration {
|
|
|
202
202
|
//#endregion
|
|
203
203
|
export { PostgresMigration as t };
|
|
204
204
|
|
|
205
|
-
//# sourceMappingURL=postgres-migration-
|
|
205
|
+
//# sourceMappingURL=postgres-migration-DHvU3Jkt-Eah72PD4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs","names":["#endView","#startView"],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-migration-Dbq3RGfZ.mjs"],"sourcesContent":["import { t as errorPostgresMigrationStackMissing } from \"./errors-DKjQzNaN.mjs\";\nimport { _ as PostgresRlsPolicy } from \"./postgres-schema-CF0yHESb.mjs\";\nimport { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, L as installExtension, M as SetDefaultCall, N as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from \"./op-factory-call-H6zeDGLe.mjs\";\nimport { t as PostgresContractView } from \"./postgres-contract-view-B8ykf2cO.mjs\";\nimport { t as dataTransform } from \"./data-transform-ChZzy2dP.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { Migration } from \"@internal/family-sql/migration\";\nimport { MigrationContractViews } from \"@internal/migration-tools/migration\";\n//#region src/core/migrations/postgres-migration.ts\n/**\n* Target-owned base class for Postgres migrations.\n*\n* Fixes the `SqlMigration` generic to `PostgresPlanTargetDetails` and the\n* abstract `targetId` to the Postgres target-id string literal, so both\n* user-authored migrations and renderer-generated scaffolds (the output of\n* `renderCallsToTypeScript`) can extend `PostgresMigration` directly without\n* redeclaring target-local identity.\n*\n* Mirrors `MongoMigration` in `@internal/family-mongo`: the renderer\n* emits `extends Migration` against a facade re-export of this class\n* from `@internal/postgres/migration`, keeping the authoring surface\n* target-scoped rather than family-scoped.\n*\n* The constructor materializes a single Postgres `SqlControlAdapter` from\n* `stack.adapter.create(stack)` and stores it; the protected `dataTransform`\n* instance method forwards to the free `dataTransform` factory with that\n* stored adapter, so user migrations can write `this.dataTransform(...)`\n* without threading the adapter through every call.\n*\n* Every method requires an explicit `schema`. Postgres migrations name their\n* schema deliberately — there is no default and no `search_path`-relative\n* option. A migration that left the schema unspecified would resolve against\n* whatever `search_path` the connection happened to carry, and that ambiguity\n* is an antipattern in a migration. (The unbound/unspecified namespace concept\n* remains for SQLite, which has no schemas, and for Mongo's connection `db`.)\n*/\nvar PostgresMigration = class extends Migration {\n\ttargetId = \"postgres\";\n\t/**\n\t* Materialized Postgres control adapter, created once per migration\n\t* instance from the injected stack. `undefined` only when the migration\n\t* was instantiated without a stack (test fixtures); `controlAdapterFor`\n\t* throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING in that case to surface the misuse.\n\t*/\n\tcontrolAdapter;\n\t#endView = new MigrationContractViews(this, \"PostgresMigration\", (json) => PostgresContractView.fromJson(json));\n\t#startView = new MigrationContractViews(this, \"PostgresMigration\", (json) => PostgresContractView.fromJson(json));\n\tconstructor(stack) {\n\t\tsuper(stack);\n\t\tthis.controlAdapter = stack?.adapter ? stack.adapter.create(stack) : void 0;\n\t}\n\t/**\n\t* Returns the materialized control adapter, or throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING naming\n\t* `operation` when the migration was constructed without a `ControlStack`.\n\t* Single home for the null-check that every DDL/DML method shares.\n\t*/\n\tcontrolAdapterFor(operation) {\n\t\tif (!this.controlAdapter) throw errorPostgresMigrationStackMissing(operation);\n\t\treturn this.controlAdapter;\n\t}\n\t/**\n\t* The typed, schema-qualified Postgres view over this migration's end-state\n\t* contract — `this.endContract.namespace.<schema>.table.<name>`, etc. Throws\n\t* if no `endContractJson` was provided.\n\t*/\n\tget endContract() {\n\t\treturn this.#endView.endContract;\n\t}\n\t/**\n\t* The typed Postgres view over this migration's start-state contract, or\n\t* `null` for a baseline migration (no `startContractJson`).\n\t*/\n\tget startContract() {\n\t\treturn this.#startView.startContract;\n\t}\n\t/**\n\t* Instance-method wrapper around the free `dataTransform` factory that\n\t* supplies the stored control adapter. Authors call this from inside\n\t* `get operations()`; the adapter argument is hidden from the call site.\n\t*/\n\tdataTransform(contract, name, options) {\n\t\treturn dataTransform(contract, name, options, this.controlAdapterFor(\"dataTransform\"));\n\t}\n\t/**\n\t* Emit a `CREATE TABLE` migration operation. Builds a typed DDL node from\n\t* the supplied options and lowers it through the stored control adapter.\n\t* Throws if no adapter is present (i.e. migration instantiated without a stack).\n\t*/\n\tcreateTable(options) {\n\t\treturn new CreateTableCall(options.schema, options.table, options.columns, options.constraints).toOp(this.controlAdapterFor(\"createTable\"));\n\t}\n\t/**\n\t* Emit a `CREATE SCHEMA` migration operation. Builds a typed DDL node from\n\t* the supplied options and lowers it through the stored control adapter.\n\t* Throws if no adapter is present (i.e. migration instantiated without a stack).\n\t*/\n\tcreateSchema(options) {\n\t\treturn new CreateSchemaCall(options.schema).toOp(this.controlAdapterFor(\"createSchema\"));\n\t}\n\t/**\n\t* Emit a `CREATE TYPE ... AS ENUM (...)` migration operation for a managed\n\t* native enum. Builds a typed DDL node and lowers it through the stored\n\t* control adapter (members render in declaration order). Throws if no adapter\n\t* is present.\n\t*/\n\tcreateNativeEnumType(options) {\n\t\treturn new CreateNativeEnumTypeCall(options.schema, options.typeName, options.members).toOp(this.controlAdapterFor(\"createNativeEnumType\"));\n\t}\n\t/**\n\t* Emit a `DROP TYPE` migration operation for a managed native enum, lowered\n\t* through the stored control adapter. Throws if no adapter is present.\n\t*/\n\tdropNativeEnumType(options) {\n\t\treturn new DropNativeEnumTypeCall(options.schema, options.typeName).toOp(this.controlAdapterFor(\"dropNativeEnumType\"));\n\t}\n\t/**\n\t* Emit an `ALTER TYPE ... ADD VALUE` migration operation appending one\n\t* member to a managed native enum, lowered through the stored control\n\t* adapter. Throws if no adapter is present. Every appended value is its\n\t* own operation — call this once per value to append more than one.\n\t*/\n\taddNativeEnumValue(options) {\n\t\treturn new AddNativeEnumValueCall(options.schema, options.typeName, options.value).toOp(this.controlAdapterFor(\"addNativeEnumValue\"));\n\t}\n\taddColumn(options) {\n\t\treturn new AddColumnCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"addColumn\"));\n\t}\n\taddPrimaryKey(options) {\n\t\treturn new AddPrimaryKeyCall(options.schema, options.table, options.constraint, options.columns).toOp(this.controlAdapterFor(\"addPrimaryKey\"));\n\t}\n\taddUnique(options) {\n\t\treturn new AddUniqueCall(options.schema, options.table, options.constraint, options.columns).toOp(this.controlAdapterFor(\"addUnique\"));\n\t}\n\taddForeignKey(options) {\n\t\treturn new AddForeignKeyCall(options.schema, options.table, options.foreignKey).toOp(this.controlAdapterFor(\"addForeignKey\"));\n\t}\n\taddCheckConstraint(options) {\n\t\treturn new AddCheckConstraintCall(options.schema, options.table, options.constraint, options.expression).toOp(this.controlAdapterFor(\"addCheckConstraint\"));\n\t}\n\trenameCheckConstraint(options) {\n\t\treturn new RenameCheckConstraintCall(options.schema ?? UNBOUND_NAMESPACE_ID, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameCheckConstraint\"));\n\t}\n\tdropCheckConstraint(options) {\n\t\treturn new DropCheckConstraintCall(options.schema, options.table, options.constraint).toOp(this.controlAdapterFor(\"dropCheckConstraint\"));\n\t}\n\tdropConstraint(options) {\n\t\treturn new DropConstraintCall(options.schema, options.table, options.constraint, options.kind ?? \"unique\").toOp(this.controlAdapterFor(\"dropConstraint\"));\n\t}\n\tdropTable(options) {\n\t\treturn new DropTableCall(options.schema, options.table).toOp(this.controlAdapterFor(\"dropTable\"));\n\t}\n\tdropColumn(options) {\n\t\treturn new DropColumnCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropColumn\"));\n\t}\n\talterColumnType(options) {\n\t\treturn new AlterColumnTypeCall(options.schema, options.table, options.column, options.options).toOp(this.controlAdapterFor(\"alterColumnType\"));\n\t}\n\tsetNotNull(options) {\n\t\treturn new SetNotNullCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"setNotNull\"));\n\t}\n\tdropNotNull(options) {\n\t\treturn new DropNotNullCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropNotNull\"));\n\t}\n\tsetDefault(options) {\n\t\treturn new SetDefaultCall(options.schema, options.table, options.column, options.defaultSql, options.operationClass).toOp(this.controlAdapterFor(\"setDefault\"));\n\t}\n\tdropDefault(options) {\n\t\treturn new DropDefaultCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropDefault\"));\n\t}\n\tcreateIndex(options) {\n\t\treturn new CreateIndexCall(options.schema, options.table, options.index, options.columns !== void 0 ? { columns: options.columns } : { expression: options.expression }, options.extras).toOp(this.controlAdapterFor(\"createIndex\"));\n\t}\n\trenameIndex(options) {\n\t\treturn new RenameIndexCall(options.schema, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameIndex\"));\n\t}\n\tdropIndex(options) {\n\t\treturn new DropIndexCall(options.schema, options.table, options.index).toOp(this.controlAdapterFor(\"dropIndex\"));\n\t}\n\tinstallExtension(options) {\n\t\treturn installExtension(options, this.controlAdapterFor(\"installExtension\"));\n\t}\n\tenableRowLevelSecurity(options) {\n\t\treturn new EnableRowLevelSecurityCall(options.schema, options.table).toOp(this.controlAdapterFor(\"enableRowLevelSecurity\"));\n\t}\n\tdisableRowLevelSecurity(options) {\n\t\treturn new DisableRowLevelSecurityCall(options.schema, options.table).toOp(this.controlAdapterFor(\"disableRowLevelSecurity\"));\n\t}\n\tcreateRlsPolicy(options) {\n\t\treturn new CreatePostgresRlsPolicyCall(options.schema, options.table, new PostgresRlsPolicy({\n\t\t\t...options.policy,\n\t\t\tusing: options.policy.using,\n\t\t\twithCheck: options.policy.withCheck\n\t\t})).toOp(this.controlAdapterFor(\"createRlsPolicy\"));\n\t}\n\tdropRlsPolicy(options) {\n\t\treturn new DropPostgresRlsPolicyCall(options.schema, options.table, options.policy).toOp(this.controlAdapterFor(\"dropRlsPolicy\"));\n\t}\n\trenameRlsPolicy(options) {\n\t\treturn new RenamePostgresRlsPolicyCall(options.schema, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameRlsPolicy\"));\n\t}\n};\n//#endregion\nexport { PostgresMigration as t };\n\n//# sourceMappingURL=postgres-migration-Dbq3RGfZ.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAI,oBAAoB,cAAc,UAAU;CAC/C,WAAW;;;;;;;CAOX;CACA,WAAW,IAAI,uBAAuB,MAAM,sBAAsB,SAAS,qBAAqB,SAAS,IAAI,CAAC;CAC9G,aAAa,IAAI,uBAAuB,MAAM,sBAAsB,SAAS,qBAAqB,SAAS,IAAI,CAAC;CAChH,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,iBAAiB,OAAO,UAAU,MAAM,QAAQ,OAAO,KAAK,IAAI,KAAK;CAC3E;;;;;;CAMA,kBAAkB,WAAW;EAC5B,IAAI,CAAC,KAAK,gBAAgB,MAAM,mCAAmC,SAAS;EAC5E,OAAO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B,SAAS;EAC/B,OAAO,IAAI,2BAA2B,QAAQ,QAAQ,QAAQ,KAAK,CAAC,CAAC,KAAK,KAAK,kBAAkB,wBAAwB,CAAC;CAC3H;CACA,wBAAwB,SAAS;EAChC,OAAO,IAAI,4BAA4B,QAAQ,QAAQ,QAAQ,KAAK,CAAC,CAAC,KAAK,KAAK,kBAAkB,yBAAyB,CAAC;CAC7H;CACA,gBAAgB,SAAS;EACxB,OAAO,IAAI,4BAA4B,QAAQ,QAAQ,QAAQ,OAAO,IAAI,kBAAkB;GAC3F,GAAG,QAAQ;GACX,OAAO,QAAQ,OAAO;GACtB,WAAW,QAAQ,OAAO;EAC3B,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,kBAAkB,iBAAiB,CAAC;CACnD;CACA,cAAc,SAAS;EACtB,OAAO,IAAI,0BAA0B,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,KAAK,kBAAkB,eAAe,CAAC;CACjI;CACA,gBAAgB,SAAS;EACxB,OAAO,IAAI,4BAA4B,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,MAAM,QAAQ,EAAE,CAAC,CAAC,KAAK,KAAK,kBAAkB,iBAAiB,CAAC;CAC/I;AACD"}
|
|
1
|
+
{"version":3,"file":"postgres-migration-DHvU3Jkt-Eah72PD4.mjs","names":["#endView","#startView"],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-migration-DHvU3Jkt.mjs"],"sourcesContent":["import { t as errorPostgresMigrationStackMissing } from \"./errors-DYyzTYzE.mjs\";\nimport { _ as PostgresRlsPolicy } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, L as installExtension, M as SetDefaultCall, N as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from \"./op-factory-call-CSkQdszU.mjs\";\nimport { t as PostgresContractView } from \"./postgres-contract-view-CzWRnkxb.mjs\";\nimport { t as dataTransform } from \"./data-transform-ChZzy2dP.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { Migration } from \"@internal/family-sql/migration\";\nimport { MigrationContractViews } from \"@internal/migration-tools/migration\";\n//#region src/core/migrations/postgres-migration.ts\n/**\n* Target-owned base class for Postgres migrations.\n*\n* Fixes the `SqlMigration` generic to `PostgresPlanTargetDetails` and the\n* abstract `targetId` to the Postgres target-id string literal, so both\n* user-authored migrations and renderer-generated scaffolds (the output of\n* `renderCallsToTypeScript`) can extend `PostgresMigration` directly without\n* redeclaring target-local identity.\n*\n* Mirrors `MongoMigration` in `@internal/family-mongo`: the renderer\n* emits `extends Migration` against a facade re-export of this class\n* from `@internal/postgres/migration`, keeping the authoring surface\n* target-scoped rather than family-scoped.\n*\n* The constructor materializes a single Postgres `SqlControlAdapter` from\n* `stack.adapter.create(stack)` and stores it; the protected `dataTransform`\n* instance method forwards to the free `dataTransform` factory with that\n* stored adapter, so user migrations can write `this.dataTransform(...)`\n* without threading the adapter through every call.\n*\n* Every method requires an explicit `schema`. Postgres migrations name their\n* schema deliberately — there is no default and no `search_path`-relative\n* option. A migration that left the schema unspecified would resolve against\n* whatever `search_path` the connection happened to carry, and that ambiguity\n* is an antipattern in a migration. (The unbound/unspecified namespace concept\n* remains for SQLite, which has no schemas, and for Mongo's connection `db`.)\n*/\nvar PostgresMigration = class extends Migration {\n\ttargetId = \"postgres\";\n\t/**\n\t* Materialized Postgres control adapter, created once per migration\n\t* instance from the injected stack. `undefined` only when the migration\n\t* was instantiated without a stack (test fixtures); `controlAdapterFor`\n\t* throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING in that case to surface the misuse.\n\t*/\n\tcontrolAdapter;\n\t#endView = new MigrationContractViews(this, \"PostgresMigration\", (json) => PostgresContractView.fromJson(json));\n\t#startView = new MigrationContractViews(this, \"PostgresMigration\", (json) => PostgresContractView.fromJson(json));\n\tconstructor(stack) {\n\t\tsuper(stack);\n\t\tthis.controlAdapter = stack?.adapter ? stack.adapter.create(stack) : void 0;\n\t}\n\t/**\n\t* Returns the materialized control adapter, or throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING naming\n\t* `operation` when the migration was constructed without a `ControlStack`.\n\t* Single home for the null-check that every DDL/DML method shares.\n\t*/\n\tcontrolAdapterFor(operation) {\n\t\tif (!this.controlAdapter) throw errorPostgresMigrationStackMissing(operation);\n\t\treturn this.controlAdapter;\n\t}\n\t/**\n\t* The typed, schema-qualified Postgres view over this migration's end-state\n\t* contract — `this.endContract.namespace.<schema>.table.<name>`, etc. Throws\n\t* if no `endContractJson` was provided.\n\t*/\n\tget endContract() {\n\t\treturn this.#endView.endContract;\n\t}\n\t/**\n\t* The typed Postgres view over this migration's start-state contract, or\n\t* `null` for a baseline migration (no `startContractJson`).\n\t*/\n\tget startContract() {\n\t\treturn this.#startView.startContract;\n\t}\n\t/**\n\t* Instance-method wrapper around the free `dataTransform` factory that\n\t* supplies the stored control adapter. Authors call this from inside\n\t* `get operations()`; the adapter argument is hidden from the call site.\n\t*/\n\tdataTransform(contract, name, options) {\n\t\treturn dataTransform(contract, name, options, this.controlAdapterFor(\"dataTransform\"));\n\t}\n\t/**\n\t* Emit a `CREATE TABLE` migration operation. Builds a typed DDL node from\n\t* the supplied options and lowers it through the stored control adapter.\n\t* Throws if no adapter is present (i.e. migration instantiated without a stack).\n\t*/\n\tcreateTable(options) {\n\t\treturn new CreateTableCall(options.schema, options.table, options.columns, options.constraints).toOp(this.controlAdapterFor(\"createTable\"));\n\t}\n\t/**\n\t* Emit a `CREATE SCHEMA` migration operation. Builds a typed DDL node from\n\t* the supplied options and lowers it through the stored control adapter.\n\t* Throws if no adapter is present (i.e. migration instantiated without a stack).\n\t*/\n\tcreateSchema(options) {\n\t\treturn new CreateSchemaCall(options.schema).toOp(this.controlAdapterFor(\"createSchema\"));\n\t}\n\t/**\n\t* Emit a `CREATE TYPE ... AS ENUM (...)` migration operation for a managed\n\t* native enum. Builds a typed DDL node and lowers it through the stored\n\t* control adapter (members render in declaration order). Throws if no adapter\n\t* is present.\n\t*/\n\tcreateNativeEnumType(options) {\n\t\treturn new CreateNativeEnumTypeCall(options.schema, options.typeName, options.members).toOp(this.controlAdapterFor(\"createNativeEnumType\"));\n\t}\n\t/**\n\t* Emit a `DROP TYPE` migration operation for a managed native enum, lowered\n\t* through the stored control adapter. Throws if no adapter is present.\n\t*/\n\tdropNativeEnumType(options) {\n\t\treturn new DropNativeEnumTypeCall(options.schema, options.typeName).toOp(this.controlAdapterFor(\"dropNativeEnumType\"));\n\t}\n\t/**\n\t* Emit an `ALTER TYPE ... ADD VALUE` migration operation appending one\n\t* member to a managed native enum, lowered through the stored control\n\t* adapter. Throws if no adapter is present. Every appended value is its\n\t* own operation — call this once per value to append more than one.\n\t*/\n\taddNativeEnumValue(options) {\n\t\treturn new AddNativeEnumValueCall(options.schema, options.typeName, options.value).toOp(this.controlAdapterFor(\"addNativeEnumValue\"));\n\t}\n\taddColumn(options) {\n\t\treturn new AddColumnCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"addColumn\"));\n\t}\n\taddPrimaryKey(options) {\n\t\treturn new AddPrimaryKeyCall(options.schema, options.table, options.constraint, options.columns).toOp(this.controlAdapterFor(\"addPrimaryKey\"));\n\t}\n\taddUnique(options) {\n\t\treturn new AddUniqueCall(options.schema, options.table, options.constraint, options.columns).toOp(this.controlAdapterFor(\"addUnique\"));\n\t}\n\taddForeignKey(options) {\n\t\treturn new AddForeignKeyCall(options.schema, options.table, options.foreignKey).toOp(this.controlAdapterFor(\"addForeignKey\"));\n\t}\n\taddCheckConstraint(options) {\n\t\treturn new AddCheckConstraintCall(options.schema, options.table, options.constraint, options.expression).toOp(this.controlAdapterFor(\"addCheckConstraint\"));\n\t}\n\trenameCheckConstraint(options) {\n\t\treturn new RenameCheckConstraintCall(options.schema ?? UNBOUND_NAMESPACE_ID, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameCheckConstraint\"));\n\t}\n\tdropCheckConstraint(options) {\n\t\treturn new DropCheckConstraintCall(options.schema, options.table, options.constraint).toOp(this.controlAdapterFor(\"dropCheckConstraint\"));\n\t}\n\tdropConstraint(options) {\n\t\treturn new DropConstraintCall(options.schema, options.table, options.constraint, options.kind ?? \"unique\").toOp(this.controlAdapterFor(\"dropConstraint\"));\n\t}\n\tdropTable(options) {\n\t\treturn new DropTableCall(options.schema, options.table).toOp(this.controlAdapterFor(\"dropTable\"));\n\t}\n\tdropColumn(options) {\n\t\treturn new DropColumnCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropColumn\"));\n\t}\n\talterColumnType(options) {\n\t\treturn new AlterColumnTypeCall(options.schema, options.table, options.column, options.options).toOp(this.controlAdapterFor(\"alterColumnType\"));\n\t}\n\tsetNotNull(options) {\n\t\treturn new SetNotNullCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"setNotNull\"));\n\t}\n\tdropNotNull(options) {\n\t\treturn new DropNotNullCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropNotNull\"));\n\t}\n\tsetDefault(options) {\n\t\treturn new SetDefaultCall(options.schema, options.table, options.column, options.defaultSql, options.operationClass).toOp(this.controlAdapterFor(\"setDefault\"));\n\t}\n\tdropDefault(options) {\n\t\treturn new DropDefaultCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropDefault\"));\n\t}\n\tcreateIndex(options) {\n\t\treturn new CreateIndexCall(options.schema, options.table, options.index, options.columns !== void 0 ? { columns: options.columns } : { expression: options.expression }, options.extras).toOp(this.controlAdapterFor(\"createIndex\"));\n\t}\n\trenameIndex(options) {\n\t\treturn new RenameIndexCall(options.schema, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameIndex\"));\n\t}\n\tdropIndex(options) {\n\t\treturn new DropIndexCall(options.schema, options.table, options.index).toOp(this.controlAdapterFor(\"dropIndex\"));\n\t}\n\tinstallExtension(options) {\n\t\treturn installExtension(options, this.controlAdapterFor(\"installExtension\"));\n\t}\n\tenableRowLevelSecurity(options) {\n\t\treturn new EnableRowLevelSecurityCall(options.schema, options.table).toOp(this.controlAdapterFor(\"enableRowLevelSecurity\"));\n\t}\n\tdisableRowLevelSecurity(options) {\n\t\treturn new DisableRowLevelSecurityCall(options.schema, options.table).toOp(this.controlAdapterFor(\"disableRowLevelSecurity\"));\n\t}\n\tcreateRlsPolicy(options) {\n\t\treturn new CreatePostgresRlsPolicyCall(options.schema, options.table, new PostgresRlsPolicy({\n\t\t\t...options.policy,\n\t\t\tusing: options.policy.using,\n\t\t\twithCheck: options.policy.withCheck\n\t\t})).toOp(this.controlAdapterFor(\"createRlsPolicy\"));\n\t}\n\tdropRlsPolicy(options) {\n\t\treturn new DropPostgresRlsPolicyCall(options.schema, options.table, options.policy).toOp(this.controlAdapterFor(\"dropRlsPolicy\"));\n\t}\n\trenameRlsPolicy(options) {\n\t\treturn new RenamePostgresRlsPolicyCall(options.schema, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameRlsPolicy\"));\n\t}\n};\n//#endregion\nexport { PostgresMigration as t };\n\n//# sourceMappingURL=postgres-migration-DHvU3Jkt.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAI,oBAAoB,cAAc,UAAU;CAC/C,WAAW;;;;;;;CAOX;CACA,WAAW,IAAI,uBAAuB,MAAM,sBAAsB,SAAS,qBAAqB,SAAS,IAAI,CAAC;CAC9G,aA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as.mjs";
|
|
2
2
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
3
|
-
import { t as escapeLiteral } from "./sql-utils-
|
|
3
|
+
import { t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
|
|
4
4
|
import { TableSource } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
5
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
6
6
|
import { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from "@prisma/orm-framework/components/ir";
|
|
@@ -11,7 +11,7 @@ import { nameOf, parseNaming } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
|
11
11
|
import { invariant } from "@prisma/orm-framework/utils/assertions";
|
|
12
12
|
import { composeSqlEntityKinds } from "@prisma/orm-family-sql/contract/entity-kinds";
|
|
13
13
|
import { cfExpr } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
14
|
-
//#region ../../../3-targets/3-targets/postgres/dist/postgres-schema-
|
|
14
|
+
//#region ../../../3-targets/3-targets/postgres/dist/postgres-schema-B3t7Zr52.mjs
|
|
15
15
|
/**
|
|
16
16
|
* Postgres contract-IR marker for `@@rls` on a model: the table named here is
|
|
17
17
|
* RLS-controlled (`ENABLE ROW LEVEL SECURITY` is driven by this marker, never
|
|
@@ -418,4 +418,4 @@ function postgresCreateNamespace(input) {
|
|
|
418
418
|
//#endregion
|
|
419
419
|
export { roleEntityKind as _, PostgresRlsPolicySchema as a, PostgresSchema as c, isPostgresSchema as d, nativeEnumEntityKind as f, rlsEnablementEntityKind as g, postgresCreateNamespace as h, PostgresRlsPolicy as i, PostgresTableSource as l, policyInputFromSerialized as m, PostgresRlsEnablement as n, PostgresRole as o, policyEntityKind as p, PostgresRlsEnablementSchema as r, PostgresRoleSchema as s, PostgresNativeEnumSchema as t, PostgresUnboundSchema as u };
|
|
420
420
|
|
|
421
|
-
//# sourceMappingURL=postgres-schema-
|
|
421
|
+
//# sourceMappingURL=postgres-schema-B3t7Zr52-CMlY9aGw.mjs.map
|
package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs.map → postgres-schema-B3t7Zr52-CMlY9aGw.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-schema-CF0yHESb-D7n2X21R.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-schema-CF0yHESb.mjs"],"sourcesContent":["import { x as PG_TEXT_CODEC_ID } from \"./codec-ids-C5Rkltkw.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { t as escapeLiteral } from \"./sql-utils-DuzN3JZg.mjs\";\nimport { TableSource } from \"@internal/sql-relational-core/ast\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { type } from \"arktype\";\nimport { SqlNamespaceBase, SqlNode } from \"@internal/sql-contract/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { nameOf, parseNaming } from \"@internal/sql-schema-ir/naming\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { composeSqlEntityKinds } from \"@internal/sql-contract/entity-kinds\";\nimport { cfExpr } from \"@internal/sql-relational-core/contract-free\";\n//#region src/core/postgres-rls-enablement.ts\n/**\n* Postgres contract-IR marker for `@@rls` on a model: the table named here is\n* RLS-controlled (`ENABLE ROW LEVEL SECURITY` is driven by this marker, never\n* by the policy set).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an\n* entity kind, extends `SqlNode`, and is stored in `contract.json` under\n* `entries.rls[tableName]`. Target-only concept — no SQL-family abstract.\n* Frozen at construction via `freezeNode(this)`. The `kind: 'rls'`\n* discriminant is enumerable so it survives JSON serialization; the literal\n* matches the entries key (one-string rule).\n*/\nvar PostgresRlsEnablement = class extends SqlNode {\n\tkind = \"rls\";\n\ttableName;\n\tnamespaceId;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tableName = input.tableName;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-rls-policy.ts\n/**\n* Postgres contract-IR class for a row-level security policy (`CREATE POLICY … ON …`).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an entity\n* kind, extends `SqlNode`, and is stored in `contract.json`. It is NOT a DiffableNode;\n* the schema-diff tree uses `PostgresPolicySchemaNode` for that role.\n*\n* Target-only concept — no SQL-family abstract. Extends `SqlNode` directly.\n* Frozen at construction via `freezeNode(this)`. The `kind: 'policy'`\n* discriminant is enumerable (overrides SqlNode's non-enumerable `'sql'`) so it\n* survives JSON serialization and enables dispatch. The literal matches the\n* entries key (one-string rule: node.kind === entries key === entity kind).\n*/\nvar PostgresRlsPolicy = class extends SqlNode {\n\tkind = \"policy\";\n\tname;\n\ttableName;\n\tnamespaceId;\n\toperation;\n\troles;\n\tpermissive;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.tableName = input.tableName;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tthis.operation = input.operation;\n\t\tthis.roles = Object.freeze([...input.roles]);\n\t\tif (input.using !== void 0) this.using = input.using;\n\t\tif (input.withCheck !== void 0) this.withCheck = input.withCheck;\n\t\tthis.permissive = input.permissive;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-role.ts\n/**\n* Roles are referenced by the contract but never owned — the framework\n* issues no `CREATE`/`DROP ROLE`, so a role's effective governance is always\n* `external`: a missing declared role fails verify, an extra live role is\n* tolerated, and the planner emits zero role DDL. `external` is the only\n* value a role's control can ever carry.\n*/\nconst ROLE_DEFAULT_CONTROL_POLICY = \"external\";\n/**\n* Postgres contract-IR class for a database role (`CREATE ROLE …`).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an entity\n* kind, extends `SqlNode`, and is stored in `contract.json`. It is NOT a DiffableNode;\n* the schema-diff tree uses `PostgresRoleSchemaNode` for that role.\n*\n* Roles are cluster-scoped, so their namespace coordinate is always\n* `UNBOUND_NAMESPACE_ID`. Target-only concept — no SQL-family abstract.\n* Extends `SqlNode` directly, frozen at construction via `freezeNode(this)`.\n* The `kind: 'role'` discriminant is enumerable so it survives JSON.\n* Matches the entries key (one-string rule).\n*\n* `control` always carries a value (never omitted): it defaults to\n* {@link ROLE_DEFAULT_CONTROL_POLICY} in the constructor, so both a\n* freshly-authored role and one hydrated from an older `contract.json`\n* lacking the field resolve the same way — the control-policy resolver\n* reads it directly off the entity instead of special-casing role issues.\n*/\nvar PostgresRole = class extends SqlNode {\n\tkind = \"role\";\n\tname;\n\tnamespaceId;\n\tcontrol;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tthis.control = input.control ?? \"external\";\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-validators.ts\nconst PostgresRoleSchema = type({\n\tkind: \"'role'\",\n\tname: \"string\",\n\tnamespaceId: \"string\",\n\t\"control?\": \"'external'\"\n});\nconst PostgresRlsPolicySchema = type({\n\tkind: \"'policy'\",\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\ttableName: \"string\",\n\tnamespaceId: \"string\",\n\toperation: \"'select' | 'insert' | 'update' | 'delete' | 'all'\",\n\troles: type.string.array().readonly(),\n\t\"using?\": \"string\",\n\t\"withCheck?\": \"string\",\n\tpermissive: \"boolean\"\n});\nconst PostgresRlsEnablementSchema = type({\n\tkind: \"'rls'\",\n\ttableName: \"string\",\n\tnamespaceId: \"string\"\n});\nconst PostgresNativeEnumSchema = type({\n\tkind: \"'postgres-enum'\",\n\ttypeName: \"string\",\n\tmembers: type.string.array().readonly(),\n\t\"control?\": \"'managed' | 'tolerated' | 'external' | 'observed'\"\n});\n//#endregion\n//#region src/core/ast/table-source.ts\nvar PostgresTableSource = class extends TableSource {\n\tschema;\n\tconstructor(options) {\n\t\tsuper(options.name, options.alias);\n\t\tthis.schema = options.schema;\n\t\tthis.freeze();\n\t}\n\trewrite(rewriter) {\n\t\treturn rewriter.tableSource ? rewriter.tableSource(this) : this;\n\t}\n};\n//#endregion\n//#region src/core/serialized-rls-policy.ts\n/**\n* Hydrates one stored policy into constructor input. The name and the prefix\n* are separate fields in the file and can disagree there, so the pair is\n* checked on the way in.\n*/\nfunction policyInputFromSerialized(flat) {\n\treturn {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\ttableName: flat.tableName,\n\t\tnamespaceId: flat.namespaceId,\n\t\toperation: flat.operation,\n\t\troles: flat.roles,\n\t\tusing: flat.using,\n\t\twithCheck: flat.withCheck,\n\t\tpermissive: flat.permissive\n\t};\n}\n//#endregion\n//#region src/core/entity-kinds.ts\nconst policyEntityKind = {\n\tkind: \"policy\",\n\tschema: PostgresRlsPolicySchema,\n\tconstruct: (input) => new PostgresRlsPolicy(policyInputFromSerialized(input))\n};\nconst roleEntityKind = {\n\tkind: \"role\",\n\tschema: PostgresRoleSchema,\n\tconstruct: (input) => new PostgresRole(input)\n};\nconst rlsEnablementEntityKind = {\n\tkind: \"rls\",\n\tschema: PostgresRlsEnablementSchema,\n\tconstruct: (input) => new PostgresRlsEnablement(input)\n};\nconst nativeEnumEntityKind = {\n\tkind: \"native_enum\",\n\tschema: PostgresNativeEnumSchema,\n\tconstruct: (input) => new PostgresNativeEnum(input)\n};\n//#endregion\n//#region src/core/postgres-schema.ts\n/**\n* Postgres target `Namespace` concretion — a Postgres schema (`CREATE\n* SCHEMA …`). Each Postgres `SqlStorage` carries a\n* `namespaces: Record<NamespaceId, PostgresSchema>` map populated by\n* the Postgres PSL interpreter from `namespace { … }` AST buckets.\n*\n* `entries` holds entity-kind maps (`table`, `valueSet`). Qualifier\n* emission is the rendering seam: DDL / SQL emission asks the namespace\n* for its qualifier (`\"<schema>\"`) or for a qualified table name\n* (`\"<schema>\".\"<table>\"`) and consumes the result polymorphically.\n* The unbound singleton below overrides these methods to elide the\n* prefix entirely — call sites stay polymorphic and never branch on\n* `id === UNBOUND_NAMESPACE_ID`.\n*/\nvar PostgresSchema = class extends SqlNamespaceBase {\n\t/**\n\t* Stable singleton reference for the late-bound slot. Materialised\n\t* lazily below the singleton subclass declaration so the static\n\t* initialiser sees the subclass before assigning. Consumers always\n\t* reach for `PostgresSchema.unbound` (or `PostgresUnboundSchema.instance`\n\t* — same identity).\n\t*/\n\tstatic unbound;\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst dispatched = hydrateNamespaceEntities(input.entries, composeSqlEntityKinds([\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind\n\t\t]), \"carry\");\n\t\tconst nativeEnumSlot = dispatched[\"native_enum\"];\n\t\tif (nativeEnumSlot !== void 0) {\n\t\t\tconst rekeyed = {};\n\t\t\tfor (const [handle, entity] of Object.entries(nativeEnumSlot)) {\n\t\t\t\tconst physicalName = PostgresNativeEnum.is(entity) ? entity.typeName : handle;\n\t\t\t\tinvariant(!Object.hasOwn(rekeyed, physicalName), `PostgresSchema \"${input.id}\": two native_enum entities resolve to the same physical type name \"${physicalName}\". Give them distinct @@map type names.`);\n\t\t\t\trekeyed[physicalName] = entity;\n\t\t\t}\n\t\t\tdispatched[\"native_enum\"] = Object.freeze(rekeyed);\n\t\t}\n\t\tconst valueSetRaw = dispatched[\"valueSet\"];\n\t\tconst entriesInput = { ...valueSetRaw !== void 0 && Object.keys(valueSetRaw).length === 0 ? {\n\t\t\t...dispatched,\n\t\t\tvalueSet: void 0\n\t\t} : dispatched };\n\t\tthis.entries = Object.freeze(blindCast(entriesInput));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"schema\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget table() {\n\t\treturn this.entries.table ?? Object.freeze({});\n\t}\n\tget valueSet() {\n\t\treturn this.entries.valueSet;\n\t}\n\tget policy() {\n\t\treturn this.entries.policy ?? Object.freeze({});\n\t}\n\tget role() {\n\t\treturn this.entries.role ?? Object.freeze({});\n\t}\n\tget rls() {\n\t\treturn this.entries.rls ?? Object.freeze({});\n\t}\n\t/**\n\t* The bare schema qualifier as it would appear in a rendered SQL\n\t* fragment (already quoted). The unbound-schema singleton overrides\n\t* this to return `''`.\n\t*/\n\tqualifier() {\n\t\treturn `\"${this.id}\"`;\n\t}\n\t/**\n\t* Qualify a table name with the schema prefix\n\t* (`\"<schema>\".\"<table>\"`). The unbound-schema singleton overrides\n\t* this to emit just `\"<table>\"` so the resolved DDL is unqualified\n\t* and `search_path` decides where the object lands at runtime.\n\t*/\n\tqualifyTable(tableName) {\n\t\treturn `\"${this.id}\".\"${tableName}\"`;\n\t}\n\t/**\n\t* Render a SQL string-literal containing the qualified-name form\n\t* suitable for `to_regclass(...)` arguments (e.g. `'\"public\".\"user\"'`).\n\t* The unbound singleton overrides this to elide the schema prefix\n\t* (`'\"user\"'`) so `search_path` resolves the object at runtime.\n\t*/\n\tregclassLiteral(name) {\n\t\treturn `'${escapeLiteral(this.qualifyTable(name))}'`;\n\t}\n\t/**\n\t* Render a SQL expression that evaluates to this namespace's schema\n\t* name at runtime, ready to drop into a `WHERE table_schema = …` /\n\t* `WHERE n.nspname = …` clause. Named schemas emit a quoted SQL\n\t* literal (`'public'`); the unbound singleton overrides this to emit\n\t* `current_schema()` so catalog queries match whichever schema the\n\t* connection's `search_path` resolved at runtime.\n\t*/\n\tschemaSqlExpression() {\n\t\treturn `'${escapeLiteral(this.id)}'`;\n\t}\n\t/**\n\t* Typed-AST counterpart of {@link schemaSqlExpression}: the expression a\n\t* builder-built catalog check compares `n.nspname` / `table_schema`\n\t* against. Named schemas bind the schema name as a text parameter; the\n\t* unbound singleton overrides this to the opaque `current_schema()`\n\t* expression so the live connection's `search_path` decides at runtime.\n\t*/\n\tschemaFilterExpression() {\n\t\treturn cfExpr.param(this.id, PG_TEXT_CODEC_ID);\n\t}\n\t/**\n\t* Typed-AST counterpart of {@link qualifyTable}: the FROM source a\n\t* builder-built check uses to address a user table in this namespace.\n\t* Named schemas qualify (`\"schema\".\"table\"`); the unbound singleton\n\t* overrides this to leave the table unqualified so `search_path`\n\t* resolves it at runtime.\n\t*/\n\ttableSource(tableName, alias) {\n\t\treturn new PostgresTableSource({\n\t\t\tname: tableName,\n\t\t\tschema: this.id,\n\t\t\t...ifDefined(\"alias\", alias)\n\t\t});\n\t}\n\t/**\n\t* The bare schema name a DDL planner should target when emitting\n\t* statements that need to identify this namespace in the live\n\t* database (e.g. `CREATE TABLE \"<ddlSchemaName>\".\"<table>\" …`,\n\t* catalog filters, planner conflict lookups). Named schemas resolve\n\t* to their own id. The `PostgresUnboundSchema` singleton inherits\n\t* this and returns `UNBOUND_NAMESPACE_ID` — callers that dispatch\n\t* through `qualifyTableName` route through the polymorphic\n\t* `PostgresUnboundSchema` overrides and produce unqualified\n\t* (search-path-resolved) output automatically.\n\t*/\n\tddlSchemaName(_storage) {\n\t\treturn this.id;\n\t}\n};\n/**\n* Singleton subclass for the reserved sentinel namespace id\n* (`UNBOUND_NAMESPACE_ID`) — the late-bound Postgres slot whose binding\n* the connection's `search_path` resolves at runtime. Overrides\n* qualifier emission to elide the schema prefix; call sites that consume\n* `qualifier()` / `qualifyTable()` get unqualified output without\n* branching on the namespace id.\n*\n* This is the target-side materialization of \"the framework provides\n* affordances; targets implement specifics\": the framework names the\n* sentinel; Postgres decides what late-bound means here (the table\n* name, naked — the schema is supplied by the live connection's\n* `search_path`).\n*\n* `ddlSchemaName` is inherited from `PostgresSchema` and returns\n* `UNBOUND_NAMESPACE_ID`. Downstream helpers such as `qualifyTableName`\n* route through the polymorphic factory and produce unqualified output\n* automatically.\n*/\nvar PostgresUnboundSchema = class PostgresUnboundSchema extends PostgresSchema {\n\tstatic instance = new PostgresUnboundSchema();\n\tconstructor(input) {\n\t\tsuper(input ?? {\n\t\t\tid: UNBOUND_NAMESPACE_ID,\n\t\t\tentries: { table: {} }\n\t\t});\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyTable(tableName) {\n\t\treturn `\"${tableName}\"`;\n\t}\n\tschemaSqlExpression() {\n\t\treturn \"current_schema()\";\n\t}\n\tschemaFilterExpression() {\n\t\treturn cfExpr.raw(\"current_schema()\", {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: false\n\t\t});\n\t}\n\ttableSource(tableName, alias) {\n\t\treturn new PostgresTableSource({\n\t\t\tname: tableName,\n\t\t\t...ifDefined(\"alias\", alias)\n\t\t});\n\t}\n};\nPostgresSchema.unbound = PostgresUnboundSchema.instance;\n/**\n* Narrow an arbitrary namespace (or `undefined`) to `PostgresSchema`\n* so callers can dispatch to the polymorphic emission methods without\n* branching at the call site. Uses the structural `kind` discriminator\n* (`'schema'`) rather than `instanceof` so the check survives realm /\n* bundle / hot-reload boundaries — matching the rest of the IR's\n* narrowing convention. `PostgresUnboundSchema` passes through because\n* it inherits the same `kind: 'schema'` from `PostgresSchema`.\n*/\nfunction isPostgresSchema(ns) {\n\treturn ns?.kind === \"schema\";\n}\n/**\n* Target-supplied `Namespace` factory the Postgres target plumbs\n* through `defineContract({ createNamespace })` and the SQL PSL\n* interpreter. Returns the unbound singleton for the framework\n* sentinel and a fresh `PostgresSchema` for any other coordinate.\n*\n* The factory has no per-call state — every named id deterministically\n* maps to a distinct schema instance — so callers can pass it through\n* by reference and trust the resulting `SqlStorage.namespaces` map to\n* be value-stable for a given input set. Native-enum column type names are\n* schema-qualified earlier, at column construction, via the target's\n* `authoring.qualifyColumnType` hook (`postgresQualifyColumnType`), so this\n* factory just materialises the namespace from already-qualified entries.\n*/\nfunction postgresCreateNamespace(input) {\n\tconst schemaInput = {\n\t\tid: input.id,\n\t\tentries: {\n\t\t\t...input.entries,\n\t\t\ttable: input.entries[\"table\"] ?? {}\n\t\t}\n\t};\n\tif (input.id === UNBOUND_NAMESPACE_ID) return new PostgresUnboundSchema(schemaInput);\n\treturn new PostgresSchema(schemaInput);\n}\n//#endregion\nexport { PostgresRlsPolicy as _, nativeEnumEntityKind as a, roleEntityKind as c, PostgresNativeEnumSchema as d, PostgresRlsEnablementSchema as f, ROLE_DEFAULT_CONTROL_POLICY as g, PostgresRole as h, postgresCreateNamespace as i, policyInputFromSerialized as l, PostgresRoleSchema as m, PostgresUnboundSchema as n, policyEntityKind as o, PostgresRlsPolicySchema as p, isPostgresSchema as r, rlsEnablementEntityKind as s, PostgresSchema as t, PostgresTableSource as u, PostgresRlsEnablement as v };\n\n//# sourceMappingURL=postgres-schema-CF0yHESb.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,wBAAwB,cAAc,QAAQ;CACjD,OAAO;CACP;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,YAAY,MAAM;EACvB,KAAK,cAAc,MAAM;EACzB,WAAW,IAAI;CAChB;AACD;;;;;;;;;;;;;;AAgBA,IAAI,oBAAoB,cAAc,QAAQ;CAC7C,OAAO;CACP;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,OAAO,OAAO,MAAM,MAAM;EAC/B,IAAI,MAAM,OAAO,SAAS,QAAQ,KAAK,SAAS,MAAM,OAAO;EAC7D,KAAK,YAAY,MAAM;EACvB,KAAK,cAAc,MAAM;EACzB,KAAK,YAAY,MAAM;EACvB,KAAK,QAAQ,OAAO,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC;EAC3C,IAAI,MAAM,UAAU,KAAK,GAAG,KAAK,QAAQ,MAAM;EAC/C,IAAI,MAAM,cAAc,KAAK,GAAG,KAAK,YAAY,MAAM;EACvD,KAAK,aAAa,MAAM;EACxB,WAAW,IAAI;CAChB;AACD;;;;;;;;;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,YAAY,WAAW,OAAO;EAC7B,OAAO,IAAI,oBAAoB;GAC9B,MAAM;GACN,GAAG,UAAU,SAAS,KAAK;EAC5B,CAAC;CACF;AACD;AACA,eAAe,UAAU,sBAAsB;;;;;;;;;;AAU/C,SAAS,iBAAiB,IAAI;CAC7B,OAAO,IAAI,SAAS;AACrB;;;;;;;;;;;;;;;AAeA,SAAS,wBAAwB,OAAO;CACvC,MAAM,cAAc;EACnB,IAAI,MAAM;EACV,SAAS;GACR,GAAG,MAAM;GACT,OAAO,MAAM,QAAQ,YAAY,CAAC;EACnC;CACD;CACA,IAAI,MAAM,OAAO,sBAAsB,OAAO,IAAI,sBAAsB,WAAW;CACnF,OAAO,IAAI,eAAe,WAAW;AACtC"}
|
|
1
|
+
{"version":3,"file":"postgres-schema-B3t7Zr52-CMlY9aGw.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-schema-B3t7Zr52.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID } from \"./codec-ids-D3ZEAmt2.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { t as escapeLiteral } from \"./sql-utils-6j9YTLpr.mjs\";\nimport { TableSource } from \"@internal/sql-relational-core/ast\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { type } from \"arktype\";\nimport { SqlNamespaceBase, SqlNode } from \"@internal/sql-contract/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { nameOf, parseNaming } from \"@internal/sql-schema-ir/naming\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { composeSqlEntityKinds } from \"@internal/sql-contract/entity-kinds\";\nimport { cfExpr } from \"@internal/sql-relational-core/contract-free\";\n//#region src/core/postgres-rls-enablement.ts\n/**\n* Postgres contract-IR marker for `@@rls` on a model: the table named here is\n* RLS-controlled (`ENABLE ROW LEVEL SECURITY` is driven by this marker, never\n* by the policy set).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an\n* entity kind, extends `SqlNode`, and is stored in `contract.json` under\n* `entries.rls[tableName]`. Target-only concept — no SQL-family abstract.\n* Frozen at construction via `freezeNode(this)`. The `kind: 'rls'`\n* discriminant is enumerable so it survives JSON serialization; the literal\n* matches the entries key (one-string rule).\n*/\nvar PostgresRlsEnablement = class extends SqlNode {\n\tkind = \"rls\";\n\ttableName;\n\tnamespaceId;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tableName = input.tableName;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-rls-policy.ts\n/**\n* Postgres contract-IR class for a row-level security policy (`CREATE POLICY … ON …`).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an entity\n* kind, extends `SqlNode`, and is stored in `contract.json`. It is NOT a DiffableNode;\n* the schema-diff tree uses `PostgresPolicySchemaNode` for that role.\n*\n* Target-only concept — no SQL-family abstract. Extends `SqlNode` directly.\n* Frozen at construction via `freezeNode(this)`. The `kind: 'policy'`\n* discriminant is enumerable (overrides SqlNode's non-enumerable `'sql'`) so it\n* survives JSON serialization and enables dispatch. The literal matches the\n* entries key (one-string rule: node.kind === entries key === entity kind).\n*/\nvar PostgresRlsPolicy = class extends SqlNode {\n\tkind = \"policy\";\n\tname;\n\ttableName;\n\tnamespaceId;\n\toperation;\n\troles;\n\tpermissive;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.tableName = input.tableName;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tthis.operation = input.operation;\n\t\tthis.roles = Object.freeze([...input.roles]);\n\t\tif (input.using !== void 0) this.using = input.using;\n\t\tif (input.withCheck !== void 0) this.withCheck = input.withCheck;\n\t\tthis.permissive = input.permissive;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-role.ts\n/**\n* Roles are referenced by the contract but never owned — the framework\n* issues no `CREATE`/`DROP ROLE`, so a role's effective governance is always\n* `external`: a missing declared role fails verify, an extra live role is\n* tolerated, and the planner emits zero role DDL. `external` is the only\n* value a role's control can ever carry.\n*/\nconst ROLE_DEFAULT_CONTROL_POLICY = \"external\";\n/**\n* Postgres contract-IR class for a database role (`CREATE ROLE …`).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an entity\n* kind, extends `SqlNode`, and is stored in `contract.json`. It is NOT a DiffableNode;\n* the schema-diff tree uses `PostgresRoleSchemaNode` for that role.\n*\n* Roles are cluster-scoped, so their namespace coordinate is always\n* `UNBOUND_NAMESPACE_ID`. Target-only concept — no SQL-family abstract.\n* Extends `SqlNode` directly, frozen at construction via `freezeNode(this)`.\n* The `kind: 'role'` discriminant is enumerable so it survives JSON.\n* Matches the entries key (one-string rule).\n*\n* `control` always carries a value (never omitted): it defaults to\n* {@link ROLE_DEFAULT_CONTROL_POLICY} in the constructor, so both a\n* freshly-authored role and one hydrated from an older `contract.json`\n* lacking the field resolve the same way — the control-policy resolver\n* reads it directly off the entity instead of special-casing role issues.\n*/\nvar PostgresRole = class extends SqlNode {\n\tkind = \"role\";\n\tname;\n\tnamespaceId;\n\tcontrol;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tthis.control = input.control ?? \"external\";\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-validators.ts\nconst PostgresRoleSchema = type({\n\tkind: \"'role'\",\n\tname: \"string\",\n\tnamespaceId: \"string\",\n\t\"control?\": \"'external'\"\n});\nconst PostgresRlsPolicySchema = type({\n\tkind: \"'policy'\",\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\ttableName: \"string\",\n\tnamespaceId: \"string\",\n\toperation: \"'select' | 'insert' | 'update' | 'delete' | 'all'\",\n\troles: type.string.array().readonly(),\n\t\"using?\": \"string\",\n\t\"withCheck?\": \"string\",\n\tpermissive: \"boolean\"\n});\nconst PostgresRlsEnablementSchema = type({\n\tkind: \"'rls'\",\n\ttableName: \"string\",\n\tnamespaceId: \"string\"\n});\nconst PostgresNativeEnumSchema = type({\n\tkind: \"'postgres-enum'\",\n\ttypeName: \"string\",\n\tmembers: type.string.array().readonly(),\n\t\"control?\": \"'managed' | 'tolerated' | 'external' | 'observed'\"\n});\n//#endregion\n//#region src/core/ast/table-source.ts\nvar PostgresTableSource = class extends TableSource {\n\tschema;\n\tconstructor(options) {\n\t\tsuper(options.name, options.alias);\n\t\tthis.schema = options.schema;\n\t\tthis.freeze();\n\t}\n\trewrite(rewriter) {\n\t\treturn rewriter.tableSource ? rewriter.tableSource(this) : this;\n\t}\n};\n//#endregion\n//#region src/core/serialized-rls-policy.ts\n/**\n* Hydrates one stored policy into constructor input. The name and the prefix\n* are separate fields in the file and can disagree there, so the pair is\n* checked on the way in.\n*/\nfunction policyInputFromSerialized(flat) {\n\treturn {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\ttableName: flat.tableName,\n\t\tnamespaceId: flat.namespaceId,\n\t\toperation: flat.operation,\n\t\troles: flat.roles,\n\t\tusing: flat.using,\n\t\twithCheck: flat.withCheck,\n\t\tpermissive: flat.permissive\n\t};\n}\n//#endregion\n//#region src/core/entity-kinds.ts\nconst policyEntityKind = {\n\tkind: \"policy\",\n\tschema: PostgresRlsPolicySchema,\n\tconstruct: (input) => new PostgresRlsPolicy(policyInputFromSerialized(input))\n};\nconst roleEntityKind = {\n\tkind: \"role\",\n\tschema: PostgresRoleSchema,\n\tconstruct: (input) => new PostgresRole(input)\n};\nconst rlsEnablementEntityKind = {\n\tkind: \"rls\",\n\tschema: PostgresRlsEnablementSchema,\n\tconstruct: (input) => new PostgresRlsEnablement(input)\n};\nconst nativeEnumEntityKind = {\n\tkind: \"native_enum\",\n\tschema: PostgresNativeEnumSchema,\n\tconstruct: (input) => new PostgresNativeEnum(input)\n};\n//#endregion\n//#region src/core/postgres-schema.ts\n/**\n* Postgres target `Namespace` concretion — a Postgres schema (`CREATE\n* SCHEMA …`). Each Postgres `SqlStorage` carries a\n* `namespaces: Record<NamespaceId, PostgresSchema>` map populated by\n* the Postgres PSL interpreter from `namespace { … }` AST buckets.\n*\n* `entries` holds entity-kind maps (`table`, `valueSet`). Qualifier\n* emission is the rendering seam: DDL / SQL emission asks the namespace\n* for its qualifier (`\"<schema>\"`) or for a qualified table name\n* (`\"<schema>\".\"<table>\"`) and consumes the result polymorphically.\n* The unbound singleton below overrides these methods to elide the\n* prefix entirely — call sites stay polymorphic and never branch on\n* `id === UNBOUND_NAMESPACE_ID`.\n*/\nvar PostgresSchema = class extends SqlNamespaceBase {\n\t/**\n\t* Stable singleton reference for the late-bound slot. Materialised\n\t* lazily below the singleton subclass declaration so the static\n\t* initialiser sees the subclass before assigning. Consumers always\n\t* reach for `PostgresSchema.unbound` (or `PostgresUnboundSchema.instance`\n\t* — same identity).\n\t*/\n\tstatic unbound;\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst dispatched = hydrateNamespaceEntities(input.entries, composeSqlEntityKinds([\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind\n\t\t]), \"carry\");\n\t\tconst nativeEnumSlot = dispatched[\"native_enum\"];\n\t\tif (nativeEnumSlot !== void 0) {\n\t\t\tconst rekeyed = {};\n\t\t\tfor (const [handle, entity] of Object.entries(nativeEnumSlot)) {\n\t\t\t\tconst physicalName = PostgresNativeEnum.is(entity) ? entity.typeName : handle;\n\t\t\t\tinvariant(!Object.hasOwn(rekeyed, physicalName), `PostgresSchema \"${input.id}\": two native_enum entities resolve to the same physical type name \"${physicalName}\". Give them distinct @@map type names.`);\n\t\t\t\trekeyed[physicalName] = entity;\n\t\t\t}\n\t\t\tdispatched[\"native_enum\"] = Object.freeze(rekeyed);\n\t\t}\n\t\tconst valueSetRaw = dispatched[\"valueSet\"];\n\t\tconst entriesInput = { ...valueSetRaw !== void 0 && Object.keys(valueSetRaw).length === 0 ? {\n\t\t\t...dispatched,\n\t\t\tvalueSet: void 0\n\t\t} : dispatched };\n\t\tthis.entries = Object.freeze(blindCast(entriesInput));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"schema\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget table() {\n\t\treturn this.entries.table ?? Object.freeze({});\n\t}\n\tget valueSet() {\n\t\treturn this.entries.valueSet;\n\t}\n\tget policy() {\n\t\treturn this.entries.policy ?? Object.freeze({});\n\t}\n\tget role() {\n\t\treturn this.entries.role ?? Object.freeze({});\n\t}\n\tget rls() {\n\t\treturn this.entries.rls ?? Object.freeze({});\n\t}\n\t/**\n\t* The bare schema qualifier as it would appear in a rendered SQL\n\t* fragment (already quoted). The unbound-schema singleton overrides\n\t* this to return `''`.\n\t*/\n\tqualifier() {\n\t\treturn `\"${this.id}\"`;\n\t}\n\t/**\n\t* Qualify a table name with the schema prefix\n\t* (`\"<schema>\".\"<table>\"`). The unbound-schema singleton overrides\n\t* this to emit just `\"<table>\"` so the resolved DDL is unqualified\n\t* and `search_path` decides where the object lands at runtime.\n\t*/\n\tqualifyTable(tableName) {\n\t\treturn `\"${this.id}\".\"${tableName}\"`;\n\t}\n\t/**\n\t* Render a SQL string-literal containing the qualified-name form\n\t* suitable for `to_regclass(...)` arguments (e.g. `'\"public\".\"user\"'`).\n\t* The unbound singleton overrides this to elide the schema prefix\n\t* (`'\"user\"'`) so `search_path` resolves the object at runtime.\n\t*/\n\tregclassLiteral(name) {\n\t\treturn `'${escapeLiteral(this.qualifyTable(name))}'`;\n\t}\n\t/**\n\t* Render a SQL expression that evaluates to this namespace's schema\n\t* name at runtime, ready to drop into a `WHERE table_schema = …` /\n\t* `WHERE n.nspname = …` clause. Named schemas emit a quoted SQL\n\t* literal (`'public'`); the unbound singleton overrides this to emit\n\t* `current_schema()` so catalog queries match whichever schema the\n\t* connection's `search_path` resolved at runtime.\n\t*/\n\tschemaSqlExpression() {\n\t\treturn `'${escapeLiteral(this.id)}'`;\n\t}\n\t/**\n\t* Typed-AST counterpart of {@link schemaSqlExpression}: the expression a\n\t* builder-built catalog check compares `n.nspname` / `table_schema`\n\t* against. Named schemas bind the schema name as a text parameter; the\n\t* unbound singleton overrides this to the opaque `current_schema()`\n\t* expression so the live connection's `search_path` decides at runtime.\n\t*/\n\tschemaFilterExpression() {\n\t\treturn cfExpr.param(this.id, PG_TEXT_CODEC_ID);\n\t}\n\t/**\n\t* Typed-AST counterpart of {@link qualifyTable}: the FROM source a\n\t* builder-built check uses to address a user table in this namespace.\n\t* Named schemas qualify (`\"schema\".\"table\"`); the unbound singleton\n\t* overrides this to leave the table unqualified so `search_path`\n\t* resolves it at runtime.\n\t*/\n\ttableSource(tableName, alias) {\n\t\treturn new PostgresTableSource({\n\t\t\tname: tableName,\n\t\t\tschema: this.id,\n\t\t\t...ifDefined(\"alias\", alias)\n\t\t});\n\t}\n\t/**\n\t* The bare schema name a DDL planner should target when emitting\n\t* statements that need to identify this namespace in the live\n\t* database (e.g. `CREATE TABLE \"<ddlSchemaName>\".\"<table>\" …`,\n\t* catalog filters, planner conflict lookups). Named schemas resolve\n\t* to their own id. The `PostgresUnboundSchema` singleton inherits\n\t* this and returns `UNBOUND_NAMESPACE_ID` — callers that dispatch\n\t* through `qualifyTableName` route through the polymorphic\n\t* `PostgresUnboundSchema` overrides and produce unqualified\n\t* (search-path-resolved) output automatically.\n\t*/\n\tddlSchemaName(_storage) {\n\t\treturn this.id;\n\t}\n};\n/**\n* Singleton subclass for the reserved sentinel namespace id\n* (`UNBOUND_NAMESPACE_ID`) — the late-bound Postgres slot whose binding\n* the connection's `search_path` resolves at runtime. Overrides\n* qualifier emission to elide the schema prefix; call sites that consume\n* `qualifier()` / `qualifyTable()` get unqualified output without\n* branching on the namespace id.\n*\n* This is the target-side materialization of \"the framework provides\n* affordances; targets implement specifics\": the framework names the\n* sentinel; Postgres decides what late-bound means here (the table\n* name, naked — the schema is supplied by the live connection's\n* `search_path`).\n*\n* `ddlSchemaName` is inherited from `PostgresSchema` and returns\n* `UNBOUND_NAMESPACE_ID`. Downstream helpers such as `qualifyTableName`\n* route through the polymorphic factory and produce unqualified output\n* automatically.\n*/\nvar PostgresUnboundSchema = class PostgresUnboundSchema extends PostgresSchema {\n\tstatic instance = new PostgresUnboundSchema();\n\tconstructor(input) {\n\t\tsuper(input ?? {\n\t\t\tid: UNBOUND_NAMESPACE_ID,\n\t\t\tentries: { table: {} }\n\t\t});\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyTable(tableName) {\n\t\treturn `\"${tableName}\"`;\n\t}\n\tschemaSqlExpression() {\n\t\treturn \"current_schema()\";\n\t}\n\tschemaFilterExpression() {\n\t\treturn cfExpr.raw(\"current_schema()\", {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: false\n\t\t});\n\t}\n\ttableSource(tableName, alias) {\n\t\treturn new PostgresTableSource({\n\t\t\tname: tableName,\n\t\t\t...ifDefined(\"alias\", alias)\n\t\t});\n\t}\n};\nPostgresSchema.unbound = PostgresUnboundSchema.instance;\n/**\n* Narrow an arbitrary namespace (or `undefined`) to `PostgresSchema`\n* so callers can dispatch to the polymorphic emission methods without\n* branching at the call site. Uses the structural `kind` discriminator\n* (`'schema'`) rather than `instanceof` so the check survives realm /\n* bundle / hot-reload boundaries — matching the rest of the IR's\n* narrowing convention. `PostgresUnboundSchema` passes through because\n* it inherits the same `kind: 'schema'` from `PostgresSchema`.\n*/\nfunction isPostgresSchema(ns) {\n\treturn ns?.kind === \"schema\";\n}\n/**\n* Target-supplied `Namespace` factory the Postgres target plumbs\n* through `defineContract({ createNamespace })` and the SQL PSL\n* interpreter. Returns the unbound singleton for the framework\n* sentinel and a fresh `PostgresSchema` for any other coordinate.\n*\n* The factory has no per-call state — every named id deterministically\n* maps to a distinct schema instance — so callers can pass it through\n* by reference and trust the resulting `SqlStorage.namespaces` map to\n* be value-stable for a given input set. Native-enum column type names are\n* schema-qualified earlier, at column construction, via the target's\n* `authoring.qualifyColumnType` hook (`postgresQualifyColumnType`), so this\n* factory just materialises the namespace from already-qualified entries.\n*/\nfunction postgresCreateNamespace(input) {\n\tconst schemaInput = {\n\t\tid: input.id,\n\t\tentries: {\n\t\t\t...input.entries,\n\t\t\ttable: input.entries[\"table\"] ?? {}\n\t\t}\n\t};\n\tif (input.id === UNBOUND_NAMESPACE_ID) return new PostgresUnboundSchema(schemaInput);\n\treturn new PostgresSchema(schemaInput);\n}\n//#endregion\nexport { PostgresRlsPolicy as _, nativeEnumEntityKind as a, roleEntityKind as c, PostgresNativeEnumSchema as d, PostgresRlsEnablementSchema as f, ROLE_DEFAULT_CONTROL_POLICY as g, PostgresRole as h, postgresCreateNamespace as i, policyInputFromSerialized as l, PostgresRoleSchema as m, PostgresUnboundSchema as n, policyEntityKind as o, PostgresRlsPolicySchema as p, isPostgresSchema as r, rlsEnablementEntityKind as s, PostgresSchema as t, PostgresTableSource as u, PostgresRlsEnablement as v };\n\n//# sourceMappingURL=postgres-schema-B3t7Zr52.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,wBAAwB,cAAc,QAAQ;CACjD,OAAO;CACP;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,YAAY,MAAM;EACvB,KAAK,cAAc,MAAM;EACzB,WAAW,IAAI;CAChB;AACD;;;;;;;;;;;;;;AAgBA,IAAI,oBAAoB,cAAc,QAAQ;CAC7C,OAAO;CACP;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,OAAO,OAAO,MAAM,MAAM;EAC/B,IAAI,MAAM,OAAO,SAAS,QAAQ,KAAK,SAAS,MAAM,OAAO;EAC7D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I,sBAAsB;CAC5C,YAAY,OAAO;EAClB,MAAM,SAAS;GACd,IAAI;GACJ,SAAS,EAAE,OAAO,CAAC,EAAE;EACtB,CAAC;CACF;CACA,YAAY;EACX,OAAO;CACR;CACA,aAAa,WAAW;EACvB,OAAO,IAAI,UAAU;CACtB;CACA,sBAAsB;EACrB,OAAO;CACR;CACA,yBAAyB;EACxB,OAAO,OAAO,IAAI,oBAAoB;GACrC,SAAS;GACT,UAAU;EACX,CAAC;CACF;CACA,YAAY,WAAW,OAAO;EAC7B,OAAO,IAAI,oBAAoB;GAC9B,MAAM;GACN,GAAG,UAAU,SAAS,KAAK;EAC5B,CAAC;CACF;AACD;AACA,eAAe,UAAU,sBAAsB;;;;;;;;;;AAU/C,SAAS,iBAAiB,IAAI;CAC7B,OAAO,IAAI,SAAS;AACrB;;;;;;;;;;;;;;;AAeA,SAAS,wBAAwB,OAAO;CACvC,MAAM,cAAc;EACnB,IAAI,MAAM;EACV,SAAS;GACR,GAAG,MAAM;GACT,OAAO,MAAM,QAAQ,YAAY,CAAC;EACnC;CACD;CACA,IAAI,MAAM,OAAO,sBAAsB,OAAO,IAAI,sBAAsB,WAAW;CACnF,OAAO,IAAI,eAAe,WAAW;AACtC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
2
2
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
3
|
import { isThenable } from "@prisma/orm-framework/utils/promise";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/render-ops-
|
|
4
|
+
//#region ../../../3-targets/3-targets/postgres/dist/render-ops-D2vJApKB.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Asserts an op materialised by an `OpFactoryCall` targets postgres. The
|
|
7
7
|
* extension surface lets any contributor emit calls, so this is the
|
|
@@ -31,4 +31,4 @@ function renderOps(calls, lowerer) {
|
|
|
31
31
|
//#endregion
|
|
32
32
|
export { renderOps as t };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=render-ops-
|
|
34
|
+
//# sourceMappingURL=render-ops-D2vJApKB-B281fzmn.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-ops-
|
|
1
|
+
{"version":3,"file":"render-ops-D2vJApKB-B281fzmn.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/render-ops-D2vJApKB.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isThenable } from \"@internal/utils/promise\";\n//#region src/core/migrations/render-ops.ts\n/**\n* Asserts an op materialised by an `OpFactoryCall` targets postgres. The\n* extension surface lets any contributor emit calls, so this is the\n* integration boundary where a stray non-postgres op would otherwise\n* silently flow through to postgres-shaped renderers — exactly the\n* place to fail loudly with op metadata (`id` + `target.id`).\n*/\nfunction assertPostgresOp(op, callFactoryName) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== \"postgres\") throw postgresError(\"MIGRATION.TARGET_MISMATCH\", `renderOps: expected postgres op but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${callFactoryName}\"). An OpFactoryCall produced an op for a different target on the postgres planner path; check the call's target binding.`, { meta: {\n\t\topId: op.id,\n\t\ttargetId: String(targetId),\n\t\tfactoryName: callFactoryName\n\t} });\n}\nfunction renderOps(calls, lowerer) {\n\treturn calls.map((c) => {\n\t\tconst opOrPromise = blindCast(c).toOp(lowerer);\n\t\tif (isThenable(opOrPromise)) return opOrPromise.then((op) => {\n\t\t\tassertPostgresOp(op, c.factoryName);\n\t\t\treturn op;\n\t\t});\n\t\tassertPostgresOp(opOrPromise, c.factoryName);\n\t\treturn opOrPromise;\n\t});\n}\n//#endregion\nexport { renderOps as t };\n\n//# sourceMappingURL=render-ops-D2vJApKB.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,iBAAiB,IAAI,iBAAiB;CAC9C,MAAM,WAAW,UAAU,EAAE,CAAC,CAAC,QAAQ;CACvC,IAAI,aAAa,YAAY,MAAM,cAAc,6BAA6B,sDAAsD,OAAO,QAAQ,EAAE,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,4HAA4H,EAAE,MAAM;EAC/U,MAAM,GAAG;EACT,UAAU,OAAO,QAAQ;EACzB,aAAa;CACd,EAAE,CAAC;AACJ;AACA,SAAS,UAAU,OAAO,SAAS;CAClC,OAAO,MAAM,KAAK,MAAM;EACvB,MAAM,cAAc,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO;EAC7C,IAAI,WAAW,WAAW,GAAG,OAAO,YAAY,MAAM,OAAO;GAC5D,iBAAiB,IAAI,EAAE,WAAW;GAClC,OAAO;EACR,CAAC;EACD,iBAAiB,aAAa,EAAE,WAAW;EAC3C,OAAO;CACR,CAAC;AACF"}
|
package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
|
|
2
|
-
import { d as isPostgresSchema } from "./postgres-schema-
|
|
2
|
+
import { d as isPostgresSchema } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
|
|
3
3
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-
|
|
4
|
+
//#region ../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-Cab6g5MC.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Given the contract's storage and a namespace id, returns the live Postgres
|
|
7
7
|
* DDL schema name that namespace maps to. A named Postgres namespace dispatches
|
|
@@ -19,4 +19,4 @@ function resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {
|
|
|
19
19
|
//#endregion
|
|
20
20
|
export { resolveDdlSchemaForNamespaceStorage as t };
|
|
21
21
|
|
|
22
|
-
//# sourceMappingURL=resolve-ddl-schema-
|
|
22
|
+
//# sourceMappingURL=resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-ddl-schema-
|
|
1
|
+
{"version":3,"file":"resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-Cab6g5MC.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/resolve-ddl-schema.ts\n/**\n* Given the contract's storage and a namespace id, returns the live Postgres\n* DDL schema name that namespace maps to. A named Postgres namespace dispatches\n* to its `ddlSchemaName(storage)`; the unbound sentinel resolves to\n* `DEFAULT_NAMESPACE_ID` (the search-path default for offline planning); a\n* bare object payload (used by some tests) falls back to the namespace id\n* itself.\n*/\nfunction resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {\n\tif (namespaceId === UNBOUND_NAMESPACE_ID) return DEFAULT_NAMESPACE_ID;\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace && isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n//#endregion\nexport { resolveDdlSchemaForNamespaceStorage as t };\n\n//# sourceMappingURL=resolve-ddl-schema-Cab6g5MC.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oCAAoC,SAAS,aAAa;CAClE,IAAI,gBAAgB,sBAAsB,OAAO;CACjD,MAAM,YAAY,QAAQ,WAAW;CACrC,IAAI,aAAa,iBAAiB,SAAS,GAAG,OAAO,UAAU,cAAc,OAAO;CACpF,OAAO;AACR"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as postgresDriverDescriptorMeta, n as isPostgresError, r as normalizePgError, t as isAlreadyConnectedError } from "./normalize-error-CNjgVO71-CLlZ3CuJ.mjs";
|
|
2
2
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
3
|
import { suppressIdleConnectionErrors, suppressIdleConnectionErrors as suppressIdleConnectionErrors$1 } from "@prisma/orm-framework/utils/suppress-idle-connection-errors";
|
|
4
|
-
import { Pool } from "pg";
|
|
4
|
+
import { Pool, types } from "pg";
|
|
5
5
|
import Cursor from "pg-cursor";
|
|
6
6
|
//#region ../../../3-targets/7-drivers/postgres/dist/runtime.mjs
|
|
7
7
|
function driverError(code, message, details) {
|
|
@@ -71,6 +71,41 @@ var NamedCursor = class extends Cursor {
|
|
|
71
71
|
conn.once("rowDescription", self._rowDescription);
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
+
const DATE_OID = 1082;
|
|
75
|
+
const TIME_OID = 1083;
|
|
76
|
+
const TIMESTAMP_OID = 1114;
|
|
77
|
+
const TIMESTAMPTZ_OID = 1184;
|
|
78
|
+
const DATE_ARRAY_OID = 1182;
|
|
79
|
+
const TIME_ARRAY_OID = 1183;
|
|
80
|
+
const TIMESTAMP_ARRAY_OID = 1115;
|
|
81
|
+
const TIMESTAMPTZ_ARRAY_OID = 1185;
|
|
82
|
+
const TEMPORAL_SCALAR_OIDS = /* @__PURE__ */ new Set([
|
|
83
|
+
DATE_OID,
|
|
84
|
+
TIME_OID,
|
|
85
|
+
TIMESTAMP_OID,
|
|
86
|
+
TIMESTAMPTZ_OID
|
|
87
|
+
]);
|
|
88
|
+
const TEMPORAL_ARRAY_OIDS = /* @__PURE__ */ new Set([
|
|
89
|
+
DATE_ARRAY_OID,
|
|
90
|
+
TIME_ARRAY_OID,
|
|
91
|
+
TIMESTAMP_ARRAY_OID,
|
|
92
|
+
TIMESTAMPTZ_ARRAY_OID
|
|
93
|
+
]);
|
|
94
|
+
function getTypeParser(oid, format) {
|
|
95
|
+
return blindCast(types.getTypeParser)(oid, format);
|
|
96
|
+
}
|
|
97
|
+
function serverText(value) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
function parseTextArray(value) {
|
|
101
|
+
if (!value) return null;
|
|
102
|
+
return blindCast(types.arrayParser).create(value).parse();
|
|
103
|
+
}
|
|
104
|
+
const temporalTextTypes = { getTypeParser(oid, format) {
|
|
105
|
+
if (TEMPORAL_SCALAR_OIDS.has(oid)) return serverText;
|
|
106
|
+
if (TEMPORAL_ARRAY_OIDS.has(oid)) return parseTextArray;
|
|
107
|
+
return getTypeParser(oid, format);
|
|
108
|
+
} };
|
|
74
109
|
const DEFAULT_BATCH_SIZE = 100;
|
|
75
110
|
const DEFAULT_PREPARED_STATEMENTS = true;
|
|
76
111
|
function createHandleAllocator() {
|
|
@@ -267,10 +302,12 @@ var PostgresQueryable = class {
|
|
|
267
302
|
}
|
|
268
303
|
async *executeWithCursor(client, sql, params, cursorBatchSize, name) {
|
|
269
304
|
const values = blindCast(params ?? []);
|
|
270
|
-
const
|
|
305
|
+
const config = { types: temporalTextTypes };
|
|
306
|
+
const cursor = client.query(name === void 0 ? new Cursor(sql, values, config) : new NamedCursor({
|
|
271
307
|
name,
|
|
272
308
|
text: sql,
|
|
273
|
-
values
|
|
309
|
+
values,
|
|
310
|
+
config
|
|
274
311
|
}));
|
|
275
312
|
try {
|
|
276
313
|
while (true) {
|
|
@@ -286,7 +323,8 @@ var PostgresQueryable = class {
|
|
|
286
323
|
const config = {
|
|
287
324
|
name,
|
|
288
325
|
text: sql,
|
|
289
|
-
values: blindCast(params ?? [])
|
|
326
|
+
values: blindCast(params ?? []),
|
|
327
|
+
types: temporalTextTypes
|
|
290
328
|
};
|
|
291
329
|
const releaseLock = await acquireClientQueryLock(client);
|
|
292
330
|
let result;
|
|
@@ -642,4 +680,4 @@ const postgresRuntimeDriverDescriptor = {
|
|
|
642
680
|
//#endregion
|
|
643
681
|
export { suppressIdleConnectionErrors$1 as n, postgresRuntimeDriverDescriptor as t };
|
|
644
682
|
|
|
645
|
-
//# sourceMappingURL=runtime-
|
|
683
|
+
//# sourceMappingURL=runtime-BJrfP1e8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-BJrfP1e8.mjs","names":["#queue","#connection","#onRelease","#onDestroy","#txState","#onSettled","#settle","#closed","suppressIdleConnectionErrors$1","#connected","#connectionMutex","#closeWhileHoldingLease","#connectPromise","#cursorOpts","#preparedStatements","#delegate","#requireDelegate","#wrapConnection"],"sources":["../../../../3-targets/7-drivers/postgres/dist/runtime.mjs"],"sourcesContent":["import { i as postgresDriverDescriptorMeta, n as isPostgresError, r as normalizePgError, t as isAlreadyConnectedError } from \"./normalize-error-CNjgVO71.mjs\";\nimport { suppressIdleConnectionErrors, suppressIdleConnectionErrors as suppressIdleConnectionErrors$1 } from \"@internal/utils/suppress-idle-connection-errors\";\nimport { Pool, types } from \"pg\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport Cursor from \"pg-cursor\";\n//#region src/driver-error.ts\nfunction driverError(code, message, details) {\n\tconst error = new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"RuntimeError\",\n\t\tconfigurable: true\n\t});\n\treturn details === void 0 ? Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\"\n\t}) : Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\",\n\t\tdetails\n\t});\n}\n//#endregion\n//#region src/callback-to-promise.ts\nfunction callbackToPromise(fn) {\n\treturn new Promise((resolve, reject) => {\n\t\tfn((err, result) => {\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(result);\n\t\t});\n\t});\n}\n//#endregion\n//#region src/named-cursor.ts\nlet nextNamedPortalId = 1;\n/** Streaming cursor for a server-side named prepared statement. */\nvar NamedCursor = class extends Cursor {\n\tname;\n\tconstructor(opts) {\n\t\tsuper(opts.text, [...opts.values], opts.config);\n\t\tthis.name = opts.name;\n\t\tthis.submit = this.submitNamed;\n\t}\n\tsubmitNamed(connection) {\n\t\tconst self = this;\n\t\tconst conn = connection;\n\t\tself.state = \"submitted\";\n\t\tself.connection = conn;\n\t\tself._portal = `np_${nextNamedPortalId++}`;\n\t\tif (!conn.parsedStatements[this.name]) {\n\t\t\tconst parseMessage = {\n\t\t\t\ttext: self.text,\n\t\t\t\tname: this.name,\n\t\t\t\ttypes: []\n\t\t\t};\n\t\t\tconn.parse(parseMessage, true);\n\t\t}\n\t\tconst bindMessage = {\n\t\t\tportal: self._portal,\n\t\t\tstatement: this.name,\n\t\t\tvalues: self.values ?? []\n\t\t};\n\t\tconn.bind(bindMessage, true);\n\t\tconn.describe({\n\t\t\ttype: \"P\",\n\t\t\tname: self._portal\n\t\t}, true);\n\t\tconn.flush();\n\t\tif (self._conf.types) self._result._getTypeParser = self._conf.types.getTypeParser;\n\t\tconn.once(\"noData\", self._ifNoData);\n\t\tconn.once(\"rowDescription\", self._rowDescription);\n\t}\n};\n//#endregion\n//#region src/temporal-text-parsers.ts\nconst DATE_OID = 1082;\nconst TIME_OID = 1083;\nconst TIMESTAMP_OID = 1114;\nconst TIMESTAMPTZ_OID = 1184;\nconst DATE_ARRAY_OID = 1182;\nconst TIME_ARRAY_OID = 1183;\nconst TIMESTAMP_ARRAY_OID = 1115;\nconst TIMESTAMPTZ_ARRAY_OID = 1185;\nconst TEMPORAL_SCALAR_OIDS = /* @__PURE__ */ new Set([\n\tDATE_OID,\n\tTIME_OID,\n\tTIMESTAMP_OID,\n\tTIMESTAMPTZ_OID\n]);\nconst TEMPORAL_ARRAY_OIDS = /* @__PURE__ */ new Set([\n\tDATE_ARRAY_OID,\n\tTIME_ARRAY_OID,\n\tTIMESTAMP_ARRAY_OID,\n\tTIMESTAMPTZ_ARRAY_OID\n]);\nfunction getTypeParser(oid, format) {\n\treturn blindCast(types.getTypeParser)(oid, format);\n}\nfunction serverText(value) {\n\treturn value;\n}\nfunction parseTextArray(value) {\n\tif (!value) return null;\n\treturn blindCast(types.arrayParser).create(value).parse();\n}\nconst temporalTextTypes = { getTypeParser(oid, format) {\n\tif (TEMPORAL_SCALAR_OIDS.has(oid)) return serverText;\n\tif (TEMPORAL_ARRAY_OIDS.has(oid)) return parseTextArray;\n\treturn getTypeParser(oid, format);\n} };\n//#endregion\n//#region src/postgres-driver.ts\nconst DEFAULT_BATCH_SIZE = 100;\nconst DEFAULT_PREPARED_STATEMENTS = true;\nfunction createHandleAllocator() {\n\tlet next = 1;\n\treturn { mint: () => `pn_${next++}` };\n}\nfunction buildConnectionOptions(options) {\n\treturn {\n\t\t...options.cursor?.disabled ? { cursorDisabled: true } : {\n\t\t\tcursorBatchSize: options.cursor?.batchSize ?? DEFAULT_BATCH_SIZE,\n\t\t\tcursorDisabled: false\n\t\t},\n\t\tpreparedStatementsEnabled: options.preparedStatements ?? DEFAULT_PREPARED_STATEMENTS,\n\t\thandleAllocator: createHandleAllocator()\n\t};\n}\nfunction isStalePreparedStatementError(error) {\n\tif (!(error instanceof Error) || !(\"code\" in error) || typeof error.code !== \"string\") return false;\n\tconst code = error.code;\n\treturn code === \"26000\" || code === \"0A000\";\n}\nvar AsyncMutex = class {\n\t#queue = Promise.resolve();\n\tasync lock() {\n\t\tconst previous = this.#queue;\n\t\tlet releaseLock;\n\t\tthis.#queue = new Promise((resolve) => {\n\t\t\treleaseLock = resolve;\n\t\t});\n\t\tawait previous;\n\t\treturn () => {\n\t\t\treleaseLock?.();\n\t\t\treleaseLock = void 0;\n\t\t};\n\t}\n};\nconst clientQueryLocks = /* @__PURE__ */ new WeakMap();\nfunction acquireClientQueryLock(client) {\n\tlet mutex = clientQueryLocks.get(client);\n\tif (mutex === void 0) {\n\t\tmutex = new AsyncMutex();\n\t\tclientQueryLocks.set(client, mutex);\n\t}\n\treturn mutex.lock();\n}\nvar PostgresQueryable = class {\n\toptions;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t}\n\tasync *query(request) {\n\t\ttry {\n\t\t\tconst preparedStatementHandle = request.preparedStatementHandle;\n\t\t\tif (preparedStatementHandle === void 0 || !this.options.preparedStatementsEnabled) {\n\t\t\t\tyield* this.runQuery(request);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst name = this.preparedStatementName(preparedStatementHandle);\n\t\t\tyield* this.withStaleHandleStreamRetry(preparedStatementHandle, name, (name) => this.runQuery(request, name));\n\t\t} catch (error) {\n\t\t\tthrow normalizePgError(error);\n\t\t}\n\t}\n\tasync execute(request) {\n\t\ttry {\n\t\t\tconst preparedStatementHandle = request.preparedStatementHandle;\n\t\t\tif (preparedStatementHandle === void 0 || !this.options.preparedStatementsEnabled) return await this.runExecute(request);\n\t\t\tconst name = this.preparedStatementName(preparedStatementHandle);\n\t\t\treturn await this.withStaleHandleRetry(preparedStatementHandle, name, (name) => this.runExecute(request, name));\n\t\t} catch (error) {\n\t\t\tthrow normalizePgError(error);\n\t\t}\n\t}\n\tpreparedStatementName(handle) {\n\t\tconst existingName = handle.get();\n\t\tif (typeof existingName === \"string\") return existingName;\n\t\tconst mintedName = this.options.handleAllocator.mint();\n\t\thandle.set(mintedName);\n\t\treturn mintedName;\n\t}\n\tasync withStaleHandleRetry(preparedStatementHandle, name, attempt) {\n\t\ttry {\n\t\t\treturn await attempt(name);\n\t\t} catch (error) {\n\t\t\tif (!isStalePreparedStatementError(error)) throw error;\n\t\t\tconst retryName = this.options.handleAllocator.mint();\n\t\t\tpreparedStatementHandle.set(retryName);\n\t\t\ttry {\n\t\t\t\treturn await attempt(retryName);\n\t\t\t} catch (retryError) {\n\t\t\t\tthrow prepareFailedError(retryError, retryName);\n\t\t\t}\n\t\t}\n\t}\n\tasync *withStaleHandleStreamRetry(preparedStatementHandle, name, attempt) {\n\t\tconst stream = await this.withStaleHandleRetry(preparedStatementHandle, name, async (name) => {\n\t\t\tconst iterator = attempt(name)[Symbol.asyncIterator]();\n\t\t\treturn {\n\t\t\t\titerator,\n\t\t\t\tfirst: await iterator.next()\n\t\t\t};\n\t\t});\n\t\tif (stream.first.done) return;\n\t\tlet streamCompleted = false;\n\t\ttry {\n\t\t\tyield stream.first.value;\n\t\t\twhile (true) {\n\t\t\t\tconst next = await stream.iterator.next();\n\t\t\t\tif (next.done) {\n\t\t\t\t\tstreamCompleted = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tyield next.value;\n\t\t\t}\n\t\t} finally {\n\t\t\tif (!streamCompleted) await stream.iterator.return?.();\n\t\t}\n\t}\n\tasync runExecute(request, name) {\n\t\tconst client = await this.acquireClient();\n\t\ttry {\n\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\ttry {\n\t\t\t\treturn { affectedRows: (await client.query({\n\t\t\t\t\tname,\n\t\t\t\t\ttext: request.sql,\n\t\t\t\t\tvalues: blindCast(request.params ?? [])\n\t\t\t\t})).rowCount ?? 0 };\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t}\n\tinExplicitTransaction() {\n\t\treturn false;\n\t}\n\tasync *runQuery(request, name) {\n\t\tconst client = await this.acquireClient();\n\t\ttry {\n\t\t\tif (!this.options.cursorDisabled) {\n\t\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\t\ttry {\n\t\t\t\t\tfor await (const row of this.streamWithPortalProtection(client, request, this.options.cursorBatchSize, name)) yield blindCast(row);\n\t\t\t\t\treturn;\n\t\t\t\t} catch (cursorError) {\n\t\t\t\t\tif (!(cursorError instanceof Error) || isPostgresError(cursorError)) throw cursorError;\n\t\t\t\t} finally {\n\t\t\t\t\treleaseLock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor await (const row of this.executeBuffered(client, request.sql, request.params, name)) yield blindCast(row);\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t}\n\tasync explain(request) {\n\t\tconst text = `EXPLAIN (FORMAT JSON) ${request.sql}`;\n\t\tconst client = await this.acquireClient();\n\t\ttry {\n\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\ttry {\n\t\t\t\treturn { rows: blindCast((await client.query(text, request.params === void 0 ? void 0 : [...request.params]).catch(rethrowNormalizedError)).rows) };\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t}\n\tasync *streamWithPortalProtection(client, request, cursorBatchSize, name) {\n\t\tif (this.inExplicitTransaction()) {\n\t\t\tyield* this.executeWithCursor(client, request.sql, request.params, cursorBatchSize, name);\n\t\t\treturn;\n\t\t}\n\t\tawait client.query(\"BEGIN\");\n\t\tlet streamFailed = false;\n\t\ttry {\n\t\t\tyield* this.executeWithCursor(client, request.sql, request.params, cursorBatchSize, name);\n\t\t} catch (error) {\n\t\t\tstreamFailed = true;\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tawait this.commitStreamSpan(client, streamFailed);\n\t\t}\n\t}\n\tasync commitStreamSpan(client, streamFailed) {\n\t\ttry {\n\t\t\tawait client.query(\"COMMIT\");\n\t\t} catch (commitError) {\n\t\t\tif (!streamFailed) throw commitError;\n\t\t}\n\t}\n\tasync *executeWithCursor(client, sql, params, cursorBatchSize, name) {\n\t\tconst values = blindCast(params ?? []);\n\t\tconst config = { types: temporalTextTypes };\n\t\tconst cursor = client.query(name === void 0 ? new Cursor(sql, values, config) : new NamedCursor({\n\t\t\tname,\n\t\t\ttext: sql,\n\t\t\tvalues,\n\t\t\tconfig\n\t\t}));\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst rows = await readCursor(cursor, cursorBatchSize);\n\t\t\t\tif (rows.length === 0) break;\n\t\t\t\tfor (const row of rows) yield row;\n\t\t\t}\n\t\t} finally {\n\t\t\tawait closeCursor(cursor);\n\t\t}\n\t}\n\tasync *executeBuffered(client, sql, params, name) {\n\t\tconst config = {\n\t\t\tname,\n\t\t\ttext: sql,\n\t\t\tvalues: blindCast(params ?? []),\n\t\t\ttypes: temporalTextTypes\n\t\t};\n\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await client.query(config);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t\tfor (const row of blindCast(result.rows)) yield row;\n\t}\n};\nvar PostgresConnectionImpl = class extends PostgresQueryable {\n\t#connection;\n\t#onRelease;\n\t#onDestroy;\n\t#txState;\n\tconstructor(connection, options, onRelease, onDestroy, txState) {\n\t\tsuper(options);\n\t\tthis.#connection = connection;\n\t\tthis.#onRelease = onRelease;\n\t\tthis.#onDestroy = onDestroy;\n\t\tthis.#txState = txState ?? { open: false };\n\t}\n\tacquireClient() {\n\t\treturn Promise.resolve(this.#connection);\n\t}\n\treleaseClient(_client) {\n\t\treturn Promise.resolve();\n\t}\n\tinExplicitTransaction() {\n\t\treturn this.#txState.open;\n\t}\n\tasync beginTransaction() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tawait this.#connection.query(\"BEGIN\").catch(rethrowNormalizedError);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t\tthis.#txState.open = true;\n\t\treturn new PostgresTransactionImpl(this.#connection, this.options, () => {\n\t\t\tthis.#txState.open = false;\n\t\t});\n\t}\n\tasync release() {\n\t\tconst conn = this.#connection;\n\t\tif (\"release\" in conn) conn.release();\n\t\tconst onRelease = this.#onRelease;\n\t\tthis.#onRelease = void 0;\n\t\tthis.#onDestroy = void 0;\n\t\tonRelease?.();\n\t}\n\tasync destroy(reason) {\n\t\tconst onDestroy = this.#onDestroy;\n\t\tconst onRelease = this.#onRelease;\n\t\tthis.#onDestroy = void 0;\n\t\tthis.#onRelease = void 0;\n\t\tconst conn = this.#connection;\n\t\tif (\"release\" in conn) {\n\t\t\tconst releaseArg = reason instanceof Error ? reason : /* @__PURE__ */ new Error(\"Connection destroyed\");\n\t\t\tconn.release(releaseArg);\n\t\t}\n\t\tif (onDestroy) await onDestroy(reason);\n\t\telse onRelease?.();\n\t}\n};\nvar PostgresTransactionImpl = class extends PostgresQueryable {\n\t#connection;\n\t#onSettled;\n\tconstructor(connection, options, onSettled) {\n\t\tsuper(options);\n\t\tthis.#connection = connection;\n\t\tthis.#onSettled = onSettled;\n\t}\n\tacquireClient() {\n\t\treturn Promise.resolve(this.#connection);\n\t}\n\treleaseClient(_client) {\n\t\treturn Promise.resolve();\n\t}\n\tinExplicitTransaction() {\n\t\treturn true;\n\t}\n\t#settle() {\n\t\tconst onSettled = this.#onSettled;\n\t\tthis.#onSettled = void 0;\n\t\tonSettled?.();\n\t}\n\tasync commit() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tawait this.#connection.query(\"COMMIT\").catch(rethrowNormalizedError);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t\tthis.#settle();\n\t\t}\n\t}\n\tasync rollback() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tawait this.#connection.query(\"ROLLBACK\").catch(rethrowNormalizedError);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t\tthis.#settle();\n\t\t}\n\t}\n};\nvar PostgresPoolDriverImpl = class extends PostgresQueryable {\n\tpool;\n\t#closed = false;\n\tconstructor(options) {\n\t\tsuper(buildConnectionOptions(options));\n\t\tthis.pool = options.connect.pool;\n\t}\n\tget state() {\n\t\treturn this.#closed ? \"closed\" : \"connected\";\n\t}\n\tasync connect(_binding) {}\n\tasync acquireConnection() {\n\t\treturn new PostgresConnectionImpl(await this.acquireClient(), this.options);\n\t}\n\tasync close() {\n\t\tif (this.#closed) return;\n\t\tthis.#closed = true;\n\t\tawait this.pool.end();\n\t}\n\tasync acquireClient() {\n\t\treturn suppressIdleConnectionErrors$1(await this.pool.connect());\n\t}\n\tasync releaseClient(client) {\n\t\tclient.release();\n\t}\n};\nvar PostgresDirectDriverImpl = class extends PostgresQueryable {\n\tdirectClient;\n\t#connectionMutex = new AsyncMutex();\n\t#closed = false;\n\t#connected = false;\n\t#connectPromise;\n\t#txState = { open: false };\n\tconstructor(options) {\n\t\tsuper(buildConnectionOptions(options));\n\t\tthis.directClient = options.connect.client;\n\t\tthis.directClient.on(\"error\", () => {\n\t\t\tthis.#closed = true;\n\t\t\tthis.#connected = false;\n\t\t});\n\t}\n\tinExplicitTransaction() {\n\t\treturn this.#txState.open;\n\t}\n\tget state() {\n\t\treturn this.#closed ? \"closed\" : \"connected\";\n\t}\n\tasync connect(_binding) {}\n\tasync acquireConnection() {\n\t\tconst releaseLease = await this.#connectionMutex.lock();\n\t\ttry {\n\t\t\treturn new PostgresConnectionImpl(await this.acquireClient(), this.options, releaseLease, async () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait this.#closeWhileHoldingLease();\n\t\t\t\t} finally {\n\t\t\t\t\treleaseLease();\n\t\t\t\t}\n\t\t\t}, this.#txState);\n\t\t} catch (error) {\n\t\t\treleaseLease();\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync close() {\n\t\tconst releaseLease = await this.#connectionMutex.lock();\n\t\ttry {\n\t\t\tawait this.#closeWhileHoldingLease();\n\t\t} finally {\n\t\t\treleaseLease();\n\t\t}\n\t}\n\tasync #closeWhileHoldingLease() {\n\t\tif (this.#closed) return;\n\t\tthis.#closed = true;\n\t\tawait this.directClient.end();\n\t\tthis.#connected = false;\n\t}\n\tasync acquireClient() {\n\t\tif (this.#closed) throw driverError(\"DRIVER.NOT_CONNECTED\", \"Postgres connection lost or closed. Create a new client to reconnect.\");\n\t\tif (this.#connected) return this.directClient;\n\t\tif (this.#connectPromise !== void 0) {\n\t\t\tawait this.#connectPromise;\n\t\t\treturn this.directClient;\n\t\t}\n\t\tthis.#connectPromise = (async () => {\n\t\t\ttry {\n\t\t\t\tawait this.directClient.connect();\n\t\t\t} catch (error) {\n\t\t\t\tif (!isAlreadyConnectedError(error)) throw error;\n\t\t\t} finally {\n\t\t\t\tthis.#connectPromise = void 0;\n\t\t\t}\n\t\t\tthis.#connected = true;\n\t\t})();\n\t\tawait this.#connectPromise;\n\t\treturn this.directClient;\n\t}\n\tasync releaseClient(_client) {}\n};\nfunction createBoundDriverFromBinding(binding, cursorOpts, extraOpts) {\n\tconst preparedStatements = extraOpts?.preparedStatements;\n\tswitch (binding.kind) {\n\t\tcase \"url\": return new PostgresPoolDriverImpl({\n\t\t\tconnect: { pool: suppressIdleConnectionErrors$1(new Pool({\n\t\t\t\tconnectionString: binding.url,\n\t\t\t\tconnectionTimeoutMillis: 2e4,\n\t\t\t\tidleTimeoutMillis: 3e4\n\t\t\t})) },\n\t\t\tcursor: cursorOpts,\n\t\t\tpreparedStatements\n\t\t});\n\t\tcase \"pgPool\": return new PostgresPoolDriverImpl({\n\t\t\tconnect: { pool: suppressIdleConnectionErrors$1(binding.pool) },\n\t\t\tcursor: cursorOpts,\n\t\t\tpreparedStatements\n\t\t});\n\t\tcase \"pgClient\": return new PostgresDirectDriverImpl({\n\t\t\tconnect: { client: suppressIdleConnectionErrors$1(binding.client) },\n\t\t\tcursor: cursorOpts,\n\t\t\tpreparedStatements\n\t\t});\n\t}\n}\nfunction readCursor(cursor, size) {\n\treturn callbackToPromise((cb) => {\n\t\tcursor.read(size, (err, rows) => cb(err, rows));\n\t});\n}\nfunction closeCursor(cursor) {\n\treturn callbackToPromise((cb) => cursor.close(cb));\n}\nfunction rethrowNormalizedError(error) {\n\tthrow normalizePgError(error);\n}\nfunction prepareFailedError(retryError, handle) {\n\tconst cause = normalizePgError(retryError);\n\treturn Object.assign(driverError(\"DRIVER.PREPARE_FAILED\", `Prepared statement failed again after re-preparing with a fresh handle: ${cause.message}`, { handle }), { cause });\n}\n//#endregion\n//#region src/exports/runtime.ts\nconst USE_BEFORE_CONNECT_MESSAGE = \"Postgres driver not connected. Call connect(binding) before acquireConnection or execute.\";\nconst ALREADY_CONNECTED_MESSAGE = \"Postgres driver already connected. Call close() before reconnecting with a new binding.\";\nfunction unboundQuery() {\n\treturn { [Symbol.asyncIterator]() {\n\t\treturn { async next() {\n\t\t\tthrow driverError(\"DRIVER.NOT_CONNECTED\", USE_BEFORE_CONNECT_MESSAGE);\n\t\t} };\n\t} };\n}\nvar PostgresUnboundDriverImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\t#delegate = null;\n\t#closed = false;\n\t#cursorOpts;\n\t#preparedStatements;\n\tconstructor(options) {\n\t\tthis.#cursorOpts = options?.cursor;\n\t\tthis.#preparedStatements = options?.preparedStatements;\n\t}\n\tget state() {\n\t\tif (this.#delegate !== null) return \"connected\";\n\t\tif (this.#closed) return \"closed\";\n\t\treturn \"unbound\";\n\t}\n\t#requireDelegate() {\n\t\tconst delegate = this.#delegate;\n\t\tif (delegate === null) throw driverError(\"DRIVER.NOT_CONNECTED\", USE_BEFORE_CONNECT_MESSAGE);\n\t\treturn delegate;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#delegate !== null) throw driverError(\"DRIVER.ALREADY_CONNECTED\", ALREADY_CONNECTED_MESSAGE, { bindingKind: binding.kind });\n\t\tthis.#delegate = createBoundDriverFromBinding(binding, this.#cursorOpts, { preparedStatements: this.#preparedStatements });\n\t\tthis.#closed = false;\n\t}\n\tasync acquireConnection() {\n\t\tconst delegate = this.#requireDelegate();\n\t\tconst connection = await delegate.acquireConnection();\n\t\treturn this.#wrapConnection(connection, delegate);\n\t}\n\t/**\n\t* Wraps an acquired connection so that teardown paths which close the\n\t* underlying delegate (notably `destroy()` on a pgClient binding, where\n\t* the single socket means a destroyed connection invalidates the driver)\n\t* also reset our own `#delegate` reference. Without this, a failed\n\t* transaction rollback would leave the outer unbound wrapper reporting\n\t* `connected` while routing subsequent work to an already-ended delegate.\n\t*/\n\t#wrapConnection(connection, delegate) {\n\t\tconst syncDelegateState = () => {\n\t\t\tif (this.#delegate === delegate && delegate.state === \"closed\") {\n\t\t\t\tthis.#delegate = null;\n\t\t\t\tthis.#closed = true;\n\t\t\t}\n\t\t};\n\t\tconst wrapped = {\n\t\t\tbeginTransaction: connection.beginTransaction.bind(connection),\n\t\t\tquery: connection.query.bind(connection),\n\t\t\texecute: connection.execute.bind(connection),\n\t\t\trelease: async () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait connection.release();\n\t\t\t\t} finally {\n\t\t\t\t\tsyncDelegateState();\n\t\t\t\t}\n\t\t\t},\n\t\t\tdestroy: async (reason) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait connection.destroy(reason);\n\t\t\t\t} finally {\n\t\t\t\t\tsyncDelegateState();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tif (connection.explain) wrapped.explain = connection.explain.bind(connection);\n\t\treturn wrapped;\n\t}\n\tasync close() {\n\t\tconst delegate = this.#delegate;\n\t\tif (delegate !== null) {\n\t\t\tthis.#delegate = null;\n\t\t\tawait delegate.close();\n\t\t}\n\t\tthis.#closed = true;\n\t}\n\tquery(request) {\n\t\tconst delegate = this.#delegate;\n\t\treturn delegate === null ? unboundQuery() : delegate.query(request);\n\t}\n\tasync execute(request) {\n\t\tconst delegate = this.#delegate;\n\t\tif (delegate === null) throw driverError(\"DRIVER.NOT_CONNECTED\", USE_BEFORE_CONNECT_MESSAGE);\n\t\treturn delegate.execute(request);\n\t}\n\tasync explain(request) {\n\t\tconst delegate = this.#requireDelegate();\n\t\tconst explain = delegate.explain;\n\t\tif (explain === void 0) throw driverError(\"DRIVER.NOT_CONNECTED\", USE_BEFORE_CONNECT_MESSAGE);\n\t\treturn explain.call(delegate, request);\n\t}\n};\nconst postgresRuntimeDriverDescriptor = {\n\t...postgresDriverDescriptorMeta,\n\tcreate(options) {\n\t\treturn new PostgresUnboundDriverImpl(options);\n\t}\n};\n//#endregion\nexport { postgresRuntimeDriverDescriptor as default, suppressIdleConnectionErrors };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;AAMA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,MAAM,QAAQ,IAAI,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H,MAAM,WAAW,QAAQ,MAAM;IAChC,UAAU;KACT,kBAAkB;IACnB;GACD;EACD;EACA,IAAI,WAAW,SAAS,QAAQ,UAAU,WAAW,QAAQ,KAAK,UAAU;EAC5E,OAAO;CACR;CACA,MAAM,QAAQ;EACb,MAAM,WAAW,KAAKQ;EACtB,IAAI,aAAa,MAAM;GACtB,KAAKA,YAAY;GACjB,MAAM,SAAS,MAAM;EACtB;EACA,KAAKR,UAAU;CAChB;CACA,MAAM,SAAS;EACd,MAAM,WAAW,KAAKQ;EACtB,OAAO,aAAa,OAAO,aAAa,IAAI,SAAS,MAAM,OAAO;CACnE;CACA,MAAM,QAAQ,SAAS;EACtB,MAAM,WAAW,KAAKA;EACtB,IAAI,aAAa,MAAM,MAAM,YAAY,wBAAwB,0BAA0B;EAC3F,OAAO,SAAS,QAAQ,OAAO;CAChC;CACA,MAAM,QAAQ,SAAS;EACtB,MAAM,WAAW,KAAKC,iBAAiB;EACvC,MAAM,UAAU,SAAS;EACzB,IAAI,YAAY,KAAK,GAAG,MAAM,YAAY,wBAAwB,0BAA0B;EAC5F,OAAO,QAAQ,KAAK,UAAU,OAAO;CACtC;AACD;AACA,MAAM,kCAAkC;CACvC,GAAG;CACH,OAAO,SAAS;EACf,OAAO,IAAI,0BAA0B,OAAO;CAC7C;AACD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./instant-now-generator-lJQqn_8K-JOzseqXI.mjs";
|
|
1
2
|
import "./postgres-contract-view-2OP5JnXl-D2fpy4-8.mjs";
|
|
2
3
|
import { AnyCodecDescriptor } from "@prisma/orm-framework/components/codec";
|
|
3
4
|
import { AnyEntityKindDescriptor, Namespace } from "@prisma/orm-framework/components/ir";
|
|
@@ -29,4 +30,4 @@ declare const postgresRuntimeTargetDescriptor: RuntimeTargetDescriptor<'sql', 'p
|
|
|
29
30
|
};
|
|
30
31
|
//#endregion
|
|
31
32
|
export { PostgresRuntimeTargetInstance as n, postgresRuntimeTargetDescriptor as r, PostgresContractSerializer as t };
|
|
32
|
-
//# sourceMappingURL=runtime-
|
|
33
|
+
//# sourceMappingURL=runtime-bbCw9Omq.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bbCw9Omq.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;cAWc,mCAAmC,0BAA0B,SAAS;EAClF,qBAAqB;EACrB,YAAY,gCAAgC;YAClC,yBAAyB,cAAc,KAAK,0BAA0B,YAAY;EAC5F,kBAAkB,UAAU,SAAS,cAAc;;;;UAI3C,sCAAsC;;;;;;;cAOlC,iCAAiC,2CAA2C;WAC/E,uBAAuB"}
|