@prisma/orm-target-postgres 8.0.0-rc.23-dev.11 → 8.0.0-rc.23-dev.12
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-BRTXHtXv-CTn1Kl9-.mjs → adapter-BRTXHtXv-DBeQuJnG.mjs} +5 -5
- package/dist/{adapter-BRTXHtXv-CTn1Kl9-.mjs.map → adapter-BRTXHtXv-DBeQuJnG.mjs.map} +1 -1
- package/dist/{adapter-D6S0To9M.d.mts → adapter-DXebVrOK.d.mts} +12 -12
- package/dist/{adapter-D6S0To9M.d.mts.map → adapter-DXebVrOK.d.mts.map} +1 -1
- package/dist/adapter.d.mts +1 -1
- package/dist/adapter.mjs +5 -5
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__control.mjs +4 -4
- package/dist/adapter__runtime.mjs +5 -5
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{aggregates-C2c48ORM.d.mts → aggregates-CJGvlOCM.d.mts} +12 -12
- package/dist/{aggregates-C2c48ORM.d.mts.map → aggregates-CJGvlOCM.d.mts.map} +1 -1
- package/dist/{authoring-BD4uEpBM-DIJiGq4e.mjs → authoring-BbS0bin5-U9tXyzS6.mjs} +6 -6
- package/dist/{authoring-BD4uEpBM-DIJiGq4e.mjs.map → authoring-BbS0bin5-U9tXyzS6.mjs.map} +1 -1
- package/dist/{autoincrement-widths-B_JzBc-a-R7zoqIc3.mjs → autoincrement-widths-PwZcc5Co-1O2WEMYq.mjs} +3 -3
- package/dist/{autoincrement-widths-B_JzBc-a-R7zoqIc3.mjs.map → autoincrement-widths-PwZcc5Co-1O2WEMYq.mjs.map} +1 -1
- package/dist/{check-expressions-DL9WtMO5-CUcbN2JG.mjs → check-expressions-Ch-A_NJN-BscDa8xT.mjs} +3 -3
- package/dist/{check-expressions-DL9WtMO5-CUcbN2JG.mjs.map → check-expressions-Ch-A_NJN-BscDa8xT.mjs.map} +1 -1
- package/dist/{codec-registry-7LHPD8C1-BALCyEB-.mjs → codec-registry-B0LsFn7Z-ej9yKwTq.mjs} +4 -4
- package/dist/{codec-registry-7LHPD8C1-BALCyEB-.mjs.map → codec-registry-B0LsFn7Z-ej9yKwTq.mjs.map} +1 -1
- package/dist/{codecs-CV-_K-z0-DZc60ccR.mjs → codecs-Bzj3M0Q3-C2oFSIGs.mjs} +4 -4
- package/dist/{codecs-CV-_K-z0-DZc60ccR.mjs.map → codecs-Bzj3M0Q3-C2oFSIGs.mjs.map} +1 -1
- package/dist/{contract-contributions-n5CdvwA9-CuIvRgJp.mjs → contract-contributions-n5CdvwA9-BgUoiuTT.mjs} +8 -8
- package/dist/{contract-contributions-n5CdvwA9-CuIvRgJp.mjs.map → contract-contributions-n5CdvwA9-BgUoiuTT.mjs.map} +1 -1
- package/dist/{contract-free-DmNEp1_Y.mjs → contract-free-DiRem1nw.mjs} +3 -3
- package/dist/{contract-free-DmNEp1_Y.mjs.map → contract-free-DiRem1nw.mjs.map} +1 -1
- package/dist/{control-policy-CR-lrrd1-CESfQKqn.mjs → control-policy-DKnVhEWD-xuJIvCy9.mjs} +9 -9
- package/dist/{control-policy-CR-lrrd1-CESfQKqn.mjs.map → control-policy-DKnVhEWD-xuJIvCy9.mjs.map} +1 -1
- package/dist/{data-type-entries-dmLDRSOf-BJADXpXD.mjs → data-type-entries-CVxsfjF3-Bd0cSfuG.mjs} +3 -3
- package/dist/{data-type-entries-dmLDRSOf-BJADXpXD.mjs.map → data-type-entries-CVxsfjF3-Bd0cSfuG.mjs.map} +1 -1
- package/dist/{data-types-B47LbZ3z-DRVqjvQZ.mjs → data-types-DWfwErIu-DF85cgmu.mjs} +4 -4
- package/dist/{data-types-B47LbZ3z-DRVqjvQZ.mjs.map → data-types-DWfwErIu-DF85cgmu.mjs.map} +1 -1
- package/dist/{date-time-now-generators-BMMGy0vy-BEbt_79F.mjs → date-time-now-generators-BORO1_nc-BdCe3ppq.mjs} +4 -4
- package/dist/{date-time-now-generators-BMMGy0vy-BEbt_79F.mjs.map → date-time-now-generators-BORO1_nc-BdCe3ppq.mjs.map} +1 -1
- package/dist/{ddl-qu-IzeH4-CFpSpY0X.mjs → ddl-DCQLfg18-BgWGYC7L.mjs} +3 -3
- package/dist/{ddl-qu-IzeH4-CFpSpY0X.mjs.map → ddl-DCQLfg18-BgWGYC7L.mjs.map} +1 -1
- package/dist/{descriptor-meta-CKsHlt_c-UQ14enZp.mjs → descriptor-meta-CKsHlt_c-DkP2ZqQd.mjs} +3 -3
- package/dist/{descriptor-meta-CKsHlt_c-UQ14enZp.mjs.map → descriptor-meta-CKsHlt_c-DkP2ZqQd.mjs.map} +1 -1
- package/dist/{descriptor-meta-DWKp5Q1s-DplRJE9N.mjs → descriptor-meta-xBYwG7xG-DWAZTiD5.mjs} +11 -11
- package/dist/{descriptor-meta-DWKp5Q1s-DplRJE9N.mjs.map → descriptor-meta-xBYwG7xG-DWAZTiD5.mjs.map} +1 -1
- package/dist/{diff-database-schema-CX_XzsE0-BwaMw0Gq.mjs → diff-database-schema-J96mtg_F-BHpzbMoj.mjs} +9 -9
- package/dist/{diff-database-schema-CX_XzsE0-BwaMw0Gq.mjs.map → diff-database-schema-J96mtg_F-BHpzbMoj.mjs.map} +1 -1
- package/dist/{errors-DpdPXR_L-DailcY-X.mjs → errors-C4-Dp3gI-B5jY5eJj.mjs} +4 -4
- package/dist/errors-C4-Dp3gI-B5jY5eJj.mjs.map +1 -0
- package/dist/{full-text-B9mXDcsJ.mjs → full-text-DGFJd1R3.mjs} +3 -3
- package/dist/{full-text-B9mXDcsJ.mjs.map → full-text-DGFJd1R3.mjs.map} +1 -1
- package/dist/{full-text-index-definition-MfjtL-x7-ImaTAFMs.mjs → full-text-index-definition-DzRCaPjb-0USKN1ZI.mjs} +3 -3
- package/dist/{full-text-index-definition-MfjtL-x7-ImaTAFMs.mjs.map → full-text-index-definition-DzRCaPjb-0USKN1ZI.mjs.map} +1 -1
- package/dist/{full-text-parsers-DIfNR9AQ-tVmTju-Y.mjs → full-text-parsers-D-2uupNS-6woSZ16T.mjs} +4 -4
- package/dist/{full-text-parsers-DIfNR9AQ-tVmTju-Y.mjs.map → full-text-parsers-D-2uupNS-6woSZ16T.mjs.map} +1 -1
- package/dist/{full-text-search-document-Ceg9d2K0-DJ4MklAU.mjs → full-text-search-document-BqqvjJoC-HaoeMaM5.mjs} +5 -5
- package/dist/{full-text-search-document-Ceg9d2K0-DJ4MklAU.mjs.map → full-text-search-document-BqqvjJoC-HaoeMaM5.mjs.map} +1 -1
- package/dist/{index-types-B5sQ5Vw0-DfXKO9-v.mjs → index-types-DGrgbAd4-DuGWdvol.mjs} +3 -3
- package/dist/{index-types-B5sQ5Vw0-DfXKO9-v.mjs.map → index-types-DGrgbAd4-DuGWdvol.mjs.map} +1 -1
- package/dist/{infer-psl-contract-DR0Uie7w-CkaPSdPc.mjs → infer-psl-contract-CAoJuV8y-Da9y8zwV.mjs} +8 -8
- package/dist/{infer-psl-contract-DR0Uie7w-CkaPSdPc.mjs.map → infer-psl-contract-CAoJuV8y-Da9y8zwV.mjs.map} +1 -1
- package/dist/migration-Be_iuIpn.mjs.map +1 -1
- package/dist/{native-type-normalizer-DEN9YgA5.mjs → native-type-normalizer-PGvExTgu.mjs} +2 -2
- package/dist/{native-type-normalizer-DEN9YgA5.mjs.map → native-type-normalizer-PGvExTgu.mjs.map} +1 -1
- package/dist/{op-factory-call-DlZ_wHv_-Dh_yijWZ.mjs → op-factory-call-THEIwT0J-DQM3Y94S.mjs} +8 -8
- package/dist/{op-factory-call-DlZ_wHv_-Dh_yijWZ.mjs.map → op-factory-call-THEIwT0J-DQM3Y94S.mjs.map} +1 -1
- package/dist/{planner-BO6cvHnU-DtlizdVY.mjs → planner-BlY3pVTF-B-yPNIGN.mjs} +10 -10
- package/dist/{planner-BO6cvHnU-DtlizdVY.mjs.map → planner-BlY3pVTF-B-yPNIGN.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-B1gra_GO-gl5gnaqr.mjs → planner-ddl-builders-Ds3Xcsg7-5-bR7xgo.mjs} +3 -3
- package/dist/{planner-ddl-builders-B1gra_GO-gl5gnaqr.mjs.map → planner-ddl-builders-Ds3Xcsg7-5-bR7xgo.mjs.map} +1 -1
- package/dist/{planner-identity-values-CAnifzzT-D1ncWy3d.mjs → planner-identity-values-CQZbvcx0-BpAvjtip.mjs} +3 -3
- package/dist/{planner-identity-values-CAnifzzT-D1ncWy3d.mjs.map → planner-identity-values-CQZbvcx0-BpAvjtip.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-BA0ACEpG-Bu613xfQ.mjs → planner-produced-postgres-migration-CorJVpul-dA0T7JYO.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-BA0ACEpG-Bu613xfQ.mjs.map → planner-produced-postgres-migration-CorJVpul-dA0T7JYO.mjs.map} +1 -1
- package/dist/{planner-sql-checks-RKQqd_b5-CesTHuGH.mjs → planner-sql-checks-BOdYkh9L-hXxekxJX.mjs} +5 -5
- package/dist/{planner-sql-checks-RKQqd_b5-CesTHuGH.mjs.map → planner-sql-checks-BOdYkh9L-hXxekxJX.mjs.map} +1 -1
- package/dist/{postgres-codec-traits-DeZiroEE-BACV_wuh.mjs → postgres-codec-traits-D9YEvK6F-BsKaAhCA.mjs} +3 -3
- package/dist/{postgres-codec-traits-DeZiroEE-BACV_wuh.mjs.map → postgres-codec-traits-D9YEvK6F-BsKaAhCA.mjs.map} +1 -1
- package/dist/{postgres-contract-view-yDfay91x-BBinYMBq.mjs → postgres-contract-view-WtPiaMZp-C-CQAB1E.mjs} +9 -9
- package/dist/{postgres-contract-view-yDfay91x-BBinYMBq.mjs.map → postgres-contract-view-WtPiaMZp-C-CQAB1E.mjs.map} +1 -1
- package/dist/{postgres-migration-BPr4WRWw-CN_b66o1.mjs → postgres-migration-BuxK0qNO-BgQHf6H6.mjs} +11 -11
- package/dist/{postgres-migration-BPr4WRWw-CN_b66o1.mjs.map → postgres-migration-BuxK0qNO-BgQHf6H6.mjs.map} +1 -1
- package/dist/{postgres-schema-BBWgs4fX-DWdYxNi8.mjs → postgres-schema-zd_p5Lg2-BdJlG7Cg.mjs} +4 -4
- package/dist/{postgres-schema-BBWgs4fX-DWdYxNi8.mjs.map → postgres-schema-zd_p5Lg2-BdJlG7Cg.mjs.map} +1 -1
- package/dist/{prisma7-binding-BA8iSLxQ.mjs → prisma7-binding-BDJ3kwsK.mjs} +7 -7
- package/dist/{prisma7-binding-BA8iSLxQ.mjs.map → prisma7-binding-BDJ3kwsK.mjs.map} +1 -1
- package/dist/{registry-Ctq7UGkA-_DnAcgYm.mjs → registry-D4AyYsXr-CgiiMuFS.mjs} +3 -3
- package/dist/{registry-Ctq7UGkA-_DnAcgYm.mjs.map → registry-D4AyYsXr-CgiiMuFS.mjs.map} +1 -1
- package/dist/{render-ops-B0ZfUiTN-BdoDg9mi.mjs → render-ops-B5Mh0MpJ-Dc_dH1Sk.mjs} +4 -4
- package/dist/{render-ops-B0ZfUiTN-BdoDg9mi.mjs.map → render-ops-B5Mh0MpJ-Dc_dH1Sk.mjs.map} +1 -1
- package/dist/{resolve-ddl-schema-DwoTc0nu-CvyB2Tfu.mjs → resolve-ddl-schema-ChjIoY0I-D7TWkRXc.mjs} +3 -3
- package/dist/{resolve-ddl-schema-DwoTc0nu-CvyB2Tfu.mjs.map → resolve-ddl-schema-ChjIoY0I-D7TWkRXc.mjs.map} +1 -1
- package/dist/{sql-renderer-D6fBWtjL-D1QcI-Cf.mjs → sql-renderer-D6fBWtjL-BOe5jc4e.mjs} +3 -3
- package/dist/{sql-renderer-D6fBWtjL-D1QcI-Cf.mjs.map → sql-renderer-D6fBWtjL-BOe5jc4e.mjs.map} +1 -1
- package/dist/{sql-utils-VXrIh8dJ-DVxo_Ygp.mjs → sql-utils-CRPhDLp1-wbgQW5TM.mjs} +3 -3
- package/dist/{sql-utils-VXrIh8dJ-DVxo_Ygp.mjs.map → sql-utils-CRPhDLp1-wbgQW5TM.mjs.map} +1 -1
- package/dist/target.d.mts +1 -1
- package/dist/target.mjs +32 -32
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__codecs.mjs +3 -3
- package/dist/target__contract-free.mjs +3 -3
- package/dist/target__control.mjs +16 -16
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__full-text-index-authoring.mjs +2 -2
- package/dist/target__full-text.mjs +2 -2
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +1 -1
- package/dist/target__native-type-normalizer.mjs +1 -1
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-identity-values.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__prisma7-binding.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.mjs +7 -7
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__sql-utils.mjs +3 -3
- package/dist/target__types.mjs +2 -2
- package/package.json +10 -10
- package/dist/errors-DpdPXR_L-DailcY-X.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ddl-qu-IzeH4-CFpSpY0X.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/ddl-qu-IzeH4.mjs"],"sourcesContent":["import { T as PG_TEXT_CODEC_ID, n as PG_BOOL_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { d as PostgresTableSource, i as postgresCreateNamespace } from \"./postgres-schema-BBWgs4fX.mjs\";\nimport { _ as PostgresDropIndex, a as PostgresAlterIndexRename, b as PostgresDropType, c as PostgresAlterTable, d as PostgresCreatePolicy, f as PostgresCreateSchema, g as PostgresDisableRowLevelSecurity, i as DropDefaultAction, l as PostgresAlterTableSetSchema, m as PostgresCreateType, n as AddConstraintAction, o as PostgresAlterPolicyRename, p as PostgresCreateTable, r as AlterColumnTypeAction, s as PostgresAlterSchemaRename, t as AddColumnAction, u as PostgresCreateIndex, v as PostgresDropPolicy, y as PostgresDropSchema } from \"./nodes-G8VTh4PM.mjs\";\nimport { opaqueSql } from \"@internal/sql-relational-core/ast\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { cfExpr, cfTable, exprSelect } from \"@internal/sql-relational-core/contract-free\";\n//#region src/contract-free/checks.ts\n/**\n* `to_regclass($1)` with the qualified table name bound as a text parameter.\n* Thin vocabulary wrapper over the core `cfExpr.fn` helper — the target\n* supplies only the template and the codec'd operand.\n*/\nfunction toRegclass(qualifiedName) {\n\treturn cfExpr.fn({\n\t\tmethod: \"to_regclass\",\n\t\ttemplate: \"to_regclass({{self}})\",\n\t\tself: cfExpr.param(qualifiedName, PG_TEXT_CODEC_ID),\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: true\n\t\t}\n\t});\n}\n/**\n* Typed builder for the migration planner's table-existence checks. Produces\n* FROM-less `SELECT to_regclass($1) IS [NOT] NULL AS \"result\"` ASTs with the\n* qualified table name bound as a text parameter — never inlined into the SQL.\n*\n* `schema` is a namespace coordinate: the framework `__unbound__` sentinel\n* elides the qualifier (search_path decides at runtime); any other id\n* qualifies as `\"schema\".\"table\"`.\n*/\nfunction tableExistsAst(schema, table) {\n\tconst regclass = toRegclass(postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table));\n\treturn {\n\t\ttableAbsent: () => exprSelect().project(\"result\", regclass.isNull()).build(),\n\t\ttablePresent: () => exprSelect().project(\"result\", regclass.isNotNull()).build()\n\t};\n}\n/**\n* Typed builder for the migration planner's constraint-existence checks.\n* Produces `SELECT [NOT ]EXISTS (SELECT 1 FROM pg_constraint c JOIN\n* pg_namespace n ON n.oid = c.connamespace WHERE c.conname = $1 AND\n* n.nspname = $2 [AND c.conrelid = to_regclass($3)]) AS \"result\"` with the\n* constraint name, schema name, and qualified table name bound as text\n* parameters.\n*\n* When `table` is omitted the check matches by name + schema across all\n* tables. Pass `table` to scope the check to a single table (prevents false\n* matches on identically-named constraints in different tables). `schema`\n* is a namespace coordinate: the `__unbound__` sentinel compares `nspname`\n* against `current_schema()` instead of a bound parameter.\n*/\nfunction constraintExistsAst(options) {\n\tconst namespace = postgresCreateNamespace({\n\t\tid: options.schema,\n\t\tentries: { table: {} }\n\t});\n\tconst conditions = [cfExpr.columnRef(\"c\", \"conname\").eqParam(options.constraintName, PG_TEXT_CODEC_ID), cfExpr.columnRef(\"n\", \"nspname\").eqExpr(namespace.schemaFilterExpression())];\n\tif (options.table !== void 0) conditions.push(cfExpr.columnRef(\"c\", \"conrelid\").eqExpr(toRegclass(namespace.qualifyTable(options.table))));\n\tconst inner = () => exprSelect().from(cfTable(\"pg_constraint\", \"c\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"connamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf(conditions));\n\treturn {\n\t\tconstraintPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tconstraintAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\nfunction checkNamespace(schema) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t});\n}\nfunction informationSchemaColumns() {\n\treturn new PostgresTableSource({\n\t\tschema: \"information_schema\",\n\t\tname: \"columns\"\n\t});\n}\nfunction infoSchemaColumnConditions(options) {\n\treturn [\n\t\tcfExpr.identifierRef(\"table_schema\").eqExpr(checkNamespace(options.schema).schemaFilterExpression()),\n\t\tcfExpr.identifierRef(\"table_name\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"column_name\").eqParam(options.column, PG_TEXT_CODEC_ID)\n\t];\n}\nfunction infoSchemaColumnQuery(conditions) {\n\treturn exprSelect().from(informationSchemaColumns()).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf(conditions));\n}\n/**\n* Typed builder for column-existence checks over\n* `information_schema.columns`, with schema, table, and column names bound\n* as text parameters.\n*/\nfunction columnExistsAst(options) {\n\tconst inner = () => infoSchemaColumnQuery(infoSchemaColumnConditions(options));\n\treturn {\n\t\tcolumnPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tcolumnAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed nullability check: EXISTS over `information_schema.columns` with\n* `is_nullable` compared against the bound `'YES'` / `'NO'` marker.\n*/\nfunction columnNullabilityAst(options) {\n\tconst conditions = [...infoSchemaColumnConditions(options), cfExpr.identifierRef(\"is_nullable\").eqParam(options.nullable ? \"YES\" : \"NO\", PG_TEXT_CODEC_ID)];\n\treturn exprSelect().project(\"result\", cfExpr.exists(infoSchemaColumnQuery(conditions))).build();\n}\n/**\n* Typed default-presence checks over `information_schema.columns`.\n* `defaultPresent` / `defaultAbsent` assert the column row exists with a\n* non-null / null `column_default`; `noDefault` is the NOT EXISTS variant\n* (also true when the column row is missing entirely).\n*/\nfunction columnDefaultAst(options) {\n\tconst withDefault = () => infoSchemaColumnQuery([...infoSchemaColumnConditions(options), cfExpr.identifierRef(\"column_default\").isNotNull()]);\n\tconst withoutDefault = () => infoSchemaColumnQuery([...infoSchemaColumnConditions(options), cfExpr.identifierRef(\"column_default\").isNull()]);\n\treturn {\n\t\tdefaultPresent: () => exprSelect().project(\"result\", cfExpr.exists(withDefault())).build(),\n\t\tdefaultAbsent: () => exprSelect().project(\"result\", cfExpr.exists(withoutDefault())).build(),\n\t\tnoDefault: () => exprSelect().project(\"result\", cfExpr.notExists(withDefault())).build()\n\t};\n}\n/**\n* Typed check that a column takes its default from the sequence it owns: the column's default (`pg_attrdef`) depends on the sequence `pg_get_serial_sequence` finds for it. A `nextval(...)` default records that dependency on the sequence it reads, so a default that reads another sequence, an earlier default, or no default does not pass. It compares catalog identities, never the default's text.\n*/\nfunction columnDefaultSequenceAst(options) {\n\tconst regclassOf = (catalog) => cfExpr.raw(`'${catalog}'::regclass`, {\n\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\tnullable: false\n\t});\n\tconst defaultOnOwnedSequence = exprSelect().from(cfTable(\"pg_attrdef\", \"d\")).join(cfTable(\"pg_attribute\", \"a\"), cfExpr.columnRef(\"a\", \"attrelid\").eqExpr(cfExpr.columnRef(\"d\", \"adrelid\")).and(cfExpr.columnRef(\"a\", \"attnum\").eqExpr(cfExpr.columnRef(\"d\", \"adnum\")))).join(cfTable(\"pg_depend\", \"dep\"), cfExpr.columnRef(\"dep\", \"objid\").eqExpr(cfExpr.columnRef(\"d\", \"oid\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"d\", \"adrelid\").eqExpr(toRegclass(checkNamespace(options.schema).qualifyTable(options.table))),\n\t\tcfExpr.columnRef(\"a\", \"attname\").eqParam(options.column, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"dep\", \"classid\").eqExpr(regclassOf(\"pg_attrdef\")),\n\t\tcfExpr.columnRef(\"dep\", \"refclassid\").eqExpr(regclassOf(\"pg_class\")),\n\t\tcfExpr.columnRef(\"dep\", \"refobjid\").eqExpr(ownedSequenceOf(options))\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(defaultOnOwnedSequence)).build();\n}\n/**\n* The sequence the column owns, as a `regclass`, found in the catalog with `pg_get_serial_sequence`; `NULL` when it owns none. A SERIAL column and an identity column both own one, and it keeps its name when the table or column is renamed.\n*/\nfunction ownedSequenceOf(location) {\n\treturn cfExpr.fn({\n\t\tmethod: \"pg_get_serial_sequence\",\n\t\ttemplate: \"pg_get_serial_sequence({{self}}, {{arg0}})::regclass\",\n\t\tself: cfExpr.param(checkNamespace(location.schema).qualifyTable(location.table), PG_TEXT_CODEC_ID),\n\t\targs: [cfExpr.param(location.column, PG_TEXT_CODEC_ID)],\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: true\n\t\t}\n\t});\n}\n/**\n* Typed check that a column's autoincrement default has a sequence to use: the column already owns one, whatever its name, or no relation has the name `sequence`, which the operation creates.\n*/\nfunction sequenceNameAvailableAst(options) {\n\tconst qualifiedSequence = checkNamespace(options.schema).qualifyTable(options.sequence);\n\treturn exprSelect().project(\"result\", ownedSequenceOf(options).isNotNull().or(toRegclass(qualifiedSequence).isNull())).build();\n}\n/**\n* Typed column-type check: EXISTS over `pg_attribute` joined to `pg_class`\n* and `pg_namespace`, comparing `format_type(a.atttypid, a.atttypmod)`\n* against the bound expected display type and excluding dropped columns.\n*/\nfunction columnTypeAst(options) {\n\tconst formatType = cfExpr.fn({\n\t\tmethod: \"format_type\",\n\t\ttemplate: \"format_type({{self}}, {{arg0}})\",\n\t\tself: cfExpr.columnRef(\"a\", \"atttypid\"),\n\t\targs: [cfExpr.columnRef(\"a\", \"atttypmod\")],\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t});\n\tconst inner = exprSelect().from(cfTable(\"pg_attribute\", \"a\")).join(cfTable(\"pg_class\", \"c\"), cfExpr.columnRef(\"c\", \"oid\").eqExpr(cfExpr.columnRef(\"a\", \"attrelid\"))).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"relnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(checkNamespace(options.schema).schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"c\", \"relname\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"a\", \"attname\").eqParam(options.column, PG_TEXT_CODEC_ID),\n\t\tformatType.eqParam(options.expectedType, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"a\", \"attisdropped\").not()\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed primary-key existence check over `pg_index` joined to `pg_class`\n* and `pg_namespace`, with a LEFT JOIN on the index relation so an\n* optional `constraintName` can scope the match to a named constraint.\n*/\nfunction tablePrimaryKeyAst(options) {\n\tconst conditions = [\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(checkNamespace(options.schema).schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"c\", \"relname\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"i\", \"indisprimary\")\n\t];\n\tif (options.constraintName !== void 0) conditions.push(cfExpr.columnRef(\"c2\", \"relname\").eqParam(options.constraintName, PG_TEXT_CODEC_ID));\n\tconst inner = () => exprSelect().from(cfTable(\"pg_index\", \"i\")).join(cfTable(\"pg_class\", \"c\"), cfExpr.columnRef(\"c\", \"oid\").eqExpr(cfExpr.columnRef(\"i\", \"indrelid\"))).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"relnamespace\"))).leftJoin(cfTable(\"pg_class\", \"c2\"), cfExpr.columnRef(\"c2\", \"oid\").eqExpr(cfExpr.columnRef(\"i\", \"indexrelid\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf(conditions));\n\treturn {\n\t\tpkPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tpkAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed emptiness check: NOT EXISTS over the user table itself with\n* `LIMIT 1`. The table is addressed through the namespace's polymorphic\n* `tableSource` (qualified for named schemas, bare for the unbound slot).\n*/\nfunction tableIsEmptyAst(schema, table) {\n\tconst inner = exprSelect().from(checkNamespace(schema).tableSource(table)).project(\"one\", cfExpr.lit(1)).limit(1);\n\treturn exprSelect().project(\"result\", cfExpr.notExists(inner)).build();\n}\n/**\n* Typed no-NULL-values data check used by `SET NOT NULL` prechecks:\n* NOT EXISTS over the user table where the column IS NULL.\n*/\nfunction noNullValuesAst(options) {\n\tconst inner = exprSelect().from(checkNamespace(options.schema).tableSource(options.table)).project(\"one\", cfExpr.lit(1)).where(cfExpr.identifierRef(options.column).isNull());\n\treturn exprSelect().project(\"result\", cfExpr.notExists(inner)).build();\n}\n/**\n* Typed extension existence check over `pg_extension`, with the extension\n* name bound as a text parameter.\n*/\nfunction extensionExistsAst(extensionName) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_extension\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.identifierRef(\"extname\").eqParam(extensionName, PG_TEXT_CODEC_ID));\n\treturn {\n\t\textensionPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\textensionAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed check that an extension is installed in one schema: `pg_extension` joined to `pg_namespace`, with both names bound as text parameters.\n*/\nfunction extensionInSchemaAst(extensionName, schema) {\n\tconst inner = exprSelect().from(cfTable(\"pg_extension\", \"e\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"e\", \"extnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([cfExpr.columnRef(\"e\", \"extname\").eqParam(extensionName, PG_TEXT_CODEC_ID), cfExpr.columnRef(\"n\", \"nspname\").eqParam(schema, PG_TEXT_CODEC_ID)]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed RLS-policy existence check over `pg_policies`, with schema, table,\n* and policy names bound as text parameters (never inlined). The `schema`\n* coordinate is the resolved live-database schema name (e.g. `'public'`),\n* compared against `pg_policies.schemaname` as a bound parameter.\n*/\nfunction rlsPolicyExistsAst(options) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_policies\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.identifierRef(\"schemaname\").eqParam(options.schema, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"tablename\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"policyname\").eqParam(options.policyName, PG_TEXT_CODEC_ID)\n\t]));\n\treturn {\n\t\tpolicyPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tpolicyAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed row-level-security enabled check over `pg_class` joined to\n* `pg_namespace`, comparing `pg_class.relrowsecurity` against the expected\n* boolean. Schema and table names are bound as text parameters.\n*/\nfunction rlsEnabledAst(schema, table) {\n\tconst inner = (enabled) => exprSelect().from(cfTable(\"pg_class\", \"c\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"relnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqParam(schema, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"c\", \"relname\").eqParam(table, PG_TEXT_CODEC_ID),\n\t\tenabled ? cfExpr.columnRef(\"c\", \"relrowsecurity\") : cfExpr.columnRef(\"c\", \"relrowsecurity\").not()\n\t]));\n\treturn {\n\t\trlsEnabled: () => exprSelect().project(\"result\", cfExpr.exists(inner(true))).build(),\n\t\trlsDisabled: () => exprSelect().project(\"result\", cfExpr.exists(inner(false))).build()\n\t};\n}\n/**\n* Typed index existence check riding the same `to_regclass` vocabulary as\n* `tableExistsAst`, with the qualified index name bound as a text parameter.\n*/\nfunction indexExistsAst(schema, indexName) {\n\tconst regclass = toRegclass(checkNamespace(schema).qualifyTable(indexName));\n\treturn {\n\t\tindexPresent: () => exprSelect().project(\"result\", regclass.isNotNull()).build(),\n\t\tindexAbsent: () => exprSelect().project(\"result\", regclass.isNull()).build()\n\t};\n}\n/**\n* Typed native-enum type existence check over `pg_type` joined to\n* `pg_namespace`, restricted to enum types (`typtype = 'e'`). Schema and\n* type name are bound as text parameters; `schema` is a namespace\n* coordinate (the `__unbound__` sentinel compares against\n* `current_schema()`), matching {@link tableExistsAst} et al.\n*/\nfunction nativeEnumTypeExistsAst(schema, typeName) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_type\", \"t\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"t\", \"typnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(checkNamespace(schema).schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"t\", \"typname\").eqParam(typeName, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"t\", \"typtype\").eqParam(\"e\", PG_TEXT_CODEC_ID)\n\t]));\n\treturn {\n\t\ttypePresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\ttypeAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed native-enum member-value existence check over `pg_enum` joined to\n* `pg_type` and `pg_namespace`. Schema, type name, and the candidate member\n* value are bound as text parameters — used by `addNativeEnumValue`'s\n* precheck (value absent) and postcheck (value present).\n*/\nfunction nativeEnumValueExistsAst(options) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_enum\", \"e\")).join(cfTable(\"pg_type\", \"t\"), cfExpr.columnRef(\"t\", \"oid\").eqExpr(cfExpr.columnRef(\"e\", \"enumtypid\"))).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"t\", \"typnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(checkNamespace(options.schema).schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"t\", \"typname\").eqParam(options.typeName, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"e\", \"enumlabel\").eqParam(options.value, PG_TEXT_CODEC_ID)\n\t]));\n\treturn {\n\t\tvaluePresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tvalueAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Whether the attribute numbers in `keys` (an `int2[]` or `int2vector` such as `pg_constraint.conkey` or `pg_index.indkey`) name, in order, exactly the columns `names` of the relation `relation`. Key `0`, an expression slot of an index, names no column.\n*/\nfunction keyColumnsAre(keys, relation, names) {\n\treturn cfExpr.fn({\n\t\tmethod: \"key_columns_are\",\n\t\ttemplate: \"(SELECT coalesce(jsonb_agg(key_attribute.attname ORDER BY key_column.position), '[]'::jsonb) FROM unnest({{self}}::int2[]) WITH ORDINALITY AS key_column(attnum, position) JOIN pg_attribute key_attribute ON key_attribute.attrelid = {{arg0}} AND key_attribute.attnum = key_column.attnum) = ({{arg1}})::jsonb\",\n\t\tself: keys,\n\t\targs: [relation, cfExpr.param(JSON.stringify(names), PG_TEXT_CODEC_ID)],\n\t\treturns: {\n\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t});\n}\n/**\n* Typed check that the relation `name` exists and its `pg_class.relkind` is one of `kinds`, so a view, sequence or index of the same name does not pass as a table.\n*/\nfunction relationKindAst(options) {\n\tconst relation = toRegclass(checkNamespace(options.schema).qualifyTable(options.name));\n\tconst inner = exprSelect().from(cfTable(\"pg_class\", \"c\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([cfExpr.columnRef(\"c\", \"oid\").eqExpr(relation), options.kinds.map((kind) => cfExpr.columnRef(\"c\", \"relkind\").eqParam(kind, PG_TEXT_CODEC_ID)).reduce((either, kind) => either.or(kind))]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that the constraint `constraintName` on `table` is of kind `contype` (`p`, `u`, `f` or `c`), on the columns `columns` in order when given, and for a foreign key, references `foreignKey`'s table and columns in order with its delete and update actions. It reads only catalog values, never the text Postgres prints for a constraint.\n*/\nfunction constraintDefinitionAst(options) {\n\tconst namespace = checkNamespace(options.schema);\n\tconst conditions = [\n\t\tcfExpr.columnRef(\"c\", \"conname\").eqParam(options.constraintName, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(namespace.schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"c\", \"conrelid\").eqExpr(toRegclass(namespace.qualifyTable(options.table))),\n\t\tcfExpr.columnRef(\"c\", \"contype\").eqParam(options.contype, PG_TEXT_CODEC_ID)\n\t];\n\tif (options.columns !== void 0) conditions.push(keyColumnsAre(cfExpr.columnRef(\"c\", \"conkey\"), cfExpr.columnRef(\"c\", \"conrelid\"), options.columns));\n\tconst foreignKey = options.foreignKey;\n\tif (foreignKey !== void 0) conditions.push(cfExpr.columnRef(\"c\", \"confrelid\").eqExpr(toRegclass(checkNamespace(foreignKey.referencedSchema).qualifyTable(foreignKey.referencedTable))), keyColumnsAre(cfExpr.columnRef(\"c\", \"confkey\"), cfExpr.columnRef(\"c\", \"confrelid\"), foreignKey.referencedColumns), cfExpr.columnRef(\"c\", \"confdeltype\").eqParam(foreignKey.onDelete, PG_TEXT_CODEC_ID), cfExpr.columnRef(\"c\", \"confupdtype\").eqParam(foreignKey.onUpdate, PG_TEXT_CODEC_ID));\n\tconst inner = exprSelect().from(cfTable(\"pg_constraint\", \"c\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"connamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf(conditions));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that `index` is an index on `table` with the given uniqueness and access method, on the columns `columns` in order, and with or without a predicate. For an index written as an element list (`expression`) it checks no elements: the list can be a real expression, which Postgres stores in `indexprs`, or plain columns with a sort order, operator class or collation, which it stores as columns, and comparing its text would need the form Postgres prints.\n*/\nfunction indexDefinitionAst(options) {\n\tconst namespace = checkNamespace(options.schema);\n\tconst indexColumn = (name) => cfExpr.columnRef(\"i\", name);\n\tconst inner = exprSelect().from(cfTable(\"pg_class\", \"c\")).join(cfTable(\"pg_index\", \"i\"), cfExpr.columnRef(\"i\", \"indexrelid\").eqExpr(cfExpr.columnRef(\"c\", \"oid\"))).join(cfTable(\"pg_am\", \"m\"), cfExpr.columnRef(\"m\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"relam\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"c\", \"oid\").eqExpr(toRegclass(namespace.qualifyTable(options.index))),\n\t\tcfExpr.columnRef(\"c\", \"relkind\").eqParam(\"i\", PG_TEXT_CODEC_ID).or(cfExpr.columnRef(\"c\", \"relkind\").eqParam(\"I\", PG_TEXT_CODEC_ID)),\n\t\tindexColumn(\"indrelid\").eqExpr(toRegclass(namespace.qualifyTable(options.table))),\n\t\toptions.unique ? indexColumn(\"indisunique\") : indexColumn(\"indisunique\").not(),\n\t\tcfExpr.columnRef(\"m\", \"amname\").eqParam(options.method, PG_TEXT_CODEC_ID),\n\t\t...\"columns\" in options.elements ? [indexColumn(\"indexprs\").isNull().and(keyColumnsAre(indexColumn(\"indkey\"), indexColumn(\"indrelid\"), options.elements.columns))] : [],\n\t\toptions.hasPredicate ? indexColumn(\"indpred\").isNotNull() : indexColumn(\"indpred\").isNull()\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that the RLS policy `policyName` on `table` exists with the command `command` (as `pg_policies.cmd` prints it, such as `ALL` or `SELECT`), the permissive flag, and exactly the roles `roles`, in any order. A role written as `current_user`, `current_role` or `session_user` stands for the role it names in the session that runs the check, as `CREATE POLICY` resolves it. It never compares the policy's expressions.\n*/\nfunction rlsPolicyDefinitionAst(options) {\n\tconst rolesAre = cfExpr.fn({\n\t\tmethod: \"roles_are\",\n\t\ttemplate: `(SELECT coalesce(jsonb_agg(role_name ORDER BY role_name), '[]'::jsonb) FROM (SELECT DISTINCT policy_role::text COLLATE \"C\" AS role_name FROM unnest({{self}}) AS policy_role) AS actual_roles) = (SELECT coalesce(jsonb_agg(role_name ORDER BY role_name), '[]'::jsonb) FROM (SELECT DISTINCT (CASE expected_role WHEN 'current_user' THEN current_user::text WHEN 'current_role' THEN current_role::text WHEN 'session_user' THEN session_user::text ELSE expected_role END) COLLATE \"C\" AS role_name FROM jsonb_array_elements_text(({{arg0}})::jsonb) AS expected_role) AS expected_roles)`,\n\t\tself: cfExpr.identifierRef(\"roles\"),\n\t\targs: [cfExpr.param(JSON.stringify(options.roles), PG_TEXT_CODEC_ID)],\n\t\treturns: {\n\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t});\n\tconst inner = exprSelect().from(cfTable(\"pg_policies\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.identifierRef(\"schemaname\").eqParam(options.schema, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"tablename\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"policyname\").eqParam(options.policyName, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"cmd\").eqParam(options.command, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"permissive\").eqParam(options.permissive ? \"PERMISSIVE\" : \"RESTRICTIVE\", PG_TEXT_CODEC_ID),\n\t\trolesAre\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that the column owns a sequence, whatever its name, of the type `sequenceType` (`smallint`, `integer` or `bigint`). With `orNone`, a column that owns no sequence passes too.\n*/\nfunction columnOwnsSequenceAst(options) {\n\tconst ownedSequence = ownedSequenceOf(options);\n\tconst sequenceType = cfExpr.fn({\n\t\tmethod: \"to_regtype\",\n\t\ttemplate: \"to_regtype({{self}})\",\n\t\tself: cfExpr.param(options.sequenceType, PG_TEXT_CODEC_ID),\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: true\n\t\t}\n\t});\n\tconst sequenceOfType = exprSelect().from(cfTable(\"pg_sequence\", \"s\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([cfExpr.columnRef(\"s\", \"seqrelid\").eqExpr(ownedSequence), cfExpr.columnRef(\"s\", \"seqtypid\").eqExpr(sequenceType)]));\n\treturn exprSelect().project(\"result\", options.orNone ? ownedSequence.isNull().or(cfExpr.exists(sequenceOfType)) : ownedSequence.isNotNull().and(cfExpr.exists(sequenceOfType))).build();\n}\n/**\n* Typed column-type check by the type's identity: compares the column's `pg_attribute.atttypid` with `to_regtype(type)`, or with that type's array type for a list. It checks a type that claims a kind, such as an enum, whatever schema it is in, and a type the stack's data types do not read. `to_regtype` drops a type modifier, so `varchar(20)` matches any `varchar`.\n*/\nfunction columnTypeOidAst(options) {\n\tconst namespace = checkNamespace(options.schema);\n\tconst expectedType = cfExpr.fn({\n\t\tmethod: \"to_regtype\",\n\t\ttemplate: options.many ? \"(SELECT \\\"t\\\".\\\"typarray\\\" FROM \\\"pg_catalog\\\".\\\"pg_type\\\" AS \\\"t\\\" WHERE \\\"t\\\".\\\"oid\\\" = to_regtype({{self}}))\" : \"to_regtype({{self}})\",\n\t\tself: cfExpr.param(options.type, PG_TEXT_CODEC_ID),\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: true\n\t\t}\n\t});\n\tconst inner = exprSelect().from(cfTable(\"pg_attribute\", \"a\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"a\", \"attrelid\").eqExpr(toRegclass(namespace.qualifyTable(options.table))),\n\t\tcfExpr.columnRef(\"a\", \"attname\").eqParam(options.column, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"a\", \"atttypid\").eqExpr(expectedType),\n\t\tcfExpr.columnRef(\"a\", \"attisdropped\").not()\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that the sequence the column owns has handed out no value above `maxValue`, so narrowing it to a smaller integer type keeps every value it already gave. The sequence's position is read only when its current maximum is above `maxValue`, that is when the change narrows it, so widening needs no rights on the sequence. A sequence that has never been read, and a column that owns none, pass.\n*/\nfunction sequenceValuesFitAst(options) {\n\tconst pastMax = cfExpr.fn({\n\t\tmethod: \"sequence_past_max\",\n\t\ttemplate: \"CASE WHEN {{self}} <= ({{arg0}})::bigint THEN false ELSE coalesce(pg_sequence_last_value(\\\"s\\\".\\\"seqrelid\\\"), 0) > ({{arg0}})::bigint END\",\n\t\tself: cfExpr.columnRef(\"s\", \"seqmax\"),\n\t\targs: [cfExpr.param(options.maxValue, PG_TEXT_CODEC_ID)],\n\t\treturns: {\n\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t});\n\tconst narrowedPastMax = exprSelect().from(cfTable(\"pg_sequence\", \"s\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.columnRef(\"s\", \"seqrelid\").eqExpr(ownedSequenceOf(options)).and(pastMax));\n\treturn exprSelect().project(\"result\", cfExpr.notExists(narrowedPastMax)).build();\n}\n/** Typed schema existence check over `pg_namespace`, with the schema name bound as a text parameter. */\nfunction schemaExistsAst(schema) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_namespace\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.identifierRef(\"nspname\").eqParam(schema, PG_TEXT_CODEC_ID));\n\treturn {\n\t\tschemaPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tschemaAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\nfunction objectsInSchema(catalog, namespaceColumn, schema, only = []) {\n\treturn exprSelect().from(cfTable(catalog, \"o\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"o\", namespaceColumn))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([cfExpr.columnRef(\"n\", \"nspname\").eqParam(schema, PG_TEXT_CODEC_ID), ...only]));\n}\n/**\n* Whether a schema holds no relations (tables, views, sequences, indexes), no types of its own and\n* no functions, so `DROP SCHEMA` without `CASCADE` succeeds. A table's row type and an array type\n* belong to another object and are not counted.\n*/\nfunction schemaHoldsNoObjectsAst(schema) {\n\treturn exprSelect().project(\"result\", cfExpr.allOf([\n\t\tcfExpr.notExists(objectsInSchema(\"pg_class\", \"relnamespace\", schema)),\n\t\tcfExpr.notExists(objectsInSchema(\"pg_type\", \"typnamespace\", schema, [cfExpr.columnRef(\"o\", \"typrelid\").eqLit(0), cfExpr.columnRef(\"o\", \"typelem\").eqLit(0)])),\n\t\tcfExpr.notExists(objectsInSchema(\"pg_proc\", \"pronamespace\", schema))\n\t])).build();\n}\n/**\n* After a table of the unbound namespace moves to `toSchema`: the search path finds no table of that\n* name, or finds only the moved one, which it does when `toSchema` is on the search path.\n*/\nfunction unboundTableMovedAst(table, toSchema) {\n\tconst found = toRegclass(checkNamespace(UNBOUND_NAMESPACE_ID).qualifyTable(table));\n\tconst moved = toRegclass(checkNamespace(toSchema).qualifyTable(table));\n\treturn exprSelect().project(\"result\", found.isNull().or(found.eqExpr(moved))).build();\n}\n//#endregion\n//#region src/contract-free/ddl.ts\n/**\n* Build a Postgres `CREATE TABLE` query node.\n*\n* Pass `constraints` for table-level composite primary keys, foreign keys, and\n* unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},\n* and {@link UniqueConstraint} classes from `@internal/sql-relational-core/ast`.\n*\n* Precondition: identifiers (`table`, `schema`, column names/types) are\n* emitted to SQL verbatim — they are not quoted or escaped, so callers must\n* pass pre-trusted values (e.g. fixed control-plane identifiers). String-literal\n* default values, by contrast, are single-quote-escaped (embedded `'` doubled)\n* by the renderer. Identifier quoting for untrusted identifiers is added when\n* the migration planner adopts this lowering path.\n*/\nfunction createTable(options) {\n\treturn new PostgresCreateTable(options);\n}\n/**\n* Build a Postgres `CREATE SCHEMA` query node. See {@link createTable} for the\n* pre-trusted-identifier precondition.\n*/\nfunction createSchema(options) {\n\treturn new PostgresCreateSchema(options);\n}\n/**\n* Build a Postgres `CREATE TYPE … AS ENUM (…)` DDL node. The type name (and\n* optional schema) are quoted by the renderer; the enum member `values` are\n* emitted as single-quote-escaped string literals. An absent `schema` renders\n* the type name unqualified so the connection's `search_path` resolves it.\n*/\nfunction createType(options) {\n\treturn new PostgresCreateType(options);\n}\n/**\n* Build a Postgres `DROP TYPE` DDL node. See {@link createType} for the\n* identifier-quoting and unqualified-when-schemaless behaviour.\n*/\nfunction dropType(options) {\n\treturn new PostgresDropType(options);\n}\n/**\n* Build an `ADD COLUMN` action for use inside {@link alterTable}.\n* The column is a structured `DdlColumn` so codec-encoded defaults flow\n* through the adapter's `pgRenderDdlColumn` → `pgRenderDdlColumnDefault` path.\n*/\nfunction addColumnAction(column) {\n\treturn new AddColumnAction(column);\n}\n/**\n* Build a `DROP DEFAULT` action (`ALTER COLUMN \"<name>\" DROP DEFAULT`) for\n* use inside {@link alterTable}. The renderer quotes the column name.\n*/\nfunction dropDefaultAction(columnName) {\n\treturn new DropDefaultAction(columnName);\n}\n/**\n* Build an `ADD CONSTRAINT` action for use inside {@link alterTable}. The renderer writes the constraint as `CREATE TABLE` writes it.\n*/\nfunction addConstraintAction(constraint) {\n\treturn new AddConstraintAction(constraint);\n}\n/**\n* Build an `ALTER COLUMN \"<columnName>\" TYPE <type> USING …` action for use inside {@link alterTable}. `type` is written verbatim; `using` is opaque SQL, and when it is absent or empty the conversion is `\"<columnName>\"::<type>`.\n*/\nfunction alterColumnTypeAction(options) {\n\treturn new AlterColumnTypeAction({\n\t\tcolumnName: options.columnName,\n\t\ttype: options.type,\n\t\tusing: options.using ? opaqueSql(options.using) : void 0\n\t});\n}\n/**\n* Build a Postgres `ALTER TABLE` query node carrying one or more actions.\n* See {@link addColumnAction}, {@link dropDefaultAction}, {@link addConstraintAction} and {@link alterColumnTypeAction} for building actions.\n*/\nfunction alterTable(options) {\n\treturn new PostgresAlterTable(options);\n}\n/**\n* Build a Postgres `CREATE POLICY` DDL node.\n*\n* Identifiers (`schema`, `table`, `name`) are quoted by the renderer.\n* `using` and `withCheck` are emitted verbatim as predicate SQL — callers\n* must supply safe, pre-validated SQL expressions.\n*/\nfunction createPolicy(options) {\n\tconst { using, withCheck, ...rest } = options;\n\treturn new PostgresCreatePolicy({\n\t\t...rest,\n\t\t...ifDefined(\"using\", using === void 0 ? void 0 : opaqueSql(using)),\n\t\t...ifDefined(\"withCheck\", withCheck === void 0 ? void 0 : opaqueSql(withCheck))\n\t});\n}\n/**\n* Build a Postgres `DROP POLICY` DDL node.\n* Identifiers (`schema`, `table`, `name`) are quoted by the renderer.\n*/\nfunction dropPolicy(options) {\n\treturn new PostgresDropPolicy(options);\n}\n/**\n* Build a Postgres `ALTER POLICY … RENAME TO` DDL node.\n* Identifiers (`schema`, `table`, `name`, `newName`) are quoted by the renderer.\n*/\nfunction alterPolicyRename(options) {\n\treturn new PostgresAlterPolicyRename(options);\n}\n/**\n* Build a Postgres `CREATE [UNIQUE] INDEX` DDL node. Identifiers (`schema`,\n* `table`, `name`, column elements, `type`, option keys) are quoted by the\n* renderer; the `expression` element list and the `where` predicate are\n* inserted verbatim (opaque SQL). An absent `schema` renders the object\n* names unqualified (the unbound namespace).\n*/\nfunction createIndex(options) {\n\tconst { elements, where, ...rest } = options;\n\treturn new PostgresCreateIndex({\n\t\t...rest,\n\t\telements: \"columns\" in elements ? { columns: elements.columns } : { expression: opaqueSql(elements.expression) },\n\t\twhere: where === void 0 ? void 0 : opaqueSql(where)\n\t});\n}\n/**\n* Build a Postgres `DROP INDEX` DDL node. The index name (and optional\n* schema) are quoted by the renderer.\n*/\nfunction dropIndex(options) {\n\treturn new PostgresDropIndex(options);\n}\n/**\n* Build a Postgres `ALTER INDEX … RENAME TO` DDL node. Identifiers are\n* quoted by the renderer.\n*/\nfunction alterIndexRename(options) {\n\treturn new PostgresAlterIndexRename(options);\n}\n/**\n* Build a Postgres `ALTER TABLE … DISABLE ROW LEVEL SECURITY` DDL node.\n* Identifiers (`schema`, `table`) are quoted by the renderer.\n*/\nfunction disableRowLevelSecurity(options) {\n\treturn new PostgresDisableRowLevelSecurity(options);\n}\n/**\n* Build a Postgres `ALTER TABLE … SET SCHEMA` DDL node. Identifiers are quoted by the renderer; an\n* absent `schema` leaves the table unqualified (the unbound namespace).\n*/\nfunction alterTableSetSchema(options) {\n\treturn new PostgresAlterTableSetSchema(options);\n}\n/** Build a Postgres `ALTER SCHEMA … RENAME TO` DDL node. Identifiers are quoted by the renderer. */\nfunction alterSchemaRename(options) {\n\treturn new PostgresAlterSchemaRename(options);\n}\n/** Build a Postgres `DROP SCHEMA` DDL node, without `CASCADE`. The name is quoted by the renderer. */\nfunction dropSchema(options) {\n\treturn new PostgresDropSchema(options);\n}\n//#endregion\nexport { extensionInSchemaAst as A, schemaExistsAst as B, columnNullabilityAst as C, constraintDefinitionAst as D, columnTypeOidAst as E, noNullValuesAst as F, tableIsEmptyAst as G, sequenceNameAvailableAst as H, relationKindAst as I, unboundTableMovedAst as J, tablePrimaryKeyAst as K, rlsEnabledAst as L, indexExistsAst as M, nativeEnumTypeExistsAst as N, constraintExistsAst as O, nativeEnumValueExistsAst as P, rlsPolicyDefinitionAst as R, columnExistsAst as S, columnTypeAst as T, sequenceValuesFitAst as U, schemaHoldsNoObjectsAst as V, tableExistsAst as W, dropPolicy as _, alterPolicyRename as a, columnDefaultAst as b, alterTableSetSchema as c, createSchema as d, createTable as f, dropIndex as g, dropDefaultAction as h, alterIndexRename as i, indexDefinitionAst as j, extensionExistsAst as k, createIndex as l, disableRowLevelSecurity as m, addConstraintAction as n, alterSchemaRename as o, createType as p, toRegclass as q, alterColumnTypeAction as r, alterTable as s, addColumnAction as t, createPolicy as u, dropSchema as v, columnOwnsSequenceAst as w, columnDefaultSequenceAst as x, dropType as y, rlsPolicyExistsAst as z };\n\n//# sourceMappingURL=ddl-qu-IzeH4.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,WAAW,eAAe;CAClC,OAAO,OAAO,GAAG;EAChB,QAAQ;EACR,UAAU;EACV,MAAM,OAAO,MAAM,eAAe,gBAAgB;EAClD,SAAS;GACR,SAAS;GACT,UAAU;EACX;CACD,CAAC;AACF;;;;;;;;;;AAUA,SAAS,eAAe,QAAQ,OAAO;CACtC,MAAM,WAAW,WAAW,wBAAwB;EACnD,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC;CACtB,OAAO;EACN,mBAAmB,WAAW,CAAC,CAAC,QAAQ,UAAU,SAAS,OAAO,CAAC,CAAC,CAAC,MAAM;EAC3E,oBAAoB,WAAW,CAAC,CAAC,QAAQ,UAAU,SAAS,UAAU,CAAC,CAAC,CAAC,MAAM;CAChF;AACD;;;;;;;;;;;;;;;AAeA,SAAS,oBAAoB,SAAS;CACrC,MAAM,YAAY,wBAAwB;EACzC,IAAI,QAAQ;EACZ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC;CACD,MAAM,aAAa,CAAC,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,QAAQ,QAAQ,gBAAgB,gBAAgB,GAAG,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,OAAO,UAAU,uBAAuB,CAAC,CAAC;CACnL,IAAI,QAAQ,UAAU,KAAK,GAAG,WAAW,KA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EXT_CODEC_ID, n as PG_BOOL_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { d as PostgresTableSource, i as postgresCreateNamespace } from \"./postgres-schema-zd_p5Lg2.mjs\";\nimport { _ as PostgresDropIndex, a as PostgresAlterIndexRename, b as PostgresDropType, c as PostgresAlterTable, d as PostgresCreatePolicy, f as PostgresCreateSchema, g as PostgresDisableRowLevelSecurity, i as DropDefaultAction, l as PostgresAlterTableSetSchema, m as PostgresCreateType, n as AddConstraintAction, o as PostgresAlterPolicyRename, p as PostgresCreateTable, r as AlterColumnTypeAction, s as PostgresAlterSchemaRename, t as AddColumnAction, u as PostgresCreateIndex, v as PostgresDropPolicy, y as PostgresDropSchema } from \"./nodes-G8VTh4PM.mjs\";\nimport { opaqueSql } from \"@internal/sql-relational-core/ast\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { cfExpr, cfTable, exprSelect } from \"@internal/sql-relational-core/contract-free\";\n//#region src/contract-free/checks.ts\n/**\n* `to_regclass($1)` with the qualified table name bound as a text parameter.\n* Thin vocabulary wrapper over the core `cfExpr.fn` helper — the target\n* supplies only the template and the codec'd operand.\n*/\nfunction toRegclass(qualifiedName) {\n\treturn cfExpr.fn({\n\t\tmethod: \"to_regclass\",\n\t\ttemplate: \"to_regclass({{self}})\",\n\t\tself: cfExpr.param(qualifiedName, PG_TEXT_CODEC_ID),\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: true\n\t\t}\n\t});\n}\n/**\n* Typed builder for the migration planner's table-existence checks. Produces\n* FROM-less `SELECT to_regclass($1) IS [NOT] NULL AS \"result\"` ASTs with the\n* qualified table name bound as a text parameter — never inlined into the SQL.\n*\n* `schema` is a namespace coordinate: the framework `__unbound__` sentinel\n* elides the qualifier (search_path decides at runtime); any other id\n* qualifies as `\"schema\".\"table\"`.\n*/\nfunction tableExistsAst(schema, table) {\n\tconst regclass = toRegclass(postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table));\n\treturn {\n\t\ttableAbsent: () => exprSelect().project(\"result\", regclass.isNull()).build(),\n\t\ttablePresent: () => exprSelect().project(\"result\", regclass.isNotNull()).build()\n\t};\n}\n/**\n* Typed builder for the migration planner's constraint-existence checks.\n* Produces `SELECT [NOT ]EXISTS (SELECT 1 FROM pg_constraint c JOIN\n* pg_namespace n ON n.oid = c.connamespace WHERE c.conname = $1 AND\n* n.nspname = $2 [AND c.conrelid = to_regclass($3)]) AS \"result\"` with the\n* constraint name, schema name, and qualified table name bound as text\n* parameters.\n*\n* When `table` is omitted the check matches by name + schema across all\n* tables. Pass `table` to scope the check to a single table (prevents false\n* matches on identically-named constraints in different tables). `schema`\n* is a namespace coordinate: the `__unbound__` sentinel compares `nspname`\n* against `current_schema()` instead of a bound parameter.\n*/\nfunction constraintExistsAst(options) {\n\tconst namespace = postgresCreateNamespace({\n\t\tid: options.schema,\n\t\tentries: { table: {} }\n\t});\n\tconst conditions = [cfExpr.columnRef(\"c\", \"conname\").eqParam(options.constraintName, PG_TEXT_CODEC_ID), cfExpr.columnRef(\"n\", \"nspname\").eqExpr(namespace.schemaFilterExpression())];\n\tif (options.table !== void 0) conditions.push(cfExpr.columnRef(\"c\", \"conrelid\").eqExpr(toRegclass(namespace.qualifyTable(options.table))));\n\tconst inner = () => exprSelect().from(cfTable(\"pg_constraint\", \"c\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"connamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf(conditions));\n\treturn {\n\t\tconstraintPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tconstraintAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\nfunction checkNamespace(schema) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t});\n}\nfunction informationSchemaColumns() {\n\treturn new PostgresTableSource({\n\t\tschema: \"information_schema\",\n\t\tname: \"columns\"\n\t});\n}\nfunction infoSchemaColumnConditions(options) {\n\treturn [\n\t\tcfExpr.identifierRef(\"table_schema\").eqExpr(checkNamespace(options.schema).schemaFilterExpression()),\n\t\tcfExpr.identifierRef(\"table_name\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"column_name\").eqParam(options.column, PG_TEXT_CODEC_ID)\n\t];\n}\nfunction infoSchemaColumnQuery(conditions) {\n\treturn exprSelect().from(informationSchemaColumns()).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf(conditions));\n}\n/**\n* Typed builder for column-existence checks over\n* `information_schema.columns`, with schema, table, and column names bound\n* as text parameters.\n*/\nfunction columnExistsAst(options) {\n\tconst inner = () => infoSchemaColumnQuery(infoSchemaColumnConditions(options));\n\treturn {\n\t\tcolumnPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tcolumnAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed nullability check: EXISTS over `information_schema.columns` with\n* `is_nullable` compared against the bound `'YES'` / `'NO'` marker.\n*/\nfunction columnNullabilityAst(options) {\n\tconst conditions = [...infoSchemaColumnConditions(options), cfExpr.identifierRef(\"is_nullable\").eqParam(options.nullable ? \"YES\" : \"NO\", PG_TEXT_CODEC_ID)];\n\treturn exprSelect().project(\"result\", cfExpr.exists(infoSchemaColumnQuery(conditions))).build();\n}\n/**\n* Typed default-presence checks over `information_schema.columns`.\n* `defaultPresent` / `defaultAbsent` assert the column row exists with a\n* non-null / null `column_default`; `noDefault` is the NOT EXISTS variant\n* (also true when the column row is missing entirely).\n*/\nfunction columnDefaultAst(options) {\n\tconst withDefault = () => infoSchemaColumnQuery([...infoSchemaColumnConditions(options), cfExpr.identifierRef(\"column_default\").isNotNull()]);\n\tconst withoutDefault = () => infoSchemaColumnQuery([...infoSchemaColumnConditions(options), cfExpr.identifierRef(\"column_default\").isNull()]);\n\treturn {\n\t\tdefaultPresent: () => exprSelect().project(\"result\", cfExpr.exists(withDefault())).build(),\n\t\tdefaultAbsent: () => exprSelect().project(\"result\", cfExpr.exists(withoutDefault())).build(),\n\t\tnoDefault: () => exprSelect().project(\"result\", cfExpr.notExists(withDefault())).build()\n\t};\n}\n/**\n* Typed check that a column takes its default from the sequence it owns: the column's default (`pg_attrdef`) depends on the sequence `pg_get_serial_sequence` finds for it. A `nextval(...)` default records that dependency on the sequence it reads, so a default that reads another sequence, an earlier default, or no default does not pass. It compares catalog identities, never the default's text.\n*/\nfunction columnDefaultSequenceAst(options) {\n\tconst regclassOf = (catalog) => cfExpr.raw(`'${catalog}'::regclass`, {\n\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\tnullable: false\n\t});\n\tconst defaultOnOwnedSequence = exprSelect().from(cfTable(\"pg_attrdef\", \"d\")).join(cfTable(\"pg_attribute\", \"a\"), cfExpr.columnRef(\"a\", \"attrelid\").eqExpr(cfExpr.columnRef(\"d\", \"adrelid\")).and(cfExpr.columnRef(\"a\", \"attnum\").eqExpr(cfExpr.columnRef(\"d\", \"adnum\")))).join(cfTable(\"pg_depend\", \"dep\"), cfExpr.columnRef(\"dep\", \"objid\").eqExpr(cfExpr.columnRef(\"d\", \"oid\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"d\", \"adrelid\").eqExpr(toRegclass(checkNamespace(options.schema).qualifyTable(options.table))),\n\t\tcfExpr.columnRef(\"a\", \"attname\").eqParam(options.column, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"dep\", \"classid\").eqExpr(regclassOf(\"pg_attrdef\")),\n\t\tcfExpr.columnRef(\"dep\", \"refclassid\").eqExpr(regclassOf(\"pg_class\")),\n\t\tcfExpr.columnRef(\"dep\", \"refobjid\").eqExpr(ownedSequenceOf(options))\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(defaultOnOwnedSequence)).build();\n}\n/**\n* The sequence the column owns, as a `regclass`, found in the catalog with `pg_get_serial_sequence`; `NULL` when it owns none. A SERIAL column and an identity column both own one, and it keeps its name when the table or column is renamed.\n*/\nfunction ownedSequenceOf(location) {\n\treturn cfExpr.fn({\n\t\tmethod: \"pg_get_serial_sequence\",\n\t\ttemplate: \"pg_get_serial_sequence({{self}}, {{arg0}})::regclass\",\n\t\tself: cfExpr.param(checkNamespace(location.schema).qualifyTable(location.table), PG_TEXT_CODEC_ID),\n\t\targs: [cfExpr.param(location.column, PG_TEXT_CODEC_ID)],\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: true\n\t\t}\n\t});\n}\n/**\n* Typed check that a column's autoincrement default has a sequence to use: the column already owns one, whatever its name, or no relation has the name `sequence`, which the operation creates.\n*/\nfunction sequenceNameAvailableAst(options) {\n\tconst qualifiedSequence = checkNamespace(options.schema).qualifyTable(options.sequence);\n\treturn exprSelect().project(\"result\", ownedSequenceOf(options).isNotNull().or(toRegclass(qualifiedSequence).isNull())).build();\n}\n/**\n* Typed column-type check: EXISTS over `pg_attribute` joined to `pg_class`\n* and `pg_namespace`, comparing `format_type(a.atttypid, a.atttypmod)`\n* against the bound expected display type and excluding dropped columns.\n*/\nfunction columnTypeAst(options) {\n\tconst formatType = cfExpr.fn({\n\t\tmethod: \"format_type\",\n\t\ttemplate: \"format_type({{self}}, {{arg0}})\",\n\t\tself: cfExpr.columnRef(\"a\", \"atttypid\"),\n\t\targs: [cfExpr.columnRef(\"a\", \"atttypmod\")],\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t});\n\tconst inner = exprSelect().from(cfTable(\"pg_attribute\", \"a\")).join(cfTable(\"pg_class\", \"c\"), cfExpr.columnRef(\"c\", \"oid\").eqExpr(cfExpr.columnRef(\"a\", \"attrelid\"))).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"relnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(checkNamespace(options.schema).schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"c\", \"relname\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"a\", \"attname\").eqParam(options.column, PG_TEXT_CODEC_ID),\n\t\tformatType.eqParam(options.expectedType, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"a\", \"attisdropped\").not()\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed primary-key existence check over `pg_index` joined to `pg_class`\n* and `pg_namespace`, with a LEFT JOIN on the index relation so an\n* optional `constraintName` can scope the match to a named constraint.\n*/\nfunction tablePrimaryKeyAst(options) {\n\tconst conditions = [\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(checkNamespace(options.schema).schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"c\", \"relname\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"i\", \"indisprimary\")\n\t];\n\tif (options.constraintName !== void 0) conditions.push(cfExpr.columnRef(\"c2\", \"relname\").eqParam(options.constraintName, PG_TEXT_CODEC_ID));\n\tconst inner = () => exprSelect().from(cfTable(\"pg_index\", \"i\")).join(cfTable(\"pg_class\", \"c\"), cfExpr.columnRef(\"c\", \"oid\").eqExpr(cfExpr.columnRef(\"i\", \"indrelid\"))).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"relnamespace\"))).leftJoin(cfTable(\"pg_class\", \"c2\"), cfExpr.columnRef(\"c2\", \"oid\").eqExpr(cfExpr.columnRef(\"i\", \"indexrelid\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf(conditions));\n\treturn {\n\t\tpkPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tpkAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed emptiness check: NOT EXISTS over the user table itself with\n* `LIMIT 1`. The table is addressed through the namespace's polymorphic\n* `tableSource` (qualified for named schemas, bare for the unbound slot).\n*/\nfunction tableIsEmptyAst(schema, table) {\n\tconst inner = exprSelect().from(checkNamespace(schema).tableSource(table)).project(\"one\", cfExpr.lit(1)).limit(1);\n\treturn exprSelect().project(\"result\", cfExpr.notExists(inner)).build();\n}\n/**\n* Typed no-NULL-values data check used by `SET NOT NULL` prechecks:\n* NOT EXISTS over the user table where the column IS NULL.\n*/\nfunction noNullValuesAst(options) {\n\tconst inner = exprSelect().from(checkNamespace(options.schema).tableSource(options.table)).project(\"one\", cfExpr.lit(1)).where(cfExpr.identifierRef(options.column).isNull());\n\treturn exprSelect().project(\"result\", cfExpr.notExists(inner)).build();\n}\n/**\n* Typed extension existence check over `pg_extension`, with the extension\n* name bound as a text parameter.\n*/\nfunction extensionExistsAst(extensionName) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_extension\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.identifierRef(\"extname\").eqParam(extensionName, PG_TEXT_CODEC_ID));\n\treturn {\n\t\textensionPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\textensionAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed check that an extension is installed in one schema: `pg_extension` joined to `pg_namespace`, with both names bound as text parameters.\n*/\nfunction extensionInSchemaAst(extensionName, schema) {\n\tconst inner = exprSelect().from(cfTable(\"pg_extension\", \"e\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"e\", \"extnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([cfExpr.columnRef(\"e\", \"extname\").eqParam(extensionName, PG_TEXT_CODEC_ID), cfExpr.columnRef(\"n\", \"nspname\").eqParam(schema, PG_TEXT_CODEC_ID)]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed RLS-policy existence check over `pg_policies`, with schema, table,\n* and policy names bound as text parameters (never inlined). The `schema`\n* coordinate is the resolved live-database schema name (e.g. `'public'`),\n* compared against `pg_policies.schemaname` as a bound parameter.\n*/\nfunction rlsPolicyExistsAst(options) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_policies\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.identifierRef(\"schemaname\").eqParam(options.schema, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"tablename\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"policyname\").eqParam(options.policyName, PG_TEXT_CODEC_ID)\n\t]));\n\treturn {\n\t\tpolicyPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tpolicyAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed row-level-security enabled check over `pg_class` joined to\n* `pg_namespace`, comparing `pg_class.relrowsecurity` against the expected\n* boolean. Schema and table names are bound as text parameters.\n*/\nfunction rlsEnabledAst(schema, table) {\n\tconst inner = (enabled) => exprSelect().from(cfTable(\"pg_class\", \"c\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"relnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqParam(schema, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"c\", \"relname\").eqParam(table, PG_TEXT_CODEC_ID),\n\t\tenabled ? cfExpr.columnRef(\"c\", \"relrowsecurity\") : cfExpr.columnRef(\"c\", \"relrowsecurity\").not()\n\t]));\n\treturn {\n\t\trlsEnabled: () => exprSelect().project(\"result\", cfExpr.exists(inner(true))).build(),\n\t\trlsDisabled: () => exprSelect().project(\"result\", cfExpr.exists(inner(false))).build()\n\t};\n}\n/**\n* Typed index existence check riding the same `to_regclass` vocabulary as\n* `tableExistsAst`, with the qualified index name bound as a text parameter.\n*/\nfunction indexExistsAst(schema, indexName) {\n\tconst regclass = toRegclass(checkNamespace(schema).qualifyTable(indexName));\n\treturn {\n\t\tindexPresent: () => exprSelect().project(\"result\", regclass.isNotNull()).build(),\n\t\tindexAbsent: () => exprSelect().project(\"result\", regclass.isNull()).build()\n\t};\n}\n/**\n* Typed native-enum type existence check over `pg_type` joined to\n* `pg_namespace`, restricted to enum types (`typtype = 'e'`). Schema and\n* type name are bound as text parameters; `schema` is a namespace\n* coordinate (the `__unbound__` sentinel compares against\n* `current_schema()`), matching {@link tableExistsAst} et al.\n*/\nfunction nativeEnumTypeExistsAst(schema, typeName) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_type\", \"t\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"t\", \"typnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(checkNamespace(schema).schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"t\", \"typname\").eqParam(typeName, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"t\", \"typtype\").eqParam(\"e\", PG_TEXT_CODEC_ID)\n\t]));\n\treturn {\n\t\ttypePresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\ttypeAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Typed native-enum member-value existence check over `pg_enum` joined to\n* `pg_type` and `pg_namespace`. Schema, type name, and the candidate member\n* value are bound as text parameters — used by `addNativeEnumValue`'s\n* precheck (value absent) and postcheck (value present).\n*/\nfunction nativeEnumValueExistsAst(options) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_enum\", \"e\")).join(cfTable(\"pg_type\", \"t\"), cfExpr.columnRef(\"t\", \"oid\").eqExpr(cfExpr.columnRef(\"e\", \"enumtypid\"))).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"t\", \"typnamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(checkNamespace(options.schema).schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"t\", \"typname\").eqParam(options.typeName, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"e\", \"enumlabel\").eqParam(options.value, PG_TEXT_CODEC_ID)\n\t]));\n\treturn {\n\t\tvaluePresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tvalueAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\n/**\n* Whether the attribute numbers in `keys` (an `int2[]` or `int2vector` such as `pg_constraint.conkey` or `pg_index.indkey`) name, in order, exactly the columns `names` of the relation `relation`. Key `0`, an expression slot of an index, names no column.\n*/\nfunction keyColumnsAre(keys, relation, names) {\n\treturn cfExpr.fn({\n\t\tmethod: \"key_columns_are\",\n\t\ttemplate: \"(SELECT coalesce(jsonb_agg(key_attribute.attname ORDER BY key_column.position), '[]'::jsonb) FROM unnest({{self}}::int2[]) WITH ORDINALITY AS key_column(attnum, position) JOIN pg_attribute key_attribute ON key_attribute.attrelid = {{arg0}} AND key_attribute.attnum = key_column.attnum) = ({{arg1}})::jsonb\",\n\t\tself: keys,\n\t\targs: [relation, cfExpr.param(JSON.stringify(names), PG_TEXT_CODEC_ID)],\n\t\treturns: {\n\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t});\n}\n/**\n* Typed check that the relation `name` exists and its `pg_class.relkind` is one of `kinds`, so a view, sequence or index of the same name does not pass as a table.\n*/\nfunction relationKindAst(options) {\n\tconst relation = toRegclass(checkNamespace(options.schema).qualifyTable(options.name));\n\tconst inner = exprSelect().from(cfTable(\"pg_class\", \"c\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([cfExpr.columnRef(\"c\", \"oid\").eqExpr(relation), options.kinds.map((kind) => cfExpr.columnRef(\"c\", \"relkind\").eqParam(kind, PG_TEXT_CODEC_ID)).reduce((either, kind) => either.or(kind))]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that the constraint `constraintName` on `table` is of kind `contype` (`p`, `u`, `f` or `c`), on the columns `columns` in order when given, and for a foreign key, references `foreignKey`'s table and columns in order with its delete and update actions. It reads only catalog values, never the text Postgres prints for a constraint.\n*/\nfunction constraintDefinitionAst(options) {\n\tconst namespace = checkNamespace(options.schema);\n\tconst conditions = [\n\t\tcfExpr.columnRef(\"c\", \"conname\").eqParam(options.constraintName, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"n\", \"nspname\").eqExpr(namespace.schemaFilterExpression()),\n\t\tcfExpr.columnRef(\"c\", \"conrelid\").eqExpr(toRegclass(namespace.qualifyTable(options.table))),\n\t\tcfExpr.columnRef(\"c\", \"contype\").eqParam(options.contype, PG_TEXT_CODEC_ID)\n\t];\n\tif (options.columns !== void 0) conditions.push(keyColumnsAre(cfExpr.columnRef(\"c\", \"conkey\"), cfExpr.columnRef(\"c\", \"conrelid\"), options.columns));\n\tconst foreignKey = options.foreignKey;\n\tif (foreignKey !== void 0) conditions.push(cfExpr.columnRef(\"c\", \"confrelid\").eqExpr(toRegclass(checkNamespace(foreignKey.referencedSchema).qualifyTable(foreignKey.referencedTable))), keyColumnsAre(cfExpr.columnRef(\"c\", \"confkey\"), cfExpr.columnRef(\"c\", \"confrelid\"), foreignKey.referencedColumns), cfExpr.columnRef(\"c\", \"confdeltype\").eqParam(foreignKey.onDelete, PG_TEXT_CODEC_ID), cfExpr.columnRef(\"c\", \"confupdtype\").eqParam(foreignKey.onUpdate, PG_TEXT_CODEC_ID));\n\tconst inner = exprSelect().from(cfTable(\"pg_constraint\", \"c\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"connamespace\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf(conditions));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that `index` is an index on `table` with the given uniqueness and access method, on the columns `columns` in order, and with or without a predicate. For an index written as an element list (`expression`) it checks no elements: the list can be a real expression, which Postgres stores in `indexprs`, or plain columns with a sort order, operator class or collation, which it stores as columns, and comparing its text would need the form Postgres prints.\n*/\nfunction indexDefinitionAst(options) {\n\tconst namespace = checkNamespace(options.schema);\n\tconst indexColumn = (name) => cfExpr.columnRef(\"i\", name);\n\tconst inner = exprSelect().from(cfTable(\"pg_class\", \"c\")).join(cfTable(\"pg_index\", \"i\"), cfExpr.columnRef(\"i\", \"indexrelid\").eqExpr(cfExpr.columnRef(\"c\", \"oid\"))).join(cfTable(\"pg_am\", \"m\"), cfExpr.columnRef(\"m\", \"oid\").eqExpr(cfExpr.columnRef(\"c\", \"relam\"))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"c\", \"oid\").eqExpr(toRegclass(namespace.qualifyTable(options.index))),\n\t\tcfExpr.columnRef(\"c\", \"relkind\").eqParam(\"i\", PG_TEXT_CODEC_ID).or(cfExpr.columnRef(\"c\", \"relkind\").eqParam(\"I\", PG_TEXT_CODEC_ID)),\n\t\tindexColumn(\"indrelid\").eqExpr(toRegclass(namespace.qualifyTable(options.table))),\n\t\toptions.unique ? indexColumn(\"indisunique\") : indexColumn(\"indisunique\").not(),\n\t\tcfExpr.columnRef(\"m\", \"amname\").eqParam(options.method, PG_TEXT_CODEC_ID),\n\t\t...\"columns\" in options.elements ? [indexColumn(\"indexprs\").isNull().and(keyColumnsAre(indexColumn(\"indkey\"), indexColumn(\"indrelid\"), options.elements.columns))] : [],\n\t\toptions.hasPredicate ? indexColumn(\"indpred\").isNotNull() : indexColumn(\"indpred\").isNull()\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that the RLS policy `policyName` on `table` exists with the command `command` (as `pg_policies.cmd` prints it, such as `ALL` or `SELECT`), the permissive flag, and exactly the roles `roles`, in any order. A role written as `current_user`, `current_role` or `session_user` stands for the role it names in the session that runs the check, as `CREATE POLICY` resolves it. It never compares the policy's expressions.\n*/\nfunction rlsPolicyDefinitionAst(options) {\n\tconst rolesAre = cfExpr.fn({\n\t\tmethod: \"roles_are\",\n\t\ttemplate: `(SELECT coalesce(jsonb_agg(role_name ORDER BY role_name), '[]'::jsonb) FROM (SELECT DISTINCT policy_role::text COLLATE \"C\" AS role_name FROM unnest({{self}}) AS policy_role) AS actual_roles) = (SELECT coalesce(jsonb_agg(role_name ORDER BY role_name), '[]'::jsonb) FROM (SELECT DISTINCT (CASE expected_role WHEN 'current_user' THEN current_user::text WHEN 'current_role' THEN current_role::text WHEN 'session_user' THEN session_user::text ELSE expected_role END) COLLATE \"C\" AS role_name FROM jsonb_array_elements_text(({{arg0}})::jsonb) AS expected_role) AS expected_roles)`,\n\t\tself: cfExpr.identifierRef(\"roles\"),\n\t\targs: [cfExpr.param(JSON.stringify(options.roles), PG_TEXT_CODEC_ID)],\n\t\treturns: {\n\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t});\n\tconst inner = exprSelect().from(cfTable(\"pg_policies\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.identifierRef(\"schemaname\").eqParam(options.schema, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"tablename\").eqParam(options.table, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"policyname\").eqParam(options.policyName, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"cmd\").eqParam(options.command, PG_TEXT_CODEC_ID),\n\t\tcfExpr.identifierRef(\"permissive\").eqParam(options.permissive ? \"PERMISSIVE\" : \"RESTRICTIVE\", PG_TEXT_CODEC_ID),\n\t\trolesAre\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that the column owns a sequence, whatever its name, of the type `sequenceType` (`smallint`, `integer` or `bigint`). With `orNone`, a column that owns no sequence passes too.\n*/\nfunction columnOwnsSequenceAst(options) {\n\tconst ownedSequence = ownedSequenceOf(options);\n\tconst sequenceType = cfExpr.fn({\n\t\tmethod: \"to_regtype\",\n\t\ttemplate: \"to_regtype({{self}})\",\n\t\tself: cfExpr.param(options.sequenceType, PG_TEXT_CODEC_ID),\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: true\n\t\t}\n\t});\n\tconst sequenceOfType = exprSelect().from(cfTable(\"pg_sequence\", \"s\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([cfExpr.columnRef(\"s\", \"seqrelid\").eqExpr(ownedSequence), cfExpr.columnRef(\"s\", \"seqtypid\").eqExpr(sequenceType)]));\n\treturn exprSelect().project(\"result\", options.orNone ? ownedSequence.isNull().or(cfExpr.exists(sequenceOfType)) : ownedSequence.isNotNull().and(cfExpr.exists(sequenceOfType))).build();\n}\n/**\n* Typed column-type check by the type's identity: compares the column's `pg_attribute.atttypid` with `to_regtype(type)`, or with that type's array type for a list. It checks a type that claims a kind, such as an enum, whatever schema it is in, and a type the stack's data types do not read. `to_regtype` drops a type modifier, so `varchar(20)` matches any `varchar`.\n*/\nfunction columnTypeOidAst(options) {\n\tconst namespace = checkNamespace(options.schema);\n\tconst expectedType = cfExpr.fn({\n\t\tmethod: \"to_regtype\",\n\t\ttemplate: options.many ? \"(SELECT \\\"t\\\".\\\"typarray\\\" FROM \\\"pg_catalog\\\".\\\"pg_type\\\" AS \\\"t\\\" WHERE \\\"t\\\".\\\"oid\\\" = to_regtype({{self}}))\" : \"to_regtype({{self}})\",\n\t\tself: cfExpr.param(options.type, PG_TEXT_CODEC_ID),\n\t\treturns: {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: true\n\t\t}\n\t});\n\tconst inner = exprSelect().from(cfTable(\"pg_attribute\", \"a\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([\n\t\tcfExpr.columnRef(\"a\", \"attrelid\").eqExpr(toRegclass(namespace.qualifyTable(options.table))),\n\t\tcfExpr.columnRef(\"a\", \"attname\").eqParam(options.column, PG_TEXT_CODEC_ID),\n\t\tcfExpr.columnRef(\"a\", \"atttypid\").eqExpr(expectedType),\n\t\tcfExpr.columnRef(\"a\", \"attisdropped\").not()\n\t]));\n\treturn exprSelect().project(\"result\", cfExpr.exists(inner)).build();\n}\n/**\n* Typed check that the sequence the column owns has handed out no value above `maxValue`, so narrowing it to a smaller integer type keeps every value it already gave. The sequence's position is read only when its current maximum is above `maxValue`, that is when the change narrows it, so widening needs no rights on the sequence. A sequence that has never been read, and a column that owns none, pass.\n*/\nfunction sequenceValuesFitAst(options) {\n\tconst pastMax = cfExpr.fn({\n\t\tmethod: \"sequence_past_max\",\n\t\ttemplate: \"CASE WHEN {{self}} <= ({{arg0}})::bigint THEN false ELSE coalesce(pg_sequence_last_value(\\\"s\\\".\\\"seqrelid\\\"), 0) > ({{arg0}})::bigint END\",\n\t\tself: cfExpr.columnRef(\"s\", \"seqmax\"),\n\t\targs: [cfExpr.param(options.maxValue, PG_TEXT_CODEC_ID)],\n\t\treturns: {\n\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t});\n\tconst narrowedPastMax = exprSelect().from(cfTable(\"pg_sequence\", \"s\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.columnRef(\"s\", \"seqrelid\").eqExpr(ownedSequenceOf(options)).and(pastMax));\n\treturn exprSelect().project(\"result\", cfExpr.notExists(narrowedPastMax)).build();\n}\n/** Typed schema existence check over `pg_namespace`, with the schema name bound as a text parameter. */\nfunction schemaExistsAst(schema) {\n\tconst inner = () => exprSelect().from(cfTable(\"pg_namespace\")).project(\"one\", cfExpr.lit(1)).where(cfExpr.identifierRef(\"nspname\").eqParam(schema, PG_TEXT_CODEC_ID));\n\treturn {\n\t\tschemaPresent: () => exprSelect().project(\"result\", cfExpr.exists(inner())).build(),\n\t\tschemaAbsent: () => exprSelect().project(\"result\", cfExpr.notExists(inner())).build()\n\t};\n}\nfunction objectsInSchema(catalog, namespaceColumn, schema, only = []) {\n\treturn exprSelect().from(cfTable(catalog, \"o\")).join(cfTable(\"pg_namespace\", \"n\"), cfExpr.columnRef(\"n\", \"oid\").eqExpr(cfExpr.columnRef(\"o\", namespaceColumn))).project(\"one\", cfExpr.lit(1)).where(cfExpr.allOf([cfExpr.columnRef(\"n\", \"nspname\").eqParam(schema, PG_TEXT_CODEC_ID), ...only]));\n}\n/**\n* Whether a schema holds no relations (tables, views, sequences, indexes), no types of its own and\n* no functions, so `DROP SCHEMA` without `CASCADE` succeeds. A table's row type and an array type\n* belong to another object and are not counted.\n*/\nfunction schemaHoldsNoObjectsAst(schema) {\n\treturn exprSelect().project(\"result\", cfExpr.allOf([\n\t\tcfExpr.notExists(objectsInSchema(\"pg_class\", \"relnamespace\", schema)),\n\t\tcfExpr.notExists(objectsInSchema(\"pg_type\", \"typnamespace\", schema, [cfExpr.columnRef(\"o\", \"typrelid\").eqLit(0), cfExpr.columnRef(\"o\", \"typelem\").eqLit(0)])),\n\t\tcfExpr.notExists(objectsInSchema(\"pg_proc\", \"pronamespace\", schema))\n\t])).build();\n}\n/**\n* After a table of the unbound namespace moves to `toSchema`: the search path finds no table of that\n* name, or finds only the moved one, which it does when `toSchema` is on the search path.\n*/\nfunction unboundTableMovedAst(table, toSchema) {\n\tconst found = toRegclass(checkNamespace(UNBOUND_NAMESPACE_ID).qualifyTable(table));\n\tconst moved = toRegclass(checkNamespace(toSchema).qualifyTable(table));\n\treturn exprSelect().project(\"result\", found.isNull().or(found.eqExpr(moved))).build();\n}\n//#endregion\n//#region src/contract-free/ddl.ts\n/**\n* Build a Postgres `CREATE TABLE` query node.\n*\n* Pass `constraints` for table-level composite primary keys, foreign keys, and\n* unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},\n* and {@link UniqueConstraint} classes from `@internal/sql-relational-core/ast`.\n*\n* Precondition: identifiers (`table`, `schema`, column names/types) are\n* emitted to SQL verbatim — they are not quoted or escaped, so callers must\n* pass pre-trusted values (e.g. fixed control-plane identifiers). String-literal\n* default values, by contrast, are single-quote-escaped (embedded `'` doubled)\n* by the renderer. Identifier quoting for untrusted identifiers is added when\n* the migration planner adopts this lowering path.\n*/\nfunction createTable(options) {\n\treturn new PostgresCreateTable(options);\n}\n/**\n* Build a Postgres `CREATE SCHEMA` query node. See {@link createTable} for the\n* pre-trusted-identifier precondition.\n*/\nfunction createSchema(options) {\n\treturn new PostgresCreateSchema(options);\n}\n/**\n* Build a Postgres `CREATE TYPE … AS ENUM (…)` DDL node. The type name (and\n* optional schema) are quoted by the renderer; the enum member `values` are\n* emitted as single-quote-escaped string literals. An absent `schema` renders\n* the type name unqualified so the connection's `search_path` resolves it.\n*/\nfunction createType(options) {\n\treturn new PostgresCreateType(options);\n}\n/**\n* Build a Postgres `DROP TYPE` DDL node. See {@link createType} for the\n* identifier-quoting and unqualified-when-schemaless behaviour.\n*/\nfunction dropType(options) {\n\treturn new PostgresDropType(options);\n}\n/**\n* Build an `ADD COLUMN` action for use inside {@link alterTable}.\n* The column is a structured `DdlColumn` so codec-encoded defaults flow\n* through the adapter's `pgRenderDdlColumn` → `pgRenderDdlColumnDefault` path.\n*/\nfunction addColumnAction(column) {\n\treturn new AddColumnAction(column);\n}\n/**\n* Build a `DROP DEFAULT` action (`ALTER COLUMN \"<name>\" DROP DEFAULT`) for\n* use inside {@link alterTable}. The renderer quotes the column name.\n*/\nfunction dropDefaultAction(columnName) {\n\treturn new DropDefaultAction(columnName);\n}\n/**\n* Build an `ADD CONSTRAINT` action for use inside {@link alterTable}. The renderer writes the constraint as `CREATE TABLE` writes it.\n*/\nfunction addConstraintAction(constraint) {\n\treturn new AddConstraintAction(constraint);\n}\n/**\n* Build an `ALTER COLUMN \"<columnName>\" TYPE <type> USING …` action for use inside {@link alterTable}. `type` is written verbatim; `using` is opaque SQL, and when it is absent or empty the conversion is `\"<columnName>\"::<type>`.\n*/\nfunction alterColumnTypeAction(options) {\n\treturn new AlterColumnTypeAction({\n\t\tcolumnName: options.columnName,\n\t\ttype: options.type,\n\t\tusing: options.using ? opaqueSql(options.using) : void 0\n\t});\n}\n/**\n* Build a Postgres `ALTER TABLE` query node carrying one or more actions.\n* See {@link addColumnAction}, {@link dropDefaultAction}, {@link addConstraintAction} and {@link alterColumnTypeAction} for building actions.\n*/\nfunction alterTable(options) {\n\treturn new PostgresAlterTable(options);\n}\n/**\n* Build a Postgres `CREATE POLICY` DDL node.\n*\n* Identifiers (`schema`, `table`, `name`) are quoted by the renderer.\n* `using` and `withCheck` are emitted verbatim as predicate SQL — callers\n* must supply safe, pre-validated SQL expressions.\n*/\nfunction createPolicy(options) {\n\tconst { using, withCheck, ...rest } = options;\n\treturn new PostgresCreatePolicy({\n\t\t...rest,\n\t\t...ifDefined(\"using\", using === void 0 ? void 0 : opaqueSql(using)),\n\t\t...ifDefined(\"withCheck\", withCheck === void 0 ? void 0 : opaqueSql(withCheck))\n\t});\n}\n/**\n* Build a Postgres `DROP POLICY` DDL node.\n* Identifiers (`schema`, `table`, `name`) are quoted by the renderer.\n*/\nfunction dropPolicy(options) {\n\treturn new PostgresDropPolicy(options);\n}\n/**\n* Build a Postgres `ALTER POLICY … RENAME TO` DDL node.\n* Identifiers (`schema`, `table`, `name`, `newName`) are quoted by the renderer.\n*/\nfunction alterPolicyRename(options) {\n\treturn new PostgresAlterPolicyRename(options);\n}\n/**\n* Build a Postgres `CREATE [UNIQUE] INDEX` DDL node. Identifiers (`schema`,\n* `table`, `name`, column elements, `type`, option keys) are quoted by the\n* renderer; the `expression` element list and the `where` predicate are\n* inserted verbatim (opaque SQL). An absent `schema` renders the object\n* names unqualified (the unbound namespace).\n*/\nfunction createIndex(options) {\n\tconst { elements, where, ...rest } = options;\n\treturn new PostgresCreateIndex({\n\t\t...rest,\n\t\telements: \"columns\" in elements ? { columns: elements.columns } : { expression: opaqueSql(elements.expression) },\n\t\twhere: where === void 0 ? void 0 : opaqueSql(where)\n\t});\n}\n/**\n* Build a Postgres `DROP INDEX` DDL node. The index name (and optional\n* schema) are quoted by the renderer.\n*/\nfunction dropIndex(options) {\n\treturn new PostgresDropIndex(options);\n}\n/**\n* Build a Postgres `ALTER INDEX … RENAME TO` DDL node. Identifiers are\n* quoted by the renderer.\n*/\nfunction alterIndexRename(options) {\n\treturn new PostgresAlterIndexRename(options);\n}\n/**\n* Build a Postgres `ALTER TABLE … DISABLE ROW LEVEL SECURITY` DDL node.\n* Identifiers (`schema`, `table`) are quoted by the renderer.\n*/\nfunction disableRowLevelSecurity(options) {\n\treturn new PostgresDisableRowLevelSecurity(options);\n}\n/**\n* Build a Postgres `ALTER TABLE … SET SCHEMA` DDL node. Identifiers are quoted by the renderer; an\n* absent `schema` leaves the table unqualified (the unbound namespace).\n*/\nfunction alterTableSetSchema(options) {\n\treturn new PostgresAlterTableSetSchema(options);\n}\n/** Build a Postgres `ALTER SCHEMA … RENAME TO` DDL node. Identifiers are quoted by the renderer. */\nfunction alterSchemaRename(options) {\n\treturn new PostgresAlterSchemaRename(options);\n}\n/** Build a Postgres `DROP SCHEMA` DDL node, without `CASCADE`. The name is quoted by the renderer. */\nfunction dropSchema(options) {\n\treturn new PostgresDropSchema(options);\n}\n//#endregion\nexport { extensionInSchemaAst as A, schemaExistsAst as B, columnNullabilityAst as C, constraintDefinitionAst as D, columnTypeOidAst as E, noNullValuesAst as F, tableIsEmptyAst as G, sequenceNameAvailableAst as H, relationKindAst as I, unboundTableMovedAst as J, tablePrimaryKeyAst as K, rlsEnabledAst as L, indexExistsAst as M, nativeEnumTypeExistsAst as N, constraintExistsAst as O, nativeEnumValueExistsAst as P, rlsPolicyDefinitionAst as R, columnExistsAst as S, columnTypeAst as T, sequenceValuesFitAst as U, schemaHoldsNoObjectsAst as V, tableExistsAst as W, dropPolicy as _, alterPolicyRename as a, columnDefaultAst as b, alterTableSetSchema as c, createSchema as d, createTable as f, dropIndex as g, dropDefaultAction as h, alterIndexRename as i, indexDefinitionAst as j, extensionExistsAst as k, createIndex as l, disableRowLevelSecurity as m, addConstraintAction as n, alterSchemaRename as o, createType as p, toRegclass as q, alterColumnTypeAction as r, alterTable as s, addColumnAction as t, createPolicy as u, dropSchema as v, columnOwnsSequenceAst as w, columnDefaultSequenceAst as x, dropType as y, rlsPolicyExistsAst as z };\n\n//# sourceMappingURL=ddl-DCQLfg18.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,WAAW,eAAe;CAClC,OAAO,OAAO,GAAG;EAChB,QAAQ;EACR,UAAU;EACV,MAAM,OAAO,MAAM,eAAe,gBAAgB;EAClD,SAAS;GACR,SAAS;GACT,UAAU;EACX;CACD,CAAC;AACF;;;;;;;;;;AAUA,SAAS,eAAe,QAAQ,OAAO;CACtC,MAAM,WAAW,WAAW,wBAAwB;EACnD,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC;CACtB,OAAO;EACN,mBAAmB,WAAW,CAAC,CAAC,QAAQ,UAAU,SAAS,OAAO,CAAC,CAAC,CAAC,MAAM;EAC3E,oBAAoB,WAAW,CAAC,CAAC,QAAQ,UAAU,SAAS,UAAU,CAAC,CAAC,CAAC,MAAM;CAChF;AACD;;;;;;;;;;;;;;;AAeA,SAAS,oBAAoB,SAAS;CACrC,MAAM,YAAY,wBAAwB;EACzC,IAAI,QAAQ;EACZ,SAAS,EAAE,OAAO,CAAC,EAA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IAAI,0BAA0B,OAAO;AAC7C;;AAEA,SAAS,WAAW,SAAS;CAC5B,OAAO,IAAI,mBAAmB,OAAO;AACtC"}
|
package/dist/{descriptor-meta-CKsHlt_c-UQ14enZp.mjs → descriptor-meta-CKsHlt_c-DkP2ZqQd.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as postgresCodecRegistry } from "./registry-
|
|
2
|
-
import { r as postgresAdapterContractContributions } from "./contract-contributions-n5CdvwA9-
|
|
1
|
+
import { n as postgresCodecRegistry } from "./registry-D4AyYsXr-CgiiMuFS.mjs";
|
|
2
|
+
import { r as postgresAdapterContractContributions } from "./contract-contributions-n5CdvwA9-BgUoiuTT.mjs";
|
|
3
3
|
//#region ../../../3-targets/postgres/2-adapter/dist/descriptor-meta-CKsHlt_c.mjs
|
|
4
4
|
const postgresAdapterDescriptorMeta = {
|
|
5
5
|
kind: "adapter",
|
|
@@ -33,4 +33,4 @@ const postgresAdapterDescriptorMeta = {
|
|
|
33
33
|
//#endregion
|
|
34
34
|
export { postgresAdapterDescriptorMeta as t };
|
|
35
35
|
|
|
36
|
-
//# sourceMappingURL=descriptor-meta-CKsHlt_c-
|
|
36
|
+
//# sourceMappingURL=descriptor-meta-CKsHlt_c-DkP2ZqQd.mjs.map
|
package/dist/{descriptor-meta-CKsHlt_c-UQ14enZp.mjs.map → descriptor-meta-CKsHlt_c-DkP2ZqQd.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-CKsHlt_c-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-CKsHlt_c-DkP2ZqQd.mjs","names":[],"sources":["../../../../3-targets/postgres/2-adapter/dist/descriptor-meta-CKsHlt_c.mjs"],"sourcesContent":["import { t as postgresAdapterContractContributions } from \"./contract-contributions-n5CdvwA9.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\n//#region src/core/descriptor-meta.ts\nconst postgresAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: postgresAdapterContractContributions.capabilities,\n\ttypes: {\n\t\taggregateDescriptors: postgresAdapterContractContributions.types.aggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(postgresCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgTypes\"\n\t\t\t},\n\t\t\ttypeImports: [{\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"JsonValue\",\n\t\t\t\talias: \"JsonValue\"\n\t\t\t}],\n\t\t\tparameterizedOutputTypes: {\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"ParameterizedOutputTypesForTypeParams\",\n\t\t\t\talias: \"PgParameterizedOutputTypes\"\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\nexport { postgresAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-CKsHlt_c.mjs.map"],"mappings":";;;AAGA,MAAM,gCAAgC;CACrC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,qCAAqC;CACnD,OAAO;EACN,sBAAsB,qCAAqC,MAAM;EACjE,YAAY;GACX,kBAAkB,MAAM,KAAK,sBAAsB,OAAO,CAAC;GAC3D,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;GACA,aAAa,CAAC;IACb,SAAS;IACT,OAAO;IACP,OAAO;GACR,CAAC;GACD,0BAA0B;IACzB,SAAS;IACT,OAAO;IACP,OAAO;GACR;EACD;CACD;AACD"}
|
package/dist/{descriptor-meta-DWKp5Q1s-DplRJE9N.mjs → descriptor-meta-xBYwG7xG-DWAZTiD5.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { A as PG_TIMESTAMP_INSTANT_CODEC_ID, B as PG_VARCHAR_CODEC_ID, D as PG_TIMESTAMPTZ_STRING_CODEC_ID, E as PG_TIMESTAMPTZ_DATE_CODEC_ID, F as PG_TIME_TEMPORAL_CODEC_ID, M as PG_TIMESTAMP_TEMPORAL_CODEC_ID, N as PG_TIMETZ_CODEC_ID, O as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, P as PG_TIME_STRING_CODEC_ID, R as PG_UUID_CODEC_ID, T as PG_TEXT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, i as PG_CHAR_CODEC_ID, j as PG_TIMESTAMP_STRING_CODEC_ID, k as PG_TIMESTAMP_DATE_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID } from "./codec-ids-2htdtS66-CJPMZv1t.mjs";
|
|
2
|
-
import { $ as pgXml, A as pgJson, C as pgFloat8, D as pgInt8, E as pgInt4, F as pgNumeric, G as pgTimestamptz, L as pgOid, N as pgMoney, Q as pgVarchar, S as pgFloat4, T as pgInt2, U as pgTimestamp, V as pgTime, X as pgUuid, Z as pgVarbit, et as postgresDataTypes, f as pgBool, g as pgChar, j as pgJsonb, nt as postgresTextDataTypes, p as pgBytea, q as pgTimetz, u as pgBit, v as pgDate, w as pgInet, z as pgText } from "./data-types-
|
|
2
|
+
import { $ as pgXml, A as pgJson, C as pgFloat8, D as pgInt8, E as pgInt4, F as pgNumeric, G as pgTimestamptz, L as pgOid, N as pgMoney, Q as pgVarchar, S as pgFloat4, T as pgInt2, U as pgTimestamp, V as pgTime, X as pgUuid, Z as pgVarbit, et as postgresDataTypes, f as pgBool, g as pgChar, j as pgJsonb, nt as postgresTextDataTypes, p as pgBytea, q as pgTimetz, u as pgBit, v as pgDate, w as pgInet, z as pgText } from "./data-types-DWfwErIu-DF85cgmu.mjs";
|
|
3
3
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cxc0dBbO.mjs";
|
|
4
|
-
import { U as postgresQualifyColumnType } from "./codecs-
|
|
5
|
-
import { t as postgresCodecDescriptorRegistry } from "./registry-
|
|
6
|
-
import { v as postgresCreateNamespace } from "./postgres-schema-
|
|
7
|
-
import { a as postgresAuthoringTypes, c as postgresScalarTypes, i as postgresAuthoringPslBlockDescriptors, n as postgresAuthoringEntityTypes, r as postgresAuthoringModelAttributes, s as postgresLowerEntityHandles } from "./authoring-
|
|
8
|
-
import { t as postgresRenderCheckExpressions } from "./check-expressions-
|
|
9
|
-
import { i as postgresNowGeneratorControlDescriptors, n as TIMESTAMP_STRING_NOW_GENERATOR_ID, o as postgresTargetDescriptorMetaRuntime, r as TIMETZ_NOW_GENERATOR_ID, t as TIMESTAMPTZ_STRING_NOW_GENERATOR_ID } from "./date-time-now-generators-
|
|
10
|
-
import { t as postgresDataTypeEntries } from "./data-type-entries-
|
|
11
|
-
import { n as postgresIndexTypes } from "./index-types-
|
|
4
|
+
import { U as postgresQualifyColumnType } from "./codecs-Bzj3M0Q3-C2oFSIGs.mjs";
|
|
5
|
+
import { t as postgresCodecDescriptorRegistry } from "./registry-D4AyYsXr-CgiiMuFS.mjs";
|
|
6
|
+
import { v as postgresCreateNamespace } from "./postgres-schema-zd_p5Lg2-BdJlG7Cg.mjs";
|
|
7
|
+
import { a as postgresAuthoringTypes, c as postgresScalarTypes, i as postgresAuthoringPslBlockDescriptors, n as postgresAuthoringEntityTypes, r as postgresAuthoringModelAttributes, s as postgresLowerEntityHandles } from "./authoring-BbS0bin5-U9tXyzS6.mjs";
|
|
8
|
+
import { t as postgresRenderCheckExpressions } from "./check-expressions-Ch-A_NJN-BscDa8xT.mjs";
|
|
9
|
+
import { i as postgresNowGeneratorControlDescriptors, n as TIMESTAMP_STRING_NOW_GENERATOR_ID, o as postgresTargetDescriptorMetaRuntime, r as TIMETZ_NOW_GENERATOR_ID, t as TIMESTAMPTZ_STRING_NOW_GENERATOR_ID } from "./date-time-now-generators-BORO1_nc-BdCe3ppq.mjs";
|
|
10
|
+
import { t as postgresDataTypeEntries } from "./data-type-entries-CVxsfjF3-Bd0cSfuG.mjs";
|
|
11
|
+
import { n as postgresIndexTypes } from "./index-types-DGrgbAd4-DuGWdvol.mjs";
|
|
12
12
|
import { createDataTypeLookup } from "@prisma/orm-framework/components/codec";
|
|
13
13
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
14
14
|
import { idGeneratorFunctionBindings, sqlIntegerArgumentGeneratorFunctions } from "@prisma/orm-family-sql/family/pack";
|
|
@@ -16,7 +16,7 @@ import { TIMESTAMP_NOW_GENERATOR_ID, authoringTypeConstructorArguments } from "@
|
|
|
16
16
|
import { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from "@prisma/orm-framework/type-implementations/now";
|
|
17
17
|
import { singleGeneratorBinding } from "@prisma/orm-framework/components/components";
|
|
18
18
|
import { inferredTypeConstructors } from "@prisma/orm-family-sql/family/psl-build";
|
|
19
|
-
//#region ../../../3-targets/postgres/1-target/dist/descriptor-meta-
|
|
19
|
+
//#region ../../../3-targets/postgres/1-target/dist/descriptor-meta-xBYwG7xG.mjs
|
|
20
20
|
/** The "now" generator for each codec that has one. The `now` generator function binds it. */
|
|
21
21
|
const postgresNowGeneratorIds = {
|
|
22
22
|
[PG_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,
|
|
@@ -199,4 +199,4 @@ const postgresTargetDescriptorMeta = {
|
|
|
199
199
|
//#endregion
|
|
200
200
|
export { prisma7PostgresTypeMap as n, postgresTargetDescriptorMeta as t };
|
|
201
201
|
|
|
202
|
-
//# sourceMappingURL=descriptor-meta-
|
|
202
|
+
//# sourceMappingURL=descriptor-meta-xBYwG7xG-DWAZTiD5.mjs.map
|
package/dist/{descriptor-meta-DWKp5Q1s-DplRJE9N.mjs.map → descriptor-meta-xBYwG7xG-DWAZTiD5.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-DWKp5Q1s-DplRJE9N.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/descriptor-meta-DWKp5Q1s.mjs"],"sourcesContent":["import { A as PG_TIMESTAMP_INSTANT_CODEC_ID, B as PG_VARCHAR_CODEC_ID, D as PG_TIMESTAMPTZ_STRING_CODEC_ID, E as PG_TIMESTAMPTZ_DATE_CODEC_ID, F as PG_TIME_TEMPORAL_CODEC_ID, M as PG_TIMESTAMP_TEMPORAL_CODEC_ID, N as PG_TIMETZ_CODEC_ID, O as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, P as PG_TIME_STRING_CODEC_ID, R as PG_UUID_CODEC_ID, T as PG_TEXT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, i as PG_CHAR_CODEC_ID, j as PG_TIMESTAMP_STRING_CODEC_ID, k as PG_TIMESTAMP_DATE_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { A as pgText, E as pgNumeric, G as postgresDataTypes, H as pgVarbit, I as pgTimestamptz, K as postgresTextDataTypes, M as pgTime, O as pgOid, P as pgTimestamp, R as pgTimetz, S as pgJsonb, U as pgVarchar, V as pgUuid, W as pgXml, _ as pgInt2, c as pgChar, g as pgInet, h as pgFloat8, i as pgBit, m as pgFloat4, o as pgBool, s as pgBytea, u as pgDate, v as pgInt4, w as pgMoney, x as pgJson, y as pgInt8 } from \"./data-types-B47LbZ3z.mjs\";\nimport { t as postgresDataTypeEntries } from \"./data-type-entries-dmLDRSOf.mjs\";\nimport { k as postgresQualifyColumnType } from \"./codecs-CV-_K-z0.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { t as postgresCodecDescriptorRegistry } from \"./registry-Ctq7UGkA.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-BBWgs4fX.mjs\";\nimport { a as postgresAuthoringTypes, c as postgresScalarTypes, i as postgresAuthoringPslBlockDescriptors, n as postgresAuthoringEntityTypes, o as postgresLowerEntityHandles, r as postgresAuthoringModelAttributes } from \"./authoring-BD4uEpBM.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-DL9WtMO5.mjs\";\nimport { i as postgresNowGeneratorControlDescriptors, n as TIMESTAMP_STRING_NOW_GENERATOR_ID, o as postgresTargetDescriptorMetaRuntime, r as TIMETZ_NOW_GENERATOR_ID, t as TIMESTAMPTZ_STRING_NOW_GENERATOR_ID } from \"./date-time-now-generators-BMMGy0vy.mjs\";\nimport { n as postgresIndexTypes } from \"./index-types-B5sQ5Vw0.mjs\";\nimport { createDataTypeLookup } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { idGeneratorFunctionBindings, sqlIntegerArgumentGeneratorFunctions } from \"@internal/family-sql/pack\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, authoringTypeConstructorArguments } from \"@internal/framework-components/authoring\";\nimport { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from \"@internal/type-implementations/now\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { inferredTypeConstructors } from \"@internal/family-sql/psl-build\";\n//#region src/core/now-generators.ts\n/** The \"now\" generator for each codec that has one. The `now` generator function binds it. */\nconst postgresNowGeneratorIds = {\n\t[PG_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,\n\t[PG_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,\n\t[PG_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID,\n\t[PG_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMETZ_CODEC_ID]: TIMETZ_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: TIMESTAMP_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: TIMESTAMPTZ_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_INSTANT_CODEC_ID]: INSTANT_NOW_GENERATOR_ID\n};\nnew Map(Object.entries(postgresNowGeneratorIds));\n/** The codecs whose \"now\" generator takes the column's precision and rounds down to it, so PostgreSQL stores the value the client holds rather than rounding it up, which for a time can reach `24:00:00`. */\nconst postgresNowGeneratorTakesPrecision = {\n\t[PG_TIME_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIME_STRING_CODEC_ID]: true,\n\t[PG_TIMETZ_CODEC_ID]: true,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: true,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: true,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: true,\n\t[PG_TIMESTAMP_DATE_CODEC_ID]: true,\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIMESTAMP_INSTANT_CODEC_ID]: true\n};\n/** The `now` generator function bound to each Postgres date and time codec, with the column's precision on the codecs that take it. */\nconst postgresNowGeneratorFunction = {\n\tname: \"now\",\n\tbindings: Object.entries(postgresNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({\n\t\tcodecIds: [codecId],\n\t\tgeneratorId,\n\t\tparamsFromField: (column) => {\n\t\t\tconst precision = column.typeParams?.[\"precision\"];\n\t\t\treturn Object.hasOwn(postgresNowGeneratorTakesPrecision, codecId) && typeof precision === \"number\" ? { precision } : void 0;\n\t\t}\n\t}))\n};\n//#endregion\n//#region src/core/generator-functions.ts\nconst postgresGeneratorFunctions = [\n\t...sqlIntegerArgumentGeneratorFunctions({ integer: pgInt4.id }),\n\tpostgresNowGeneratorFunction,\n\t...idGeneratorFunctionBindings({\n\t\ttext: [\n\t\t\tPG_CHAR_CODEC_ID,\n\t\t\tPG_VARCHAR_CODEC_ID,\n\t\t\tPG_TEXT_CODEC_ID\n\t\t],\n\t\tuuid: [PG_UUID_CODEC_ID]\n\t})\n];\n/** The `now` generators Postgres binds. The SQL family registers the identifier generators. */\nconst postgresGeneratorDescriptors = [{ id: TIMESTAMP_NOW_GENERATOR_ID }, ...postgresNowGeneratorControlDescriptors()];\n//#endregion\n//#region src/core/prisma7-type-map.ts\nconst of = (type, params = {}) => ({\n\tdataType: type.id,\n\tparams\n});\n/**\n* What Prisma 7.10.0 creates in Postgres for each Prisma 7 scalar and `@db.*` native type, as a data type and its parameters. Derived from the SQL recorded in `test/integration/test/fixtures/prisma7-source/reference/migration.sql`. A `@db.*` attribute's own arguments replace the parameters; without any, the column gets these, so `@db.Char` is the `character(1)` Postgres stores for Prisma 7's `CHAR`, and `@db.Bit` the `bit(1)` it stores for `BIT`.\n*/\nconst prisma7PostgresTypes = {\n\tscalars: {\n\t\tString: of(pgText),\n\t\tBoolean: of(pgBool),\n\t\tInt: of(pgInt4),\n\t\tBigInt: of(pgInt8),\n\t\tFloat: of(pgFloat8),\n\t\tDecimal: of(pgNumeric, {\n\t\t\tprecision: 65,\n\t\t\tscale: 30\n\t\t}),\n\t\tDateTime: of(pgTimestamp, { precision: 3 }),\n\t\tJson: of(pgJsonb),\n\t\tBytes: of(pgBytea)\n\t},\n\tnativeTypes: {\n\t\tText: of(pgText),\n\t\tVarChar: of(pgVarchar),\n\t\tChar: of(pgChar, { length: 1 }),\n\t\tUuid: of(pgUuid),\n\t\tInet: of(pgInet),\n\t\tBoolean: of(pgBool),\n\t\tInteger: of(pgInt4),\n\t\tSmallInt: of(pgInt2),\n\t\tBigInt: of(pgInt8),\n\t\tReal: of(pgFloat4),\n\t\tDoublePrecision: of(pgFloat8),\n\t\tDecimal: of(pgNumeric),\n\t\tTimestamp: of(pgTimestamp),\n\t\tTimestamptz: of(pgTimestamptz),\n\t\tDate: of(pgDate),\n\t\tTime: of(pgTime),\n\t\tTimetz: of(pgTimetz),\n\t\tJson: of(pgJson),\n\t\tJsonB: of(pgJsonb),\n\t\tByteA: of(pgBytea),\n\t\tBit: of(pgBit, { length: 1 }),\n\t\tVarBit: of(pgVarbit),\n\t\tXml: of(pgXml),\n\t\tOid: of(pgOid),\n\t\tMoney: of(pgMoney)\n\t}\n};\nconst marked = inferredTypeConstructors({\n\tauthoringTypes: postgresScalarTypes,\n\tcodecLookup: postgresCodecDescriptorRegistry,\n\tdataTypeLookup: createDataTypeLookup(postgresDataTypes)\n});\n/**\n* The constructor marked `inferred` for the column's data type, with every parameter Prisma 7 gives the column as an argument. The reader builds a contract, so it keeps each parameter rather than the fewest arguments printed PSL writes.\n*/\nfunction mappingOf({ dataType, params }) {\n\tconst markedConstructor = marked.get(dataType);\n\tconst args = markedConstructor === void 0 ? void 0 : authoringTypeConstructorArguments(markedConstructor.descriptor, {\n\t\tcodecId: markedConstructor.descriptor.output.codecId,\n\t\ttypeParams: params\n\t});\n\tif (markedConstructor === void 0 || args === void 0) throw new InternalError(`No constructor marked inferred writes ${dataType} with these parameters.`);\n\treturn {\n\t\tconstructorPath: markedConstructor.path,\n\t\targs\n\t};\n}\nfunction mappingsOf(types) {\n\treturn Object.fromEntries(Object.entries(types).map(([name, type]) => [name, mappingOf(type)]));\n}\n/** {@link prisma7PostgresTypes} as the Prisma 7 reader takes it: each type's constructor call. */\nconst prisma7PostgresTypeMap = {\n\tscalars: mappingsOf(prisma7PostgresTypes.scalars),\n\tnativeTypes: mappingsOf(prisma7PostgresTypes.nativeTypes),\n\textensionNativeTypes: { Citext: {\n\t\tconstructorPath: [\"citext\", \"Citext\"],\n\t\targs: [],\n\t\textension: \"citext\"\n\t} }\n};\n/** The Prisma 7 `@db.*` names whose Prisma 8 constructor has another name, such as `Text` to `String`. */\nconst prisma7PostgresRenamedNativeTypes = Object.fromEntries(Object.entries({\n\t...prisma7PostgresTypeMap.nativeTypes,\n\t...prisma7PostgresTypeMap.extensionNativeTypes\n}).flatMap(([name, { constructorPath }]) => {\n\tconst constructorName = constructorPath.join(\".\");\n\treturn constructorName === name ? [] : [[name, constructorName]];\n}));\nconst postgresTargetDescriptorMeta = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID,\n\tsupportsNamespaces: true,\n\tdisplayName: \"Postgres\",\n\tindexTypes: postgresIndexTypes,\n\tauthoring: {\n\t\ttype: {\n\t\t\t...postgresScalarTypes,\n\t\t\t...postgresAuthoringTypes\n\t\t},\n\t\tdataTypes: postgresDataTypeEntries(),\n\t\ttextDataTypes: postgresTextDataTypes,\n\t\trenamedTypeConstructors: prisma7PostgresRenamedNativeTypes,\n\t\tentityTypes: postgresAuthoringEntityTypes,\n\t\tpslBlockDescriptors: postgresAuthoringPslBlockDescriptors,\n\t\tmodelAttributes: postgresAuthoringModelAttributes,\n\t\tcreateNamespace: postgresCreateNamespace,\n\t\tqualifyColumnType: postgresQualifyColumnType,\n\t\trenderCheckExpressions: postgresRenderCheckExpressions,\n\t\tlowerEntityHandles: postgresLowerEntityHandles\n\t},\n\tgeneratorFunctions: postgresGeneratorFunctions,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: postgresGeneratorDescriptors\n\t},\n\ttypes: { queryOperationTypes: { import: {\n\t\tpackage: \"@internal/target-postgres/operation-types\",\n\t\tnamed: \"QueryOperationTypes\",\n\t\talias: \"PgTargetQueryOps\"\n\t} } }\n};\n//#endregion\nexport { prisma7PostgresTypeMap as n, postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-DWKp5Q1s.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,0BAA0B;EAC9B,4BAA4B;EAC5B,0BAA0B;EAC1B,4BAA4B;EAC5B,0BAA0B;EAC1B,qBAAqB;EACrB,iCAAiC;EACjC,+BAA+B;EAC/B,mCAAmC;EACnC,iCAAiC;EACjC,+BAA+B;EAC/B,6BAA6B;EAC7B,gCAAgC;AAClC;AACA,IAAI,IAAI,OAAO,QAAQ,uBAAuB,CAAC;;AAE/C,MAAM,qCAAqC;EACzC,4BAA4B;EAC5B,0BAA0B;EAC1B,qBAAqB;EACrB,+BAA+B;EAC/B,iCAAiC;EACjC,+BAA+B;EAC/B,6BAA6B;EAC7B,iCAAiC;EACjC,mCAAmC;EACnC,gCAAgC;AAClC;;AAEA,MAAM,+BAA+B;CACpC,MAAM;CACN,UAAU,OAAO,QAAQ,uBAAuB,CAAC,CAAC,KAAK,CAAC,SAAS,iBAAiB,uBAAuB;EACxG,UAAU,CAAC,OAAO;EAClB;EACA,kBAAkB,WAAW;GAC5B,MAAM,YAAY,OAAO,aAAa;GACtC,OAAO,OAAO,OAAO,oCAAoC,OAAO,KAAK,OAAO,cAAc,WAAW,EAAE,UAAU,IAAI,KAAK;EAC3H;CACD,CAAC,CAAC;AACH;AAGA,MAAM,6BAA6B;CAClC,GAAG,qCAAqC,EAAE,SAAS,OAAO,GAAG,CAAC;CAC9D;CACA,GAAG,4BAA4B;EAC9B,MAAM;GACL;GACA;GACA;EACD;EACA,MAAM,CAAC,gBAAgB;CACxB,CAAC;AACF;;AAEA,MAAM,+BAA+B,CAAC,EAAE,IAAI,2BAA2B,GAAG,GAAG,uCAA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yCAAyC,IAAI,IAAI;EACjD,sBAAsB;CACvB;CACA,OAAO,EAAE,qBAAqB,EAAE,QAAQ;EACvC,SAAS;EACT,OAAO;EACP,OAAO;CACR,EAAE,EAAE;AACL"}
|
|
1
|
+
{"version":3,"file":"descriptor-meta-xBYwG7xG-DWAZTiD5.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/descriptor-meta-xBYwG7xG.mjs"],"sourcesContent":["import { A as PG_TIMESTAMP_INSTANT_CODEC_ID, B as PG_VARCHAR_CODEC_ID, D as PG_TIMESTAMPTZ_STRING_CODEC_ID, E as PG_TIMESTAMPTZ_DATE_CODEC_ID, F as PG_TIME_TEMPORAL_CODEC_ID, M as PG_TIMESTAMP_TEMPORAL_CODEC_ID, N as PG_TIMETZ_CODEC_ID, O as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, P as PG_TIME_STRING_CODEC_ID, R as PG_UUID_CODEC_ID, T as PG_TEXT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, i as PG_CHAR_CODEC_ID, j as PG_TIMESTAMP_STRING_CODEC_ID, k as PG_TIMESTAMP_DATE_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { A as pgText, E as pgNumeric, G as postgresDataTypes, H as pgVarbit, I as pgTimestamptz, K as postgresTextDataTypes, M as pgTime, O as pgOid, P as pgTimestamp, R as pgTimetz, S as pgJsonb, U as pgVarchar, V as pgUuid, W as pgXml, _ as pgInt2, c as pgChar, g as pgInet, h as pgFloat8, i as pgBit, m as pgFloat4, o as pgBool, s as pgBytea, u as pgDate, v as pgInt4, w as pgMoney, x as pgJson, y as pgInt8 } from \"./data-types-DWfwErIu.mjs\";\nimport { t as postgresDataTypeEntries } from \"./data-type-entries-CVxsfjF3.mjs\";\nimport { k as postgresQualifyColumnType } from \"./codecs-Bzj3M0Q3.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { t as postgresCodecDescriptorRegistry } from \"./registry-D4AyYsXr.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-zd_p5Lg2.mjs\";\nimport { a as postgresAuthoringTypes, c as postgresScalarTypes, i as postgresAuthoringPslBlockDescriptors, n as postgresAuthoringEntityTypes, o as postgresLowerEntityHandles, r as postgresAuthoringModelAttributes } from \"./authoring-BbS0bin5.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-Ch-A_NJN.mjs\";\nimport { i as postgresNowGeneratorControlDescriptors, n as TIMESTAMP_STRING_NOW_GENERATOR_ID, o as postgresTargetDescriptorMetaRuntime, r as TIMETZ_NOW_GENERATOR_ID, t as TIMESTAMPTZ_STRING_NOW_GENERATOR_ID } from \"./date-time-now-generators-BORO1_nc.mjs\";\nimport { n as postgresIndexTypes } from \"./index-types-DGrgbAd4.mjs\";\nimport { createDataTypeLookup } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { idGeneratorFunctionBindings, sqlIntegerArgumentGeneratorFunctions } from \"@internal/family-sql/pack\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, authoringTypeConstructorArguments } from \"@internal/framework-components/authoring\";\nimport { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from \"@internal/type-implementations/now\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { inferredTypeConstructors } from \"@internal/family-sql/psl-build\";\n//#region src/core/now-generators.ts\n/** The \"now\" generator for each codec that has one. The `now` generator function binds it. */\nconst postgresNowGeneratorIds = {\n\t[PG_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,\n\t[PG_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,\n\t[PG_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID,\n\t[PG_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMETZ_CODEC_ID]: TIMETZ_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: TIMESTAMP_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: TIMESTAMPTZ_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_INSTANT_CODEC_ID]: INSTANT_NOW_GENERATOR_ID\n};\nnew Map(Object.entries(postgresNowGeneratorIds));\n/** The codecs whose \"now\" generator takes the column's precision and rounds down to it, so PostgreSQL stores the value the client holds rather than rounding it up, which for a time can reach `24:00:00`. */\nconst postgresNowGeneratorTakesPrecision = {\n\t[PG_TIME_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIME_STRING_CODEC_ID]: true,\n\t[PG_TIMETZ_CODEC_ID]: true,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: true,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: true,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: true,\n\t[PG_TIMESTAMP_DATE_CODEC_ID]: true,\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIMESTAMP_INSTANT_CODEC_ID]: true\n};\n/** The `now` generator function bound to each Postgres date and time codec, with the column's precision on the codecs that take it. */\nconst postgresNowGeneratorFunction = {\n\tname: \"now\",\n\tbindings: Object.entries(postgresNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({\n\t\tcodecIds: [codecId],\n\t\tgeneratorId,\n\t\tparamsFromField: (column) => {\n\t\t\tconst precision = column.typeParams?.[\"precision\"];\n\t\t\treturn Object.hasOwn(postgresNowGeneratorTakesPrecision, codecId) && typeof precision === \"number\" ? { precision } : void 0;\n\t\t}\n\t}))\n};\n//#endregion\n//#region src/core/generator-functions.ts\nconst postgresGeneratorFunctions = [\n\t...sqlIntegerArgumentGeneratorFunctions({ integer: pgInt4.id }),\n\tpostgresNowGeneratorFunction,\n\t...idGeneratorFunctionBindings({\n\t\ttext: [\n\t\t\tPG_CHAR_CODEC_ID,\n\t\t\tPG_VARCHAR_CODEC_ID,\n\t\t\tPG_TEXT_CODEC_ID\n\t\t],\n\t\tuuid: [PG_UUID_CODEC_ID]\n\t})\n];\n/** The `now` generators Postgres binds. The SQL family registers the identifier generators. */\nconst postgresGeneratorDescriptors = [{ id: TIMESTAMP_NOW_GENERATOR_ID }, ...postgresNowGeneratorControlDescriptors()];\n//#endregion\n//#region src/core/prisma7-type-map.ts\nconst of = (type, params = {}) => ({\n\tdataType: type.id,\n\tparams\n});\n/**\n* What Prisma 7.10.0 creates in Postgres for each Prisma 7 scalar and `@db.*` native type, as a data type and its parameters. Derived from the SQL recorded in `test/integration/test/fixtures/prisma7-source/reference/migration.sql`. A `@db.*` attribute's own arguments replace the parameters; without any, the column gets these, so `@db.Char` is the `character(1)` Postgres stores for Prisma 7's `CHAR`, and `@db.Bit` the `bit(1)` it stores for `BIT`.\n*/\nconst prisma7PostgresTypes = {\n\tscalars: {\n\t\tString: of(pgText),\n\t\tBoolean: of(pgBool),\n\t\tInt: of(pgInt4),\n\t\tBigInt: of(pgInt8),\n\t\tFloat: of(pgFloat8),\n\t\tDecimal: of(pgNumeric, {\n\t\t\tprecision: 65,\n\t\t\tscale: 30\n\t\t}),\n\t\tDateTime: of(pgTimestamp, { precision: 3 }),\n\t\tJson: of(pgJsonb),\n\t\tBytes: of(pgBytea)\n\t},\n\tnativeTypes: {\n\t\tText: of(pgText),\n\t\tVarChar: of(pgVarchar),\n\t\tChar: of(pgChar, { length: 1 }),\n\t\tUuid: of(pgUuid),\n\t\tInet: of(pgInet),\n\t\tBoolean: of(pgBool),\n\t\tInteger: of(pgInt4),\n\t\tSmallInt: of(pgInt2),\n\t\tBigInt: of(pgInt8),\n\t\tReal: of(pgFloat4),\n\t\tDoublePrecision: of(pgFloat8),\n\t\tDecimal: of(pgNumeric),\n\t\tTimestamp: of(pgTimestamp),\n\t\tTimestamptz: of(pgTimestamptz),\n\t\tDate: of(pgDate),\n\t\tTime: of(pgTime),\n\t\tTimetz: of(pgTimetz),\n\t\tJson: of(pgJson),\n\t\tJsonB: of(pgJsonb),\n\t\tByteA: of(pgBytea),\n\t\tBit: of(pgBit, { length: 1 }),\n\t\tVarBit: of(pgVarbit),\n\t\tXml: of(pgXml),\n\t\tOid: of(pgOid),\n\t\tMoney: of(pgMoney)\n\t}\n};\nconst marked = inferredTypeConstructors({\n\tauthoringTypes: postgresScalarTypes,\n\tcodecLookup: postgresCodecDescriptorRegistry,\n\tdataTypeLookup: createDataTypeLookup(postgresDataTypes)\n});\n/**\n* The constructor marked `inferred` for the column's data type, with every parameter Prisma 7 gives the column as an argument. The reader builds a contract, so it keeps each parameter rather than the fewest arguments printed PSL writes.\n*/\nfunction mappingOf({ dataType, params }) {\n\tconst markedConstructor = marked.get(dataType);\n\tconst args = markedConstructor === void 0 ? void 0 : authoringTypeConstructorArguments(markedConstructor.descriptor, {\n\t\tcodecId: markedConstructor.descriptor.output.codecId,\n\t\ttypeParams: params\n\t});\n\tif (markedConstructor === void 0 || args === void 0) throw new InternalError(`No constructor marked inferred writes ${dataType} with these parameters.`);\n\treturn {\n\t\tconstructorPath: markedConstructor.path,\n\t\targs\n\t};\n}\nfunction mappingsOf(types) {\n\treturn Object.fromEntries(Object.entries(types).map(([name, type]) => [name, mappingOf(type)]));\n}\n/** {@link prisma7PostgresTypes} as the Prisma 7 reader takes it: each type's constructor call. */\nconst prisma7PostgresTypeMap = {\n\tscalars: mappingsOf(prisma7PostgresTypes.scalars),\n\tnativeTypes: mappingsOf(prisma7PostgresTypes.nativeTypes),\n\textensionNativeTypes: { Citext: {\n\t\tconstructorPath: [\"citext\", \"Citext\"],\n\t\targs: [],\n\t\textension: \"citext\"\n\t} }\n};\n/** The Prisma 7 `@db.*` names whose Prisma 8 constructor has another name, such as `Text` to `String`. */\nconst prisma7PostgresRenamedNativeTypes = Object.fromEntries(Object.entries({\n\t...prisma7PostgresTypeMap.nativeTypes,\n\t...prisma7PostgresTypeMap.extensionNativeTypes\n}).flatMap(([name, { constructorPath }]) => {\n\tconst constructorName = constructorPath.join(\".\");\n\treturn constructorName === name ? [] : [[name, constructorName]];\n}));\nconst postgresTargetDescriptorMeta = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID,\n\tsupportsNamespaces: true,\n\tdisplayName: \"Postgres\",\n\tindexTypes: postgresIndexTypes,\n\tauthoring: {\n\t\ttype: {\n\t\t\t...postgresScalarTypes,\n\t\t\t...postgresAuthoringTypes\n\t\t},\n\t\tdataTypes: postgresDataTypeEntries(),\n\t\ttextDataTypes: postgresTextDataTypes,\n\t\trenamedTypeConstructors: prisma7PostgresRenamedNativeTypes,\n\t\tentityTypes: postgresAuthoringEntityTypes,\n\t\tpslBlockDescriptors: postgresAuthoringPslBlockDescriptors,\n\t\tmodelAttributes: postgresAuthoringModelAttributes,\n\t\tcreateNamespace: postgresCreateNamespace,\n\t\tqualifyColumnType: postgresQualifyColumnType,\n\t\trenderCheckExpressions: postgresRenderCheckExpressions,\n\t\tlowerEntityHandles: postgresLowerEntityHandles\n\t},\n\tgeneratorFunctions: postgresGeneratorFunctions,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: postgresGeneratorDescriptors\n\t},\n\ttypes: { queryOperationTypes: { import: {\n\t\tpackage: \"@internal/target-postgres/operation-types\",\n\t\tnamed: \"QueryOperationTypes\",\n\t\talias: \"PgTargetQueryOps\"\n\t} } }\n};\n//#endregion\nexport { prisma7PostgresTypeMap as n, postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-xBYwG7xG.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,0BAA0B;EAC9B,4BAA4B;EAC5B,0BAA0B;EAC1B,4BAA4B;EAC5B,0BAA0B;EAC1B,qBAAqB;EACrB,iCAAiC;EACjC,+BAA+B;EAC/B,mCAAmC;EACnC,iCAAiC;EACjC,+BAA+B;EAC/B,6BAA6B;EAC7B,gCAAgC;AAClC;AACA,IAAI,IAAI,OAAO,QAAQ,uBAAuB,CAAC;;AAE/C,MAAM,qCAAqC;EACzC,4BAA4B;EAC5B,0BAA0B;EAC1B,qBAAqB;EACrB,+BAA+B;EAC/B,iCAAiC;EACjC,+BAA+B;EAC/B,6BAA6B;EAC7B,iCAAiC;EACjC,mCAAmC;EACnC,gCAAgC;AAClC;;AAEA,MAAM,+BAA+B;CACpC,MAAM;CACN,UAAU,OAAO,QAAQ,uBAAuB,CAAC,CAAC,KAAK,CAAC,SAAS,iBAAiB,uBAAuB;EACxG,UAAU,CAAC,OAAO;EAClB;EACA,kBAAkB,WAAW;GAC5B,MAAM,YAAY,OAAO,aAAa;GACtC,OAAO,OAAO,OAAO,oCAAoC,OAAO,KAAK,OAAO,cAAc,WAAW,EAAE,UAAU,IAAI,KAAK;EAC3H;CACD,CAAC,CAAC;AACH;AAGA,MAAM,6BAA6B;CAClC,GAAG,qCAAqC,EAAE,SAAS,OAAO,GAAG,CAAC;CAC9D;CACA,GAAG,4BAA4B;EAC9B,MAAM;GACL;GACA;GACA;EACD;EACA,MAAM,CAAC,gBAAgB;CACxB,CAAC;AACF;;AAEA,MAA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EACxB,oBAAoB;CACrB;CACA,oBAAoB;CACpB,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB;CACvB;CACA,OAAO,EAAE,qBAAqB,EAAE,QAAQ;EACvC,SAAS;EACT,OAAO;EACP,OAAO;CACR,EAAE,EAAE;AACL"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { u as postgresError } from "./errors-
|
|
2
|
-
import { n as FULL_TEXT_INDEX_TYPE, s as fullTextIndexDefinitionOf } from "./full-text-index-definition-
|
|
3
|
-
import { m as isPostgresSchema } from "./postgres-schema-
|
|
4
|
-
import { t as postgresAccessMethodOf } from "./index-types-
|
|
1
|
+
import { u as postgresError } from "./errors-C4-Dp3gI-B5jY5eJj.mjs";
|
|
2
|
+
import { n as FULL_TEXT_INDEX_TYPE, s as fullTextIndexDefinitionOf } from "./full-text-index-definition-DzRCaPjb-0USKN1ZI.mjs";
|
|
3
|
+
import { m as isPostgresSchema } from "./postgres-schema-zd_p5Lg2-BdJlG7Cg.mjs";
|
|
4
|
+
import { t as postgresAccessMethodOf } from "./index-types-DGrgbAd4-DuGWdvol.mjs";
|
|
5
5
|
import { i as PostgresTableSchemaNode, n as PostgresNativeEnumSchemaNode, r as PostgresSchemaNodeKind, s as postgresDiffSubjectGranularity, t as PostgresExtensionSchemaNode } from "./postgres-table-schema-node-OQRI_GIM-DhOVxH8-.mjs";
|
|
6
6
|
import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-yFPLQ6U0-ZCPXs-lG.mjs";
|
|
7
7
|
import { t as postgresResolveDefault } from "./default-normalizer-BqK6XxdC-2OUb2ybG.mjs";
|
|
8
|
-
import { n as renderFullTextIndexDocument } from "./full-text-search-document-
|
|
9
|
-
import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-
|
|
10
|
-
import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-
|
|
8
|
+
import { n as renderFullTextIndexDocument } from "./full-text-search-document-BqqvjJoC-HaoeMaM5.mjs";
|
|
9
|
+
import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-ChjIoY0I-D7TWkRXc.mjs";
|
|
10
|
+
import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-DKnVhEWD-xuJIvCy9.mjs";
|
|
11
11
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
12
12
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
13
13
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -16,7 +16,7 @@ import { namingOf } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
|
16
16
|
import { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from "@prisma/orm-family-sql/schema-ir/types";
|
|
17
17
|
import { contractNamespaceToSchemaIR, sqlTypeLookupsOf } from "@prisma/orm-family-sql/family/control";
|
|
18
18
|
import { classifyDiffSubjectGranularity } from "@prisma/orm-family-sql/family/diff";
|
|
19
|
-
//#region ../../../3-targets/postgres/1-target/dist/diff-database-schema-
|
|
19
|
+
//#region ../../../3-targets/postgres/1-target/dist/diff-database-schema-J96mtg_F.mjs
|
|
20
20
|
/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */
|
|
21
21
|
function databaseStep() {
|
|
22
22
|
return {
|
|
@@ -432,4 +432,4 @@ function buildPostgresPlanDiff(input) {
|
|
|
432
432
|
//#endregion
|
|
433
433
|
export { contractToPostgresDatabaseSchemaNode as n, diffPostgresSchema as r, buildPostgresPlanDiff as t };
|
|
434
434
|
|
|
435
|
-
//# sourceMappingURL=diff-database-schema-
|
|
435
|
+
//# sourceMappingURL=diff-database-schema-J96mtg_F-BHpzbMoj.mjs.map
|