@prisma/orm-target-postgres 8.0.0-rc.24-dev.40 → 8.0.0-rc.24-dev.42
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-VDAs5CMq-OezO60C5.mjs → adapter-CHlJgR4S-CLUPSnvo.mjs} +3 -3
- package/dist/{adapter-VDAs5CMq-OezO60C5.mjs.map → adapter-CHlJgR4S-CLUPSnvo.mjs.map} +1 -1
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__control.mjs +2 -2
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{authoring-4dCWsSXg-DeIEoQWg.mjs → authoring-ZsHi4vLr-qbZ1hNzY.mjs} +3 -3
- package/dist/{authoring-4dCWsSXg-DeIEoQWg.mjs.map → authoring-ZsHi4vLr-qbZ1hNzY.mjs.map} +1 -1
- package/dist/{contract-contributions-DG0aJRRu-31YCQkp-.mjs → contract-contributions-BB4GLsqV-DRI0-5Oy.mjs} +19 -10
- package/dist/contract-contributions-BB4GLsqV-DRI0-5Oy.mjs.map +1 -0
- package/dist/{contract-free-dQ4A6kPg.mjs → contract-free-C74Twi_E.mjs} +3 -3
- package/dist/{contract-free-dQ4A6kPg.mjs.map → contract-free-C74Twi_E.mjs.map} +1 -1
- package/dist/{control-policy-Crcjg7Vz-39_fO8yR.mjs → control-policy-Ckz2Fs57-C98YTOWU.mjs} +21 -8
- package/dist/control-policy-Ckz2Fs57-C98YTOWU.mjs.map +1 -0
- package/dist/{ddl-Cy_8QS23-D9EVihrI.mjs → ddl-BcqT3JRx-Dz0WRW0c.mjs} +3 -3
- package/dist/{ddl-Cy_8QS23-D9EVihrI.mjs.map → ddl-BcqT3JRx-Dz0WRW0c.mjs.map} +1 -1
- package/dist/{descriptor-meta-DwXEu6Ap-qDhyaRK4.mjs → descriptor-meta-CqWmMocA-D_Sj3QrO.mjs} +3 -3
- package/dist/{descriptor-meta-DwXEu6Ap-qDhyaRK4.mjs.map → descriptor-meta-CqWmMocA-D_Sj3QrO.mjs.map} +1 -1
- package/dist/{descriptor-meta-CakMYWwZ-DSQNCwWB.mjs → descriptor-meta-D49elEeZ-Bx0EB8FX.mjs} +4 -4
- package/dist/{descriptor-meta-CakMYWwZ-DSQNCwWB.mjs.map → descriptor-meta-D49elEeZ-Bx0EB8FX.mjs.map} +1 -1
- package/dist/{diff-database-schema-CVmwyjFf-DSWPpd4M.mjs → diff-database-schema-LHXykgph-DoYVYqfq.mjs} +15 -20
- package/dist/diff-database-schema-LHXykgph-DoYVYqfq.mjs.map +1 -0
- package/dist/{infer-psl-contract-DgQutzGt-C1wN72ZC.mjs → infer-psl-contract-C12P-2OG-ChFgcM6f.mjs} +14 -5
- package/dist/infer-psl-contract-C12P-2OG-ChFgcM6f.mjs.map +1 -0
- package/dist/migration-Be_iuIpn.mjs.map +1 -1
- package/dist/{op-factory-call-DvezqqJx-KBDyNT08.mjs → op-factory-call-BQOeT_F--DpdYzN0o.mjs} +5 -5
- package/dist/{op-factory-call-DvezqqJx-KBDyNT08.mjs.map → op-factory-call-BQOeT_F--DpdYzN0o.mjs.map} +1 -1
- package/dist/{pack-Cg6Jolu1.d.mts → pack-DshiZKVJ.d.mts} +2 -2
- package/dist/{pack-Cg6Jolu1.d.mts.map → pack-DshiZKVJ.d.mts.map} +1 -1
- package/dist/{planner-D2T46plG-BChGUTOA.mjs → planner-UNJid9ms-DiphUfCo.mjs} +12 -12
- package/dist/planner-UNJid9ms-DiphUfCo.mjs.map +1 -0
- package/dist/{planner-produced-postgres-migration-BLKk9Vaz-CsUhcKp1.mjs → planner-produced-postgres-migration-0n4ABKFA-Cu07sYKL.mjs} +5 -5
- package/dist/{planner-produced-postgres-migration-BLKk9Vaz-CsUhcKp1.mjs.map → planner-produced-postgres-migration-0n4ABKFA-Cu07sYKL.mjs.map} +1 -1
- package/dist/{planner-sql-checks-CzxowQml-moHPNh20.mjs → planner-sql-checks-DE7POy4E-BAVOBp_Q.mjs} +3 -3
- package/dist/{planner-sql-checks-CzxowQml-moHPNh20.mjs.map → planner-sql-checks-DE7POy4E-BAVOBp_Q.mjs.map} +1 -1
- package/dist/{postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs → postgres-contract-view-CCbDZeIo-CK9z1Hw9.mjs} +4 -4
- package/dist/{postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs.map → postgres-contract-view-CCbDZeIo-CK9z1Hw9.mjs.map} +1 -1
- package/dist/{postgres-migration-DEa-g6j1-CoG3QOV3.mjs → postgres-migration-BZ4z5KJ6-Cmya-r8H.mjs} +12 -12
- package/dist/postgres-migration-BZ4z5KJ6-Cmya-r8H.mjs.map +1 -0
- package/dist/{postgres-schema-CIfq1AjC-CGiMjtSX.mjs → postgres-schema-BaGmKymi-WHJQsmeb.mjs} +8 -3
- package/dist/postgres-schema-BaGmKymi-WHJQsmeb.mjs.map +1 -0
- package/dist/{prisma7-binding-D9BabHMI.d.mts → prisma7-binding-BqClsmwa.d.mts} +2 -2
- package/dist/{prisma7-binding-D9BabHMI.d.mts.map → prisma7-binding-BqClsmwa.d.mts.map} +1 -1
- package/dist/{prisma7-binding-BRPindAK.mjs → prisma7-binding-D9c8koix.mjs} +4 -4
- package/dist/{prisma7-binding-BRPindAK.mjs.map → prisma7-binding-D9c8koix.mjs.map} +1 -1
- package/dist/{render-ops-Bl1R5cz0-CFshOROt.mjs → render-ops-Owjb6xFw-ClGtnwWZ.mjs} +3 -3
- package/dist/{render-ops-Bl1R5cz0-CFshOROt.mjs.map → render-ops-Owjb6xFw-ClGtnwWZ.mjs.map} +1 -1
- package/dist/{render-typescript-B-Igkk6D-CQ-WlBmb.mjs → render-typescript-kNKf8www-Cyz2V7o5.mjs} +3 -3
- package/dist/{render-typescript-B-Igkk6D-CQ-WlBmb.mjs.map → render-typescript-kNKf8www-Cyz2V7o5.mjs.map} +1 -1
- package/dist/{resolve-ddl-schema-C2KTxEX3-D8Jd9Rx1.mjs → resolve-ddl-schema-DjC64uGi-CDs0tX1m.mjs} +3 -3
- package/dist/{resolve-ddl-schema-C2KTxEX3-D8Jd9Rx1.mjs.map → resolve-ddl-schema-DjC64uGi-CDs0tX1m.mjs.map} +1 -1
- package/dist/runtime-BArZXVRj.mjs.map +1 -1
- package/dist/target.d.mts +2 -2
- package/dist/target.mjs +18 -18
- package/dist/target__contract-free.mjs +3 -3
- package/dist/target__control.mjs +10 -10
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +1 -1
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-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.d.mts +1 -1
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__render-typescript.mjs +1 -1
- package/dist/target__runtime.mjs +1 -1
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__types.mjs +1 -1
- package/package.json +10 -10
- package/dist/contract-contributions-DG0aJRRu-31YCQkp-.mjs.map +0 -1
- package/dist/control-policy-Crcjg7Vz-39_fO8yR.mjs.map +0 -1
- package/dist/diff-database-schema-CVmwyjFf-DSWPpd4M.mjs.map +0 -1
- package/dist/infer-psl-contract-DgQutzGt-C1wN72ZC.mjs.map +0 -1
- package/dist/planner-D2T46plG-BChGUTOA.mjs.map +0 -1
- package/dist/postgres-migration-DEa-g6j1-CoG3QOV3.mjs.map +0 -1
- package/dist/postgres-schema-CIfq1AjC-CGiMjtSX.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-ops-
|
|
1
|
+
{"version":3,"file":"render-ops-Owjb6xFw-ClGtnwWZ.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/render-ops-Owjb6xFw.mjs"],"sourcesContent":["import { u as postgresError } from \"./errors-DxWL0CMX.mjs\";\nimport { X as isPostgresOpFactoryCall } from \"./op-factory-call-BQOeT_F-.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isThenable } from \"@internal/utils/promise\";\n//#region src/core/migrations/render-ops.ts\n/**\n* Asserts an op materialised by an `OpFactoryCall` targets postgres. The\n* extension surface lets any contributor emit calls, so this is the\n* integration boundary where a stray non-postgres op would otherwise\n* silently flow through to postgres-shaped renderers — exactly the\n* place to fail loudly with op metadata (`id` + `target.id`).\n*/\nfunction assertPostgresOp(op, callFactoryName) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== \"postgres\") throw postgresError(\"MIGRATION.TARGET_MISMATCH\", `renderOps: expected postgres op but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${callFactoryName}\"). An OpFactoryCall produced an op for a different target on the postgres planner path; check the call's target binding.`, { meta: {\n\t\topId: op.id,\n\t\ttargetId: String(targetId),\n\t\tfactoryName: callFactoryName\n\t} });\n}\nfunction checkedOp(opOrPromise, callFactoryName) {\n\tif (isThenable(opOrPromise)) {\n\t\tconst checked = opOrPromise.then((op) => {\n\t\t\tassertPostgresOp(op, callFactoryName);\n\t\t\treturn op;\n\t\t});\n\t\tchecked.catch(() => void 0);\n\t\treturn checked;\n\t}\n\tassertPostgresOp(opOrPromise, callFactoryName);\n\treturn opOrPromise;\n}\nfunction renderOps(calls, lowerer) {\n\treturn calls.flatMap((c) => {\n\t\treturn (isPostgresOpFactoryCall(c) ? c.toOps(lowerer) : [blindCast(c).toOp(lowerer)]).map((opOrPromise) => checkedOp(opOrPromise, c.factoryName));\n\t});\n}\n//#endregion\nexport { renderOps as t };\n\n//# sourceMappingURL=render-ops-Owjb6xFw.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,iBAAiB,IAAI,iBAAiB;CAC9C,MAAM,WAAW,UAAU,EAAE,CAAC,CAAC,QAAQ;CACvC,IAAI,aAAa,YAAY,MAAM,cAAc,6BAA6B,sDAAsD,OAAO,QAAQ,EAAE,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,4HAA4H,EAAE,MAAM;EAC/U,MAAM,GAAG;EACT,UAAU,OAAO,QAAQ;EACzB,aAAa;CACd,EAAE,CAAC;AACJ;AACA,SAAS,UAAU,aAAa,iBAAiB;CAChD,IAAI,WAAW,WAAW,GAAG;EAC5B,MAAM,UAAU,YAAY,MAAM,OAAO;GACxC,iBAAiB,IAAI,eAAe;GACpC,OAAO;EACR,CAAC;EACD,QAAQ,YAAY,KAAK,CAAC;EAC1B,OAAO;CACR;CACA,iBAAiB,aAAa,eAAe;CAC7C,OAAO;AACR;AACA,SAAS,UAAU,OAAO,SAAS;CAClC,OAAO,MAAM,SAAS,MAAM;EAC3B,QAAQ,wBAAwB,CAAC,IAAI,EAAE,MAAM,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,EAAA,CAAG,KAAK,gBAAgB,UAAU,aAAa,EAAE,WAAW,CAAC;CACjJ,CAAC;AACF"}
|
package/dist/{render-typescript-B-Igkk6D-CQ-WlBmb.mjs → render-typescript-kNKf8www-Cyz2V7o5.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { M as MIGRATION_MODULE } from "./op-factory-call-
|
|
1
|
+
import { M as MIGRATION_MODULE } from "./op-factory-call-BQOeT_F--DpdYzN0o.mjs";
|
|
2
2
|
import { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier } from "@prisma/orm-framework/components/control";
|
|
3
3
|
import { renderImports } from "@prisma/orm-framework/ts-render";
|
|
4
4
|
import { detectScaffoldRuntime, shebangLineFor } from "@prisma/orm-toolchain/migration-tools/migration-ts";
|
|
5
|
-
//#region ../../../3-targets/postgres/1-target/dist/render-typescript-
|
|
5
|
+
//#region ../../../3-targets/postgres/1-target/dist/render-typescript-kNKf8www.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Polymorphic TypeScript emitter for the Postgres migration IR.
|
|
8
8
|
*
|
|
@@ -99,4 +99,4 @@ function indent(text, spaces) {
|
|
|
99
99
|
//#endregion
|
|
100
100
|
export { renderCallsToTypeScript as t };
|
|
101
101
|
|
|
102
|
-
//# sourceMappingURL=render-typescript-
|
|
102
|
+
//# sourceMappingURL=render-typescript-kNKf8www-Cyz2V7o5.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-typescript-
|
|
1
|
+
{"version":3,"file":"render-typescript-kNKf8www-Cyz2V7o5.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/render-typescript-kNKf8www.mjs"],"sourcesContent":["import { M as MIGRATION_MODULE } from \"./op-factory-call-BQOeT_F-.mjs\";\nimport { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier } from \"@internal/framework-components/control\";\nimport { renderImports } from \"@internal/ts-render\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\n//#region src/core/migrations/render-typescript.ts\n/**\n* Polymorphic TypeScript emitter for the Postgres migration IR.\n*\n* Each `OpFactoryCall` renders itself via `renderTypeScript()` and\n* declares its own `importRequirements()`; this file just composes the module\n* source around those contributions. The design mirrors the Mongo target's\n* `render-typescript.ts` deliberately — byte-for-byte alignment isn't required\n* (different factory module specifiers, different base-class name) but the\n* shape is, so future consolidation to a framework-level helper is mechanical.\n*/\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: MIGRATION_MODULE,\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: MIGRATION_MODULE,\n\tsymbol: \"MigrationCLI\"\n}];\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => renderCall(c)).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`export default class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction renderCall(call) {\n\treturn call.renderTypeScript();\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(requirements.map((requirement) => requirement.moduleSpecifier === \"<migrations.module>\" ? {\n\t\t...requirement,\n\t\tmoduleSpecifier: meta.migrationModule\n\t} : requirement));\n}\n/**\n* The committed contract-JSON imports the scaffold reads its from/to identity\n* from, resolved to the deduplicated snapshot store under\n* `meta.snapshotsImportPath`. The end snapshot is always present; the start\n* snapshot is added only for a non-baseline migration (`meta.from !== null`).\n* The matching `Contract` type imports (aliased `Start`/`End`) feed the\n* `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with\n* no start imports — `never` is the honest \"no prior contract\" Start.\n*/\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\nexport { renderCallsToTypeScript as t };\n\n//# sourceMappingURL=render-typescript-kNKf8www.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,eAAe,CAAC;CACrB,iBAAiB;CACjB,QAAQ;AACT,GAAG;CACF,iBAAiB;CACjB,QAAQ;AACT,CAAC;AACD,SAAS,wBAAwB,OAAO,MAAM;CAC7C,MAAM,UAAU,aAAa,OAAO,IAAI;CACxC,MAAM,iBAAiB,MAAM,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK;CACjE,MAAM,WAAW,KAAK,SAAS;CAC/B,MAAM,aAAa,WAAW,CAAC,wDAAwD,IAAI,CAAC;CAC5F,OAAO;EACN,eAAe,sBAAsB,CAAC;EACtC;EACA;EACA,4CAA4C,WAAW,UAAU,QAAQ;EACzE,GAAG;EACH;EACA;EACA;EACA;EACA,OAAO,gBAAgB,CAAC;EACxB;EACA;EACA;EACA;EACA;EACA;CACD,CAAC,CAAC,KAAK,IAAI;AACZ;AACA,SAAS,WAAW,MAAM;CACzB,OAAO,KAAK,iBAAiB;AAC9B;AACA,SAAS,aAAa,OAAO,MAAM;CAClC,MAAM,eAAe,CAAC,GAAG,cAAc,GAAG,gBAAgB,IAAI,CAAC;CAC/D,KAAK,MAAM,QAAQ,OAAO,KAAK,MAAM,OAAO,KAAK,mBAAmB,GAAG,aAAa,KAAK,GAAG;CAC5F,OAAO,cAAc,aAAa,KAAK,gBAAgB,YAAY,oBAAoB,wBAAwB;EAC9G,GAAG;EACH,iBAAiB,KAAK;CACvB,IAAI,WAAW,CAAC;AACjB;;;;;;;;;;AAUA,SAAS,gBAAgB,MAAM;CAC9B,MAAM,OAAO,CAAC;EACb,iBAAiB,8BAA8B,KAAK,qBAAqB,KAAK,EAAE;EAChF,QAAQ;EACR,MAAM;EACN,YAAY,EAAE,MAAM,OAAO;CAC5B,GAAG;EACF,iBAAiB,+BAA+B,KAAK,qBAAqB,KAAK,EAAE;EACjF,QAAQ;EACR,OAAO;EACP,UAAU;CACX,CAAC;CACD,IAAI,KAAK,SAAS,MAAM;EACvB,KAAK,KAAK;GACT,iBAAiB,8BAA8B,KAAK,qBAAqB,KAAK,IAAI;GAClF,QAAQ;GACR,MAAM;GACN,YAAY,EAAE,MAAM,OAAO;EAC5B,CAAC;EACD,KAAK,KAAK;GACT,iBAAiB,+BAA+B,KAAK,qBAAqB,KAAK,IAAI;GACnF,QAAQ;GACR,OAAO;GACP,UAAU;EACX,CAAC;CACF;CACA,OAAO;AACR;AACA,SAAS,OAAO,MAAM,QAAQ;CAC7B,MAAM,MAAM,IAAI,OAAO,MAAM;CAC7B,OAAO,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,SAAS,KAAK,KAAK,IAAI,GAAG,MAAM,SAAS,IAAI,CAAC,CAAC,KAAK,IAAI;AACtF"}
|
package/dist/{resolve-ddl-schema-C2KTxEX3-D8Jd9Rx1.mjs → resolve-ddl-schema-DjC64uGi-CDs0tX1m.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cxc0dBbO.mjs";
|
|
2
|
-
import { m as isPostgresSchema } from "./postgres-schema-
|
|
2
|
+
import { m as isPostgresSchema } from "./postgres-schema-BaGmKymi-WHJQsmeb.mjs";
|
|
3
3
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
4
|
-
//#region ../../../3-targets/postgres/1-target/dist/resolve-ddl-schema-
|
|
4
|
+
//#region ../../../3-targets/postgres/1-target/dist/resolve-ddl-schema-DjC64uGi.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Given the contract's storage and a namespace id, returns the live Postgres DDL schema name that namespace maps to. A named Postgres namespace dispatches to its `ddlSchemaName(storage)`; the unbound sentinel resolves to `DEFAULT_NAMESPACE_ID`, the schema an unqualified table lands in under the default search path; a bare object payload (used by some tests) falls back to the namespace id itself. An extension in the unbound namespace does not go through here: it has no fixed schema, and verification finds it through the connection's search path (ADR 321).
|
|
7
7
|
*/
|
|
@@ -26,4 +26,4 @@ function ddlSchemaOfCallSchema(callSchemaName) {
|
|
|
26
26
|
//#endregion
|
|
27
27
|
export { emissionSchemaForNamespace as n, resolveDdlSchemaForNamespaceStorage as r, ddlSchemaOfCallSchema as t };
|
|
28
28
|
|
|
29
|
-
//# sourceMappingURL=resolve-ddl-schema-
|
|
29
|
+
//# sourceMappingURL=resolve-ddl-schema-DjC64uGi-CDs0tX1m.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-ddl-schema-
|
|
1
|
+
{"version":3,"file":"resolve-ddl-schema-DjC64uGi-CDs0tX1m.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/resolve-ddl-schema-DjC64uGi.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-BaGmKymi.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/resolve-ddl-schema.ts\n/**\n* Given the contract's storage and a namespace id, returns the live Postgres DDL schema name that namespace maps to. A named Postgres namespace dispatches to its `ddlSchemaName(storage)`; the unbound sentinel resolves to `DEFAULT_NAMESPACE_ID`, the schema an unqualified table lands in under the default search path; a bare object payload (used by some tests) falls back to the namespace id itself. An extension in the unbound namespace does not go through here: it has no fixed schema, and verification finds it through the connection's search path (ADR 321).\n*/\nfunction resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {\n\tif (namespaceId === UNBOUND_NAMESPACE_ID) return DEFAULT_NAMESPACE_ID;\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace && isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n/**\n* The schema name a planned call carries for a namespace: the unbound sentinel stays as it is, so the call renders without a schema, and a named namespace resolves to its DDL schema.\n*/\nfunction emissionSchemaForNamespace(contract, namespaceId) {\n\treturn namespaceId === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : resolveDdlSchemaForNamespaceStorage(contract.storage, namespaceId);\n}\n/**\n* The live DDL schema a call's schema name stands for: the unbound sentinel is `DEFAULT_NAMESPACE_ID`, and any other name is already a DDL schema.\n*/\nfunction ddlSchemaOfCallSchema(callSchemaName) {\n\treturn callSchemaName === UNBOUND_NAMESPACE_ID ? DEFAULT_NAMESPACE_ID : callSchemaName;\n}\n//#endregion\nexport { emissionSchemaForNamespace as n, resolveDdlSchemaForNamespaceStorage as r, ddlSchemaOfCallSchema as t };\n\n//# sourceMappingURL=resolve-ddl-schema-DjC64uGi.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,oCAAoC,SAAS,aAAa;CAClE,IAAI,gBAAgB,sBAAsB,OAAO;CACjD,MAAM,YAAY,QAAQ,WAAW;CACrC,IAAI,aAAa,iBAAiB,SAAS,GAAG,OAAO,UAAU,cAAc,OAAO;CACpF,OAAO;AACR;;;;AAIA,SAAS,2BAA2B,UAAU,aAAa;CAC1D,OAAO,gBAAgB,uBAAuB,uBAAuB,oCAAoC,SAAS,SAAS,WAAW;AACvI;;;;AAIA,SAAS,sBAAsB,gBAAgB;CAC9C,OAAO,mBAAmB,uBAAuB,uBAAuB;AACzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-BArZXVRj.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/runtime.mjs"],"sourcesContent":["import { I as PG_TSQUERY_CODEC_ID, T as PG_TEXT_CODEC_ID, c as PG_FLOAT4_CODEC_ID, n as PG_BOOL_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { u as postgresError } from \"./errors-DxWL0CMX.mjs\";\nimport { A as decodePostgresListText } from \"./codecs-B2C2j2Un.mjs\";\nimport { a as fullTextIndexOptions, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-MMcQF3_0.mjs\";\nimport { a as postgresNowGenerators, o as postgresTargetDescriptorMetaRuntime } from \"./date-time-now-generators-DylEKfQR.mjs\";\nimport { t as renderFullTextDocument } from \"./full-text-search-document-B5VCeQFz.mjs\";\nimport { n as PostgresContractSerializer, t as PostgresContractView } from \"./postgres-contract-view-DhDzWNCN.mjs\";\nimport { a as headlineOptionsLiteral, c as FullTextDocument, i as websearchToTsquery, n as plaintoTsquery, o as languageLiteral, r as toTsquery, s as normalizationLiteral, t as phrasetoTsquery } from \"./full-text-parsers-m8GS0pst.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { buildOperation, isExpression, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { uniqueIndexNamesOfType } from \"@internal/sql-relational-core/index-reference\";\n//#region src/core/full-text-collection-method.ts\nfunction indexFunction(tools, name) {\n\treturn blindCast(tools.fns[name]);\n}\nfunction fullTextMethod(indexName) {\n\treturn (collection, ...args) => collection.where((_model, tools) => indexFunction(tools, \"fullTextMatches\")(tools.indexes[indexName], ...args)).orderBy((_model, tools) => indexFunction(tools, \"fullTextRank\")(tools.indexes[indexName], ...args).desc());\n}\n/** The run-time half of `PostgresFullTextMethods`. */\nconst postgresFullTextMethods = {\n\tid: \"postgres/fullText\",\n\tmethodsFor: (model) => Object.fromEntries(uniqueIndexNamesOfType(model.table.indexes, FULL_TEXT_INDEX_TYPE).map((name) => [name, fullTextMethod(name)]))\n};\n//#endregion\n//#region src/core/query-operations.ts\nconst TEXT_REF = { codecId: PG_TEXT_CODEC_ID };\nconst TSQUERY_REF = { codecId: PG_TSQUERY_CODEC_ID };\nconst languageOf = (options) => options.language ?? \"english\";\nfunction isIndexReference(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value) && !isExpression(value) && \"type\" in value && \"options\" in value && \"columns\" in value;\n}\nfunction invalidDocument(method, argument, received, message, fix) {\n\treturn postgresError(\"RUNTIME.ARGUMENT_INVALID\", `${method}: ${message}`, {\n\t\twhy: \"Postgres uses a full-text index only for a query over the same search document, so the document comes from the index itself, from one column, or from `fullTextDocument`.\",\n\t\tfix,\n\t\tmeta: {\n\t\t\thelper: method,\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\n/**\n* The weight groups and the language a search document stands for. A full-text index states both;\n* a column and a `fullTextDocument` take the language from the options.\n*/\nfunction documentGroups(method, document, options) {\n\tif (document instanceof FullTextDocument) return {\n\t\tweightGroups: document.weightGroups,\n\t\tlanguage: languageOf(options)\n\t};\n\tif (isExpression(document)) return {\n\t\tweightGroups: [[document]],\n\t\tlanguage: languageOf(options)\n\t};\n\tif (!isIndexReference(document)) throw invalidDocument(method, \"document\", Array.isArray(document) ? \"array\" : typeof document, \"the document must be a full-text index from a table's `indexes`, a column, or a document from `fullTextDocument`.\", \"Pass the index, as `table.indexes.<name>`, or wrap the weight groups in `fullTextDocument(...)`.\");\n\tif (document.type !== \"fullText\") throw invalidDocument(method, \"document\", document.type, `the index is of type \"${String(document.type)}\", not a full-text index.`, \"Pass an index declared with `@@fullTextIndex` or `fullTextIndex`.\");\n\tif (options.language !== void 0) throw invalidDocument(method, \"options\", options.language, \"a full-text index states its language, so the `language` option is not taken with one.\", \"Leave `language` out; the index decides it.\");\n\tconst definition = fullTextIndexOptions(document.options ?? {});\n\tif (definition instanceof type.errors) throw invalidDocument(method, \"document\", document.options, `the full-text index has invalid options: ${definition.summary}`, \"Pass the index as the table gives it.\");\n\tconst columns = document.columns;\n\tconst columnOf = (name) => {\n\t\tconst column = typeof columns === \"object\" && columns !== null && Object.hasOwn(columns, name) ? Reflect.get(columns, name) : void 0;\n\t\tif (!isExpression(column)) throw invalidDocument(method, \"document\", name, `the full-text index has no column \"${name}\", which its weight groups name.`, \"Pass the index as the table gives it.\");\n\t\treturn column;\n\t};\n\treturn {\n\t\tweightGroups: definition.weightGroups.map((group) => group.map(columnOf)),\n\t\tlanguage: definition.language\n\t};\n}\n/**\n* The search document an operation searches. The first column is the operation's `self`; the\n* others follow the `fixedArgs` the operation passes first, so the query, the language and any\n* further option keep their positions.\n*/\nfunction searchDocument(method, document, options, fixedArgs) {\n\tconst { weightGroups, language } = documentGroups(method, document, options);\n\tlet position = 0;\n\tconst template = renderFullTextDocument(weightGroups.map((group) => group.map(() => position++)), {\n\t\tcolumn: (index) => index === 0 ? \"{{self}}\" : `{{arg${fixedArgs + index - 1}}}`,\n\t\tlanguage: \"{{arg1}}\"\n\t});\n\tconst [self, ...rest] = weightGroups.flat().map((column) => toExpr(column));\n\tassertDefined(self, `${method}: a checked document has a first column`);\n\treturn {\n\t\tself,\n\t\trest,\n\t\ttemplate,\n\t\tlanguage: languageLiteral(method, language)\n\t};\n}\nfunction postgresQueryOperations() {\n\treturn {\n\t\tilike: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, pattern) => buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, TEXT_REF)],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tfullTextMatches: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst searched = searchDocument(\"fullTextMatches\", document, options, 2);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextMatches\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tsearched.language,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${searched.template} @@ {{arg0}}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextRank: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst fn = options.coverDensity === true ? \"ts_rank_cd\" : \"ts_rank\";\n\t\t\t\tconst normalization = options.normalization === void 0 ? void 0 : normalizationLiteral(\"fullTextRank\", options.normalization);\n\t\t\t\tconst searched = searchDocument(\"fullTextRank\", document, options, normalization === void 0 ? 2 : 3);\n\t\t\t\tconst fixed = normalization === void 0 ? [searched.language] : [searched.language, normalization];\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextRank\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\t...fixed,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_FLOAT4_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${fn}(${searched.template}, {{arg0}}${normalization === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextHeadline: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, query, options = {}) => {\n\t\t\t\tconst headlineOptions = headlineOptionsLiteral(\"fullTextHeadline\", options);\n\t\t\t\tconst base = \"ts_headline({{arg1}}, {{self}}, {{arg0}}\";\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextHeadline\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\ttoExpr(self),\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tlanguageLiteral(\"fullTextHeadline\", languageOf(options)),\n\t\t\t\t\t\t...headlineOptions === void 0 ? [] : [headlineOptions]\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${base}${headlineOptions === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\twebsearchToTsquery: { impl: websearchToTsquery },\n\t\ttoTsquery: { impl: toTsquery },\n\t\tplaintoTsquery: { impl: plaintoTsquery },\n\t\tphrasetoTsquery: { impl: phrasetoTsquery }\n\t};\n}\n//#endregion\n//#region src/core/transaction-isolation.ts\nconst postgresIsolationLevels = {\n\tReadUncommitted: \"ReadUncommitted\",\n\tReadCommitted: \"ReadCommitted\",\n\tRepeatableRead: \"RepeatableRead\",\n\tSerializable: \"Serializable\"\n};\nconst postgresIsolationLevelSchema = type.enumerated(...Object.values(postgresIsolationLevels));\nfunction validatePostgresIsolationLevel(value) {\n\tconst result = postgresIsolationLevelSchema(value);\n\tif (result instanceof type.errors) throw structuredError(\"RUNTIME.ARGUMENT_INVALID\", \"Invalid transaction isolation level\", {\n\t\twhy: result.summary,\n\t\tfix: \"Use ReadUncommitted, ReadCommitted, RepeatableRead, or Serializable.\",\n\t\tmeta: {\n\t\t\targument: \"isolationLevel\",\n\t\t\treceived: value\n\t\t}\n\t});\n\treturn result;\n}\n//#endregion\n//#region src/exports/runtime.ts\n/**\n* Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that\n* `@internal/sql-runtime` consumers narrow to at composition time.\n*\n* The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).\n*/\nconst postgresRuntimeTargetDescriptor = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tlistDecoder: () => decodePostgresListText,\n\tqueryOperations: () => postgresQueryOperations(),\n\tcollectionMethods: () => [postgresFullTextMethods],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer, PostgresContractView, decodePostgresListText, postgresRuntimeTargetDescriptor as default, postgresIsolationLevelSchema, postgresIsolationLevels, postgresNowGenerators, validatePostgresIsolationLevel };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;AAeA,SAAS,cAAc,OAAO,MAAM;CACnC,OAAO,UAAU,MAAM,IAAI,KAAK;AACjC;AACA,SAAS,eAAe,WAAW;CAClC,QAAQ,YAAY,GAAG,SAAS,WAAW,OAAO,QAAQ,UAAU,cAAc,OAAO,iBAAiB,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,QAAQ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,SAAS,EAAE;GAC5B,OAAO,MAAM,OAAO,UAAU,CAAC,MAAM;IACpC,MAAM,kBAAkB,uBAAuB,oBAAoB,OAAO;IAC1E,MAAM,OAAO;IACb,OAAO,eAAe;KACrB,QAAQ;KACR,MAAM;MACL,OAAO,IAAI;MACX,OAAO,OAAO,WAAW;MACzB,gBAAgB,oBAAoB,WAAW,OAAO,CAAC;MACvD,GAAG,oBAAoB,KAAK,IAAI,CAAC,IAAI,CAAC,eAAe;KACtD;KACA,SAAS;MACR,SAAS;MACT,UAAU;KACX;KACA,UAAU;MACT,cAAc;MACd,UAAU,GAAG,OAAO,oBAAoB,KAAK,IAAI,KAAK,aAAa;KACpE;IACD,CAAC;GACF;EACD;EACA,oBAAoB,EAAE,MAAM,mBAAmB;EAC/C,WAAW,EAAE,MAAM,UAAU;EAC7B,gBAAgB,EAAE,MAAM,eAAe;EACvC,iBAAiB,EAAE,MAAM,gBAAgB;CAC1C;AACD;AAGA,MAAM,0BAA0B;CAC/B,iBAAiB;CACjB,eAAe;CACf,gBAAgB;CAChB,cAAc;AACf;AACA,MAAM,+BAA+B,KAAK,WAAW,GAAG,OAAO,OAAO,uBAAuB,CAAC;AAC9F,SAAS,+BAA+B,OAAO;CAC9C,MAAM,SAAS,6BAA6B,KAAK;CACjD,IAAI,kBAAkB,KAAK,QAAQ,MAAM,gBAAgB,4BAA4B,uCAAuC;EAC3H,KAAK,OAAO;EACZ,KAAK;EACL,MAAM;GACL,UAAU;GACV,UAAU;EACX;CACD,CAAC;CACD,OAAO;AACR;;;;;;;AASA,MAAM,kCAAkC;CACvC,GAAG;CACH,cAAc,CAAC;CACf,mBAAmB;CACnB,uBAAuB,wBAAwB;CAC/C,yBAAyB,CAAC,uBAAuB;CACjD,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"runtime-BArZXVRj.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/runtime.mjs"],"sourcesContent":["import { I as PG_TSQUERY_CODEC_ID, T as PG_TEXT_CODEC_ID, c as PG_FLOAT4_CODEC_ID, n as PG_BOOL_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { u as postgresError } from \"./errors-DxWL0CMX.mjs\";\nimport { A as decodePostgresListText } from \"./codecs-B2C2j2Un.mjs\";\nimport { a as fullTextIndexOptions, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-MMcQF3_0.mjs\";\nimport { a as postgresNowGenerators, o as postgresTargetDescriptorMetaRuntime } from \"./date-time-now-generators-DylEKfQR.mjs\";\nimport { t as renderFullTextDocument } from \"./full-text-search-document-B5VCeQFz.mjs\";\nimport { n as PostgresContractSerializer, t as PostgresContractView } from \"./postgres-contract-view-CCbDZeIo.mjs\";\nimport { a as headlineOptionsLiteral, c as FullTextDocument, i as websearchToTsquery, n as plaintoTsquery, o as languageLiteral, r as toTsquery, s as normalizationLiteral, t as phrasetoTsquery } from \"./full-text-parsers-m8GS0pst.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { buildOperation, isExpression, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { uniqueIndexNamesOfType } from \"@internal/sql-relational-core/index-reference\";\n//#region src/core/full-text-collection-method.ts\nfunction indexFunction(tools, name) {\n\treturn blindCast(tools.fns[name]);\n}\nfunction fullTextMethod(indexName) {\n\treturn (collection, ...args) => collection.where((_model, tools) => indexFunction(tools, \"fullTextMatches\")(tools.indexes[indexName], ...args)).orderBy((_model, tools) => indexFunction(tools, \"fullTextRank\")(tools.indexes[indexName], ...args).desc());\n}\n/** The run-time half of `PostgresFullTextMethods`. */\nconst postgresFullTextMethods = {\n\tid: \"postgres/fullText\",\n\tmethodsFor: (model) => Object.fromEntries(uniqueIndexNamesOfType(model.table.indexes, FULL_TEXT_INDEX_TYPE).map((name) => [name, fullTextMethod(name)]))\n};\n//#endregion\n//#region src/core/query-operations.ts\nconst TEXT_REF = { codecId: PG_TEXT_CODEC_ID };\nconst TSQUERY_REF = { codecId: PG_TSQUERY_CODEC_ID };\nconst languageOf = (options) => options.language ?? \"english\";\nfunction isIndexReference(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value) && !isExpression(value) && \"type\" in value && \"options\" in value && \"columns\" in value;\n}\nfunction invalidDocument(method, argument, received, message, fix) {\n\treturn postgresError(\"RUNTIME.ARGUMENT_INVALID\", `${method}: ${message}`, {\n\t\twhy: \"Postgres uses a full-text index only for a query over the same search document, so the document comes from the index itself, from one column, or from `fullTextDocument`.\",\n\t\tfix,\n\t\tmeta: {\n\t\t\thelper: method,\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\n/**\n* The weight groups and the language a search document stands for. A full-text index states both;\n* a column and a `fullTextDocument` take the language from the options.\n*/\nfunction documentGroups(method, document, options) {\n\tif (document instanceof FullTextDocument) return {\n\t\tweightGroups: document.weightGroups,\n\t\tlanguage: languageOf(options)\n\t};\n\tif (isExpression(document)) return {\n\t\tweightGroups: [[document]],\n\t\tlanguage: languageOf(options)\n\t};\n\tif (!isIndexReference(document)) throw invalidDocument(method, \"document\", Array.isArray(document) ? \"array\" : typeof document, \"the document must be a full-text index from a table's `indexes`, a column, or a document from `fullTextDocument`.\", \"Pass the index, as `table.indexes.<name>`, or wrap the weight groups in `fullTextDocument(...)`.\");\n\tif (document.type !== \"fullText\") throw invalidDocument(method, \"document\", document.type, `the index is of type \"${String(document.type)}\", not a full-text index.`, \"Pass an index declared with `@@fullTextIndex` or `fullTextIndex`.\");\n\tif (options.language !== void 0) throw invalidDocument(method, \"options\", options.language, \"a full-text index states its language, so the `language` option is not taken with one.\", \"Leave `language` out; the index decides it.\");\n\tconst definition = fullTextIndexOptions(document.options ?? {});\n\tif (definition instanceof type.errors) throw invalidDocument(method, \"document\", document.options, `the full-text index has invalid options: ${definition.summary}`, \"Pass the index as the table gives it.\");\n\tconst columns = document.columns;\n\tconst columnOf = (name) => {\n\t\tconst column = typeof columns === \"object\" && columns !== null && Object.hasOwn(columns, name) ? Reflect.get(columns, name) : void 0;\n\t\tif (!isExpression(column)) throw invalidDocument(method, \"document\", name, `the full-text index has no column \"${name}\", which its weight groups name.`, \"Pass the index as the table gives it.\");\n\t\treturn column;\n\t};\n\treturn {\n\t\tweightGroups: definition.weightGroups.map((group) => group.map(columnOf)),\n\t\tlanguage: definition.language\n\t};\n}\n/**\n* The search document an operation searches. The first column is the operation's `self`; the\n* others follow the `fixedArgs` the operation passes first, so the query, the language and any\n* further option keep their positions.\n*/\nfunction searchDocument(method, document, options, fixedArgs) {\n\tconst { weightGroups, language } = documentGroups(method, document, options);\n\tlet position = 0;\n\tconst template = renderFullTextDocument(weightGroups.map((group) => group.map(() => position++)), {\n\t\tcolumn: (index) => index === 0 ? \"{{self}}\" : `{{arg${fixedArgs + index - 1}}}`,\n\t\tlanguage: \"{{arg1}}\"\n\t});\n\tconst [self, ...rest] = weightGroups.flat().map((column) => toExpr(column));\n\tassertDefined(self, `${method}: a checked document has a first column`);\n\treturn {\n\t\tself,\n\t\trest,\n\t\ttemplate,\n\t\tlanguage: languageLiteral(method, language)\n\t};\n}\nfunction postgresQueryOperations() {\n\treturn {\n\t\tilike: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, pattern) => buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, TEXT_REF)],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tfullTextMatches: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst searched = searchDocument(\"fullTextMatches\", document, options, 2);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextMatches\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tsearched.language,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${searched.template} @@ {{arg0}}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextRank: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst fn = options.coverDensity === true ? \"ts_rank_cd\" : \"ts_rank\";\n\t\t\t\tconst normalization = options.normalization === void 0 ? void 0 : normalizationLiteral(\"fullTextRank\", options.normalization);\n\t\t\t\tconst searched = searchDocument(\"fullTextRank\", document, options, normalization === void 0 ? 2 : 3);\n\t\t\t\tconst fixed = normalization === void 0 ? [searched.language] : [searched.language, normalization];\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextRank\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\t...fixed,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_FLOAT4_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${fn}(${searched.template}, {{arg0}}${normalization === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextHeadline: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, query, options = {}) => {\n\t\t\t\tconst headlineOptions = headlineOptionsLiteral(\"fullTextHeadline\", options);\n\t\t\t\tconst base = \"ts_headline({{arg1}}, {{self}}, {{arg0}}\";\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextHeadline\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\ttoExpr(self),\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tlanguageLiteral(\"fullTextHeadline\", languageOf(options)),\n\t\t\t\t\t\t...headlineOptions === void 0 ? [] : [headlineOptions]\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${base}${headlineOptions === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\twebsearchToTsquery: { impl: websearchToTsquery },\n\t\ttoTsquery: { impl: toTsquery },\n\t\tplaintoTsquery: { impl: plaintoTsquery },\n\t\tphrasetoTsquery: { impl: phrasetoTsquery }\n\t};\n}\n//#endregion\n//#region src/core/transaction-isolation.ts\nconst postgresIsolationLevels = {\n\tReadUncommitted: \"ReadUncommitted\",\n\tReadCommitted: \"ReadCommitted\",\n\tRepeatableRead: \"RepeatableRead\",\n\tSerializable: \"Serializable\"\n};\nconst postgresIsolationLevelSchema = type.enumerated(...Object.values(postgresIsolationLevels));\nfunction validatePostgresIsolationLevel(value) {\n\tconst result = postgresIsolationLevelSchema(value);\n\tif (result instanceof type.errors) throw structuredError(\"RUNTIME.ARGUMENT_INVALID\", \"Invalid transaction isolation level\", {\n\t\twhy: result.summary,\n\t\tfix: \"Use ReadUncommitted, ReadCommitted, RepeatableRead, or Serializable.\",\n\t\tmeta: {\n\t\t\targument: \"isolationLevel\",\n\t\t\treceived: value\n\t\t}\n\t});\n\treturn result;\n}\n//#endregion\n//#region src/exports/runtime.ts\n/**\n* Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that\n* `@internal/sql-runtime` consumers narrow to at composition time.\n*\n* The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).\n*/\nconst postgresRuntimeTargetDescriptor = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tlistDecoder: () => decodePostgresListText,\n\tqueryOperations: () => postgresQueryOperations(),\n\tcollectionMethods: () => [postgresFullTextMethods],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer, PostgresContractView, decodePostgresListText, postgresRuntimeTargetDescriptor as default, postgresIsolationLevelSchema, postgresIsolationLevels, postgresNowGenerators, validatePostgresIsolationLevel };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;AAeA,SAAS,cAAc,OAAO,MAAM;CACnC,OAAO,UAAU,MAAM,IAAI,KAAK;AACjC;AACA,SAAS,eAAe,WAAW;CAClC,QAAQ,YAAY,GAAG,SAAS,WAAW,OAAO,QAAQ,UAAU,cAAc,OAAO,iBAAiB,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,QAAQ,UAAU,cAAc,OAAO,cAAc,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,KAA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,oBAAoB,OAAO;IAC1E,MAAM,OAAO;IACb,OAAO,eAAe;KACrB,QAAQ;KACR,MAAM;MACL,OAAO,IAAI;MACX,OAAO,OAAO,WAAW;MACzB,gBAAgB,oBAAoB,WAAW,OAAO,CAAC;MACvD,GAAG,oBAAoB,KAAK,IAAI,CAAC,IAAI,CAAC,eAAe;KACtD;KACA,SAAS;MACR,SAAS;MACT,UAAU;KACX;KACA,UAAU;MACT,cAAc;MACd,UAAU,GAAG,OAAO,oBAAoB,KAAK,IAAI,KAAK,aAAa;KACpE;IACD,CAAC;GACF;EACD;EACA,oBAAoB,EAAE,MAAM,mBAAmB;EAC/C,WAAW,EAAE,MAAM,UAAU;EAC7B,gBAAgB,EAAE,MAAM,eAAe;EACvC,iBAAiB,EAAE,MAAM,gBAAgB;CAC1C;AACD;AAGA,MAAM,0BAA0B;CAC/B,iBAAiB;CACjB,eAAe;CACf,gBAAgB;CAChB,cAAc;AACf;AACA,MAAM,+BAA+B,KAAK,WAAW,GAAG,OAAO,OAAO,uBAAuB,CAAC;AAC9F,SAAS,+BAA+B,OAAO;CAC9C,MAAM,SAAS,6BAA6B,KAAK;CACjD,IAAI,kBAAkB,KAAK,QAAQ,MAAM,gBAAgB,4BAA4B,uCAAuC;EAC3H,KAAK,OAAO;EACZ,KAAK;EACL,MAAM;GACL,UAAU;GACV,UAAU;EACX;CACD,CAAC;CACD,OAAO;AACR;;;;;;;AASA,MAAM,kCAAkC;CACvC,GAAG;CACH,cAAc,CAAC;CACf,mBAAmB;CACnB,uBAAuB,wBAAwB;CAC/C,yBAAyB,CAAC,uBAAuB;CACjD,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
|
package/dist/target.d.mts
CHANGED
|
@@ -45,7 +45,7 @@ import { a as foreignKey, c as primaryKey, d as unique, i as fn, l as rawSql, n
|
|
|
45
45
|
import { n as IntrospectedTypeText, r as introspectedTypeText, t as CatalogColumnType } from "./native-type-normalizer-BaGa9eeb.mjs";
|
|
46
46
|
import "./op-factory-call-COB28WBr.mjs";
|
|
47
47
|
import "./operation-types-CaLyyiOR.mjs";
|
|
48
|
-
import "./pack-
|
|
48
|
+
import "./pack-DshiZKVJ.mjs";
|
|
49
49
|
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-Jizp3q0s-D_Sq7rld.mjs";
|
|
50
50
|
import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-CTwe5ozf.mjs";
|
|
51
51
|
import { t as buildColumnTypeSql } from "./planner-ddl-builders-CPM3y7cQ.mjs";
|
|
@@ -53,7 +53,7 @@ import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./pla
|
|
|
53
53
|
import "./planner-produced-postgres-migration-CDE9JowN.mjs";
|
|
54
54
|
import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-ceCNOGFf.mjs";
|
|
55
55
|
import "./planner-sql-checks-rEjFx_Jv.mjs";
|
|
56
|
-
import { t as prisma7PostgresBinding } from "./prisma7-binding-
|
|
56
|
+
import { t as prisma7PostgresBinding } from "./prisma7-binding-BqClsmwa.mjs";
|
|
57
57
|
import { t as renderOps } from "./render-ops-oYwF1MRN.mjs";
|
|
58
58
|
import { t as renderCallsToTypeScript } from "./render-typescript-dgxcyEaj.mjs";
|
|
59
59
|
import { a as postgresIsolationLevelSchema, c as validatePostgresIsolationLevel, i as PostgresRuntimeTargetInstance, n as PostgresIsolationLevel, o as postgresIsolationLevels, r as PostgresListDecoder, t as PostgresContractSerializer } from "./runtime-DhK5uy8-.mjs";
|
package/dist/target.mjs
CHANGED
|
@@ -9,41 +9,41 @@ import { A as pgNumericColumn, B as pgVarbitColumn, C as pgIntColumn, D as pgJso
|
|
|
9
9
|
import { n as postgresCodecRegistry, t as postgresCodecDescriptorRegistry } from "./registry-CWgvB0Fj-Czwmfmzd.mjs";
|
|
10
10
|
import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as assemblePostgresCodecRegistry } from "./codec-registry-FvoD6sJj-ClHgHbyf.mjs";
|
|
11
11
|
import { f as weightGroupsOf, l as fullTextIndexProblems, n as FULL_TEXT_INDEX_TYPE, o as describeFullTextIndexProblem, t as DEFAULT_FULL_TEXT_SEARCH_LANGUAGE } from "./full-text-index-definition-MMcQF3_0-wRCz2FDP.mjs";
|
|
12
|
-
import { _ as policyInputFromSerialized, c as PostgresRole, d as PostgresTableSource, f as PostgresUnboundSchema, i as PostgresRlsEnablement, m as isPostgresSchema, o as PostgresRlsPolicy, t as PostgresExtension, u as PostgresSchema, v as postgresCreateNamespace } from "./postgres-schema-
|
|
12
|
+
import { _ as policyInputFromSerialized, c as PostgresRole, d as PostgresTableSource, f as PostgresUnboundSchema, i as PostgresRlsEnablement, m as isPostgresSchema, o as PostgresRlsPolicy, t as PostgresExtension, u as PostgresSchema, v as postgresCreateNamespace } from "./postgres-schema-BaGmKymi-WHJQsmeb.mjs";
|
|
13
13
|
import { _ as PostgresDropIndex, a as PostgresAlterIndexRename, b as PostgresDropType, c as PostgresAlterTable, d as PostgresCreatePolicy, f as PostgresCreateSchema, g as PostgresDisableRowLevelSecurity, h as PostgresDdlNode, 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-DNvIhHag.mjs";
|
|
14
|
-
import { A as extensionInSchemaAst, F as noNullValuesAst, G as tableIsEmptyAst, H as sequenceNameAvailableAst, K as tablePrimaryKeyAst, L as rlsEnabledAst, M as indexExistsAst, W as tableExistsAst, _ as constraintExistsAst, b as createSchema, d as columnExistsAst, f as columnNullabilityAst, k as extensionExistsAst, l as columnDefaultAst, m as columnTypeAst, n as addConstraintAction, q as toRegclass, r as alterColumnTypeAction, s as alterTable, t as addColumnAction, u as columnDefaultSequenceAst, w as dropDefaultAction, x as createTable, z as rlsPolicyExistsAst } from "./ddl-
|
|
15
|
-
import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-
|
|
14
|
+
import { A as extensionInSchemaAst, F as noNullValuesAst, G as tableIsEmptyAst, H as sequenceNameAvailableAst, K as tablePrimaryKeyAst, L as rlsEnabledAst, M as indexExistsAst, W as tableExistsAst, _ as constraintExistsAst, b as createSchema, d as columnExistsAst, f as columnNullabilityAst, k as extensionExistsAst, l as columnDefaultAst, m as columnTypeAst, n as addConstraintAction, q as toRegclass, r as alterColumnTypeAction, s as alterTable, t as addColumnAction, u as columnDefaultSequenceAst, w as dropDefaultAction, x as createTable, z as rlsPolicyExistsAst } from "./ddl-BcqT3JRx-Dz0WRW0c.mjs";
|
|
15
|
+
import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-C74Twi_E.mjs";
|
|
16
16
|
import { i as policyRoleList, n as POLICY_OPERATION_PREDICATES, r as computeContentHash, t as POLICY_COMMAND_SQL } from "./canonicalize-RdxoUHao-FTTkizfe.mjs";
|
|
17
17
|
import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-YxSb5di3-9F5ofwnG.mjs";
|
|
18
|
-
import { c as postgresScalarTypes, o as postgresExplicitTypes } from "./authoring-
|
|
18
|
+
import { c as postgresScalarTypes, o as postgresExplicitTypes } from "./authoring-ZsHi4vLr-qbZ1hNzY.mjs";
|
|
19
19
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-cvFP1EFS-CPLt6x-O.mjs";
|
|
20
20
|
import { a as postgresNowGenerators, i as postgresNowGeneratorControlDescriptors } from "./date-time-now-generators-DylEKfQR-CYbXE0y0.mjs";
|
|
21
21
|
import { t as postgresDataTypeEntries } from "./data-type-entries-CKHtbfmn-DBNF36FF.mjs";
|
|
22
|
-
import { a as stackDataTypes, i as qualifyTableName, t as alterTypeCheck } from "./planner-sql-checks-
|
|
23
|
-
import { A as EnableRowLevelSecurityCall, B as RenameSchemaCall, C as DropExtensionCall, D as DropPostgresRlsPolicyCall, E as DropNotNullCall, F as RemoveStoredValueCall, G as SetDefaultCall, H as RenameTableCall, I as RenameColumnCall, J as SetTableSchemaCall, K as SetExtensionSchemaCall, L as RenameConstraintCall, M as MIGRATION_MODULE, N as RawSqlCall, O as DropSchemaCall, P as RemoveStoredKeyCall, R as RenameIndexCall, S as DropDefaultCall, T as DropNativeEnumTypeCall, U as ReplaceStoredValueCall, V as RenameStoredKeyCall, _ as DeleteRowsCall, a as AddNativeEnumValueCall, b as DropColumnCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddForeignKeyCall, j as FillStoredKeyCall, k as DropTableCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreatePostgresRlsPolicyCall, q as SetNotNullCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DisableRowLevelSecurityCall, w as DropIndexCall, x as DropConstraintCall, y as DropCheckConstraintCall, z as RenamePostgresRlsPolicyCall } from "./op-factory-call-
|
|
22
|
+
import { a as stackDataTypes, i as qualifyTableName, t as alterTypeCheck } from "./planner-sql-checks-DE7POy4E-BAVOBp_Q.mjs";
|
|
23
|
+
import { A as EnableRowLevelSecurityCall, B as RenameSchemaCall, C as DropExtensionCall, D as DropPostgresRlsPolicyCall, E as DropNotNullCall, F as RemoveStoredValueCall, G as SetDefaultCall, H as RenameTableCall, I as RenameColumnCall, J as SetTableSchemaCall, K as SetExtensionSchemaCall, L as RenameConstraintCall, M as MIGRATION_MODULE, N as RawSqlCall, O as DropSchemaCall, P as RemoveStoredKeyCall, R as RenameIndexCall, S as DropDefaultCall, T as DropNativeEnumTypeCall, U as ReplaceStoredValueCall, V as RenameStoredKeyCall, _ as DeleteRowsCall, a as AddNativeEnumValueCall, b as DropColumnCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddForeignKeyCall, j as FillStoredKeyCall, k as DropTableCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreatePostgresRlsPolicyCall, q as SetNotNullCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DisableRowLevelSecurityCall, w as DropIndexCall, x as DropConstraintCall, y as DropCheckConstraintCall, z as RenamePostgresRlsPolicyCall } from "./op-factory-call-BQOeT_F--DpdYzN0o.mjs";
|
|
24
24
|
import { i as PostgresTableSchemaNode, n as PostgresNativeEnumSchemaNode, r as PostgresSchemaNodeKind, t as PostgresExtensionSchemaNode } from "./postgres-table-schema-node-OQRI_GIM-DhOVxH8-.mjs";
|
|
25
|
+
import { t as buildColumnTypeSql } from "./planner-ddl-builders-Blf3qKKf-BopCSwrT.mjs";
|
|
26
|
+
import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-CX3J2pLA-CjCpOnue.mjs";
|
|
27
|
+
import { o as planIssues, t as coalesceSubtreeIssues } from "./control-policy-Ckz2Fs57-C98YTOWU.mjs";
|
|
25
28
|
import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-yFPLQ6U0-ZCPXs-lG.mjs";
|
|
26
|
-
import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-
|
|
29
|
+
import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-DjC64uGi-CDs0tX1m.mjs";
|
|
27
30
|
import { n as readPostgresDefault, t as postgresResolveDefault } from "./default-normalizer-BqK6XxdC-2OUb2ybG.mjs";
|
|
28
31
|
import { n as renderFullTextIndexDocument } from "./full-text-search-document-B5VCeQFz-D4hKtj-M.mjs";
|
|
29
|
-
import { t as
|
|
30
|
-
import { n as
|
|
31
|
-
import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-Crcjg7Vz-39_fO8yR.mjs";
|
|
32
|
-
import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-CVmwyjFf-DSWPpd4M.mjs";
|
|
33
|
-
import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs";
|
|
32
|
+
import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-LHXykgph-DoYVYqfq.mjs";
|
|
33
|
+
import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-CCbDZeIo-CK9z1Hw9.mjs";
|
|
34
34
|
import { t as dataTransform } from "./data-transform-h9agBu_c-RlC5A7aY.mjs";
|
|
35
|
-
import { t as PostgresMigration } from "./postgres-migration-
|
|
36
|
-
import { t as renderOps } from "./render-ops-
|
|
37
|
-
import { t as renderCallsToTypeScript } from "./render-typescript-
|
|
38
|
-
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-
|
|
39
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
35
|
+
import { t as PostgresMigration } from "./postgres-migration-BZ4z5KJ6-Cmya-r8H.mjs";
|
|
36
|
+
import { t as renderOps } from "./render-ops-Owjb6xFw-ClGtnwWZ.mjs";
|
|
37
|
+
import { t as renderCallsToTypeScript } from "./render-typescript-kNKf8www-Cyz2V7o5.mjs";
|
|
38
|
+
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-0n4ABKFA-Cu07sYKL.mjs";
|
|
39
|
+
import { t as createPostgresMigrationPlanner } from "./planner-UNJid9ms-DiphUfCo.mjs";
|
|
40
40
|
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-BkBKBRE3.mjs";
|
|
41
41
|
import { c as toTsquery, l as websearchToTsquery, n as fullTextDocument, o as phrasetoTsquery, s as plaintoTsquery, t as FullTextDocument } from "./full-text-parsers-m8GS0pst-C6RPRehL.mjs";
|
|
42
42
|
import { t as tsquery } from "./full-text-Bu_qI2ue.mjs";
|
|
43
43
|
import { a as foreignKey, c as primaryKey, d as unique, i as fn, l as rawSql, n as checkExpression, o as lit, r as col, s as placeholder, t as MigrationCLI, u as sql } from "./migration-Be_iuIpn.mjs";
|
|
44
44
|
import { t as introspectedTypeText } from "./native-type-normalizer-DY__fyaa.mjs";
|
|
45
45
|
import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-BbUY9oVy.mjs";
|
|
46
|
-
import { t as prisma7PostgresBinding } from "./prisma7-binding-
|
|
46
|
+
import { t as prisma7PostgresBinding } from "./prisma7-binding-D9c8koix.mjs";
|
|
47
47
|
import { i as validatePostgresIsolationLevel, n as postgresIsolationLevels, t as postgresIsolationLevelSchema } from "./runtime-BArZXVRj.mjs";
|
|
48
48
|
import { t as POSTGRES_MIN_SERVER_VERSION } from "./server-version-IguNEl-k.mjs";
|
|
49
49
|
export { AddCheckConstraintCall, AddColumnAction, AddColumnCall, AddColumnWithTemporaryDefaultCall, AddConstraintAction, AddForeignKeyCall, AddNativeEnumValueCall, AddPrimaryKeyCall, AddRequiredColumnToEmptyTableCall, AddUniqueCall, AlterColumnTypeAction, AlterColumnTypeCall, CONTROL_PLANE_LC_MONETARY, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, DataTransformCall, DeleteRowsCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultAction, DropDefaultCall, DropExtensionCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropSchemaCall, DropTableCall, EnableRowLevelSecurityCall, FULL_TEXT_INDEX_TYPE, FillStoredKeyCall, FullTextDocument, MARKER_LOCK_KEY, MARKER_LOCK_SQL, MIGRATION_MODULE, PostgresMigration as Migration, MigrationCLI, PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_DATE_STRING_CODEC_ID, PG_DATE_TEMPORAL_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INET_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INT8_NUMBER_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INTERVAL_STRING_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_MONEY_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_OID_CODEC_ID, PG_TEXT_ARRAY_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_DATE_CODEC_ID, PG_TIMESTAMPTZ_STRING_CODEC_ID, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, PG_TIMESTAMP_DATE_CODEC_ID, PG_TIMESTAMP_INSTANT_CODEC_ID, PG_TIMESTAMP_STRING_CODEC_ID, PG_TIMESTAMP_TEMPORAL_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_STRING_CODEC_ID, PG_TIME_TEMPORAL_CODEC_ID, PG_TSQUERY_CODEC_ID, PG_UNBOUNDED_INT_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, PG_XML_CODEC_ID, POLICY_COMMAND_SQL, POLICY_OPERATION_PREDICATES, POSTGRES_MIN_SERVER_VERSION, PgIntervalStringCodec, PgIntervalStringDescriptor, PgTimestampDateCodec, PgTimestampDateDescriptor, PgTimestamptzDateCodec, PgTimestamptzDateDescriptor, PostgresAlterIndexRename, PostgresAlterPolicyRename, PostgresAlterSchemaRename, PostgresAlterTable, PostgresAlterTableSetSchema, PostgresCodecDescriptor, PostgresContractSerializer, PostgresContractView, PostgresCreateIndex, PostgresCreatePolicy, PostgresCreateSchema, PostgresCreateTable, PostgresCreateType, PostgresDatabaseSchemaNode, PostgresDdlNode, PostgresDisableRowLevelSecurity, PostgresDropIndex, PostgresDropPolicy, PostgresDropSchema, PostgresDropType, PostgresExtension, PostgresExtensionSchemaNode, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresTableSource, PostgresUnboundSchema, RawSqlCall, RemoveStoredKeyCall, RemoveStoredValueCall, RenameColumnCall, RenameConstraintCall, RenameIndexCall, RenamePostgresRlsPolicyCall, RenameSchemaCall, RenameStoredKeyCall, RenameTableCall, ReplaceStoredValueCall, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_RAW_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SetDefaultCall, SetExtensionSchemaCall, SetNotNullCall, SetTableSchemaCall, TypeScriptRenderablePostgresMigration, addColumnAction, addConstraintAction, alterColumnTypeAction, alterTable, alterTypeCheck, assemblePostgresCodecRegistry, assemblePostgresCodecRegistryWithBuiltins, buildBuiltinIdentityValue, buildColumnTypeSql, buildControlTableBootstrapQueries, buildPostgresCodecDescriptorRegistry, buildPostgresPlanDiff, buildSchemaLookupMap, buildSignMarkerBootstrapQueries, checkExpression, coalesceSubtreeIssues, col, columnDefaultAst, columnDefaultSequenceAst, columnExistsAst, columnNullabilityAst, columnTypeAst, computeContentHash, constraintExistsAst, contractToPostgresDatabaseSchemaNode, createPostgresBuiltinCodecLookup, createPostgresBuiltinDataTypeLookup, createPostgresCodecRegistryWithBuiltins, createPostgresMigrationPlanner, createSchema, createTable, dataTransform, decodePostgresListText, definePostgresCodecs, describeFullTextIndexProblem, dropDefaultAction, errorPostgresMigrationStackMissing, escapeLiteral, extensionExistsAst, extensionInSchemaAst, fn, foreignKey, fullTextDocument, fullTextIndexProblems, hasForeignKey, hasIndex, hasUniqueConstraint, indexExistsAst, inlineLiteral, int4, int8, introspectedTypeText, isPgEnumParams, isPgOid, isPostgresCodecDescriptor, isPostgresSchema, jsonb, lit, moneyTextOfCents, noNullValuesAst, parsePostgresListText, pgBit, pgBitColumn, pgBitLengthParams, pgBool, pgBoolColumn, pgBytea, pgChar, pgCharColumn, pgCharacterLengthParams, pgDate, pgDateStoredText, pgEnum, pgEnumDescriptor, pgEnumParams, pgFloat4, pgFloat4Column, pgFloat8, pgFloat8Column, pgFloatColumn, pgInet, pgInetColumn, pgInt2, pgInt2Column, pgInt4, pgInt4Column, pgInt8, pgInt8Column, pgInt8NumberColumn, pgIntColumn, pgInterval, pgIntervalColumn, pgIntervalStringColumn, pgIntervalStringDescriptor, pgJson, pgJsonColumn, pgJsonb, pgJsonbColumn, pgJsonbEnumRefusal, pgMoney, pgMoneyColumn, pgMoneyStoredText, pgNumeric, pgNumericColumn, pgNumericParams, pgOid, pgOidColumn, pgPrecisionParams, pgTable, pgText, pgTextArray, pgTextColumn, pgTime, pgTimeStoredText, pgTimestamp, pgTimestampDateColumn, pgTimestampDateDescriptor, pgTimestampStoredText, pgTimestamptz, pgTimestamptzDateColumn, pgTimestamptzDateDescriptor, pgTimestamptzStoredText, pgTimetz, pgTimetzColumn, pgTimetzStoredText, pgTsquery, pgUnboundedIntColumn, pgUuid, pgUuidColumn, pgVarbit, pgVarbitColumn, pgVarchar, pgVarcharColumn, pgXml, pgXmlColumn, phrasetoTsquery, placeholder, plaintoTsquery, planIssues, policyInputFromSerialized, policyRoleList, postgresAggregateDescriptors, postgresCodec, postgresCodecDescriptorRegistry, postgresCodecRegistry, postgresCodecTraitsOf, postgresCreateNamespace, postgresDataTypeEntries, postgresDataTypes, postgresError, postgresExplicitTypes, postgresIsolationLevelSchema, postgresIsolationLevels, postgresNowGeneratorControlDescriptors, postgresNowGenerators, postgresRenderCheckExpressions, postgresResolveDefault, postgresScalarTypes, postgresTextDataTypes, primaryKey, prisma7PostgresBinding, qualifiedEnumName, qualifyName, qualifyTableName, quoteIdentifier, quoteQualifiedName, rawSql, readPostgresDefault, renderCallsToTypeScript, renderFullTextIndexDocument, renderOps, resolveDdlSchemaForNamespaceStorage, resolveIdentityValue, rlsEnabledAst, rlsPolicyExistsAst, sequenceNameAvailableAst, sql, stackDataTypes, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, timestamptzJsDate, toRegclass, toTsquery, tsquery, unique, validateEnumValueLength, validatePostgresIsolationLevel, websearchToTsquery, weightGroupsOf };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as PostgresTableSource } from "./postgres-schema-
|
|
2
|
-
import { A as extensionInSchemaAst, F as noNullValuesAst, G as tableIsEmptyAst, H as sequenceNameAvailableAst, K as tablePrimaryKeyAst, L as rlsEnabledAst, M as indexExistsAst, W as tableExistsAst, _ as constraintExistsAst, b as createSchema, d as columnExistsAst, f as columnNullabilityAst, k as extensionExistsAst, l as columnDefaultAst, m as columnTypeAst, n as addConstraintAction, q as toRegclass, r as alterColumnTypeAction, s as alterTable, t as addColumnAction, u as columnDefaultSequenceAst, w as dropDefaultAction, x as createTable, z as rlsPolicyExistsAst } from "./ddl-
|
|
3
|
-
import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-
|
|
1
|
+
import { d as PostgresTableSource } from "./postgres-schema-BaGmKymi-WHJQsmeb.mjs";
|
|
2
|
+
import { A as extensionInSchemaAst, F as noNullValuesAst, G as tableIsEmptyAst, H as sequenceNameAvailableAst, K as tablePrimaryKeyAst, L as rlsEnabledAst, M as indexExistsAst, W as tableExistsAst, _ as constraintExistsAst, b as createSchema, d as columnExistsAst, f as columnNullabilityAst, k as extensionExistsAst, l as columnDefaultAst, m as columnTypeAst, n as addConstraintAction, q as toRegclass, r as alterColumnTypeAction, s as alterTable, t as addColumnAction, u as columnDefaultSequenceAst, w as dropDefaultAction, x as createTable, z as rlsPolicyExistsAst } from "./ddl-BcqT3JRx-Dz0WRW0c.mjs";
|
|
3
|
+
import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-C74Twi_E.mjs";
|
|
4
4
|
export { PostgresTableSource, addColumnAction, addConstraintAction, alterColumnTypeAction, alterTable, buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, columnDefaultAst, columnDefaultSequenceAst, columnExistsAst, columnNullabilityAst, columnTypeAst, constraintExistsAst, createSchema, createTable, dropDefaultAction, extensionExistsAst, extensionInSchemaAst, indexExistsAst, int4, int8, jsonb, noNullValuesAst, pgTable, rlsEnabledAst, rlsPolicyExistsAst, sequenceNameAvailableAst, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, timestamptzJsDate, toRegclass };
|
package/dist/target__control.mjs
CHANGED
|
@@ -5,22 +5,22 @@ import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cxc0dBbO.mjs
|
|
|
5
5
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-DgG3pi5p.mjs";
|
|
6
6
|
import { c as decodePostgresListText, u as parsePostgresListText } from "./codecs-B2C2j2Un-Dc-aGN1s.mjs";
|
|
7
7
|
import { s as fullTextIndexDefinitionOf } from "./full-text-index-definition-MMcQF3_0-wRCz2FDP.mjs";
|
|
8
|
-
import { c as PostgresRole, i as PostgresRlsEnablement, o as PostgresRlsPolicy, t as PostgresExtension } from "./postgres-schema-
|
|
8
|
+
import { c as PostgresRole, i as PostgresRlsEnablement, o as PostgresRlsPolicy, t as PostgresExtension } from "./postgres-schema-BaGmKymi-WHJQsmeb.mjs";
|
|
9
9
|
import { r as computeContentHash } from "./canonicalize-RdxoUHao-FTTkizfe.mjs";
|
|
10
|
-
import { c as postgresScalarTypes, o as postgresExplicitTypes, t as POLICY_BLOCK_KEYWORDS } from "./authoring-
|
|
10
|
+
import { c as postgresScalarTypes, o as postgresExplicitTypes, t as POLICY_BLOCK_KEYWORDS } from "./authoring-ZsHi4vLr-qbZ1hNzY.mjs";
|
|
11
11
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-cvFP1EFS-CPLt6x-O.mjs";
|
|
12
12
|
import { i as postgresNowGeneratorControlDescriptors } from "./date-time-now-generators-DylEKfQR-CYbXE0y0.mjs";
|
|
13
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
14
|
-
import { i as qualifyTableName } from "./planner-sql-checks-
|
|
15
|
-
import { $ as dropCheckConstraintId, W as SCHEMA_OBJECTS_SQL, ct as schemaContentsOf, lt as schemaObjectsSummary, st as schemaBlockingObjects, tt as holdingStoredValue } from "./op-factory-call-
|
|
13
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-D49elEeZ-Bx0EB8FX.mjs";
|
|
14
|
+
import { i as qualifyTableName } from "./planner-sql-checks-DE7POy4E-BAVOBp_Q.mjs";
|
|
15
|
+
import { $ as dropCheckConstraintId, W as SCHEMA_OBJECTS_SQL, ct as schemaContentsOf, lt as schemaObjectsSummary, st as schemaBlockingObjects, tt as holdingStoredValue } from "./op-factory-call-BQOeT_F--DpdYzN0o.mjs";
|
|
16
16
|
import { o as postgresDiffSubjectEntityKind, s as postgresDiffSubjectGranularity } from "./postgres-table-schema-node-OQRI_GIM-DhOVxH8-.mjs";
|
|
17
17
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-yFPLQ6U0-ZCPXs-lG.mjs";
|
|
18
|
-
import { r as diffPostgresSchema } from "./diff-database-schema-
|
|
19
|
-
import { t as PostgresContractSerializer } from "./postgres-contract-view-
|
|
20
|
-
import { o as postgresContractToSchema } from "./postgres-migration-
|
|
21
|
-
import { i as recordedAccessChangesOf, n as postgresMarkedRemoval, r as postgresStoredValueCallClasses, t as createPostgresMigrationPlanner } from "./planner-
|
|
18
|
+
import { r as diffPostgresSchema } from "./diff-database-schema-LHXykgph-DoYVYqfq.mjs";
|
|
19
|
+
import { t as PostgresContractSerializer } from "./postgres-contract-view-CCbDZeIo-CK9z1Hw9.mjs";
|
|
20
|
+
import { o as postgresContractToSchema } from "./postgres-migration-BZ4z5KJ6-Cmya-r8H.mjs";
|
|
21
|
+
import { i as recordedAccessChangesOf, n as postgresMarkedRemoval, r as postgresStoredValueCallClasses, t as createPostgresMigrationPlanner } from "./planner-UNJid9ms-DiphUfCo.mjs";
|
|
22
22
|
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-BkBKBRE3.mjs";
|
|
23
|
-
import { _ as positionalArg, a as buildFullTextIndexAttribute, c as buildModelConstraintAttribute, f as inferPostgresPslContract, g as parseDefaultAttributeString, i as buildExtensionBlock, l as buildNativeEnumBlock, n as buildAttribute, o as buildIndexAttribute, p as namedArg, r as buildCheckAttribute, s as buildMapAttribute, t as SYNTHETIC_SPAN, v as typeArgument } from "./infer-psl-contract-
|
|
23
|
+
import { _ as positionalArg, a as buildFullTextIndexAttribute, c as buildModelConstraintAttribute, f as inferPostgresPslContract, g as parseDefaultAttributeString, i as buildExtensionBlock, l as buildNativeEnumBlock, n as buildAttribute, o as buildIndexAttribute, p as namedArg, r as buildCheckAttribute, s as buildMapAttribute, t as SYNTHETIC_SPAN, v as typeArgument } from "./infer-psl-contract-C12P-2OG-ChFgcM6f.mjs";
|
|
24
24
|
import { dataTypeParams, requiredParamKeys, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
25
25
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
26
26
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|