@prisma/orm-target-postgres 8.0.0-rc.11-dev.29 → 8.0.0-rc.11-dev.30
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-bTD1EPrl-DQ66tQwz.mjs → adapter-bTD1EPrl-BOp2y3Vk.mjs} +2 -2
- package/dist/{adapter-bTD1EPrl-DQ66tQwz.mjs.map → adapter-bTD1EPrl-BOp2y3Vk.mjs.map} +1 -1
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.mjs +6 -2
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/{control-DDfLaDsG.mjs → control-BIGO0LQ1.mjs} +5 -5
- package/dist/{control-DDfLaDsG.mjs.map → control-BIGO0LQ1.mjs.map} +1 -1
- package/dist/{control-adapter-Bdz-Xa1p-rKiOVhsh.mjs → control-adapter-Bdz-Xa1p-97fNF5gu.mjs} +2 -2
- package/dist/{control-adapter-Bdz-Xa1p-rKiOVhsh.mjs.map → control-adapter-Bdz-Xa1p-97fNF5gu.mjs.map} +1 -1
- package/dist/{control-policy-B8x7UxGf-BjTez7am.mjs → control-policy-CkLZsw31-DjVVWnnz.mjs} +9 -10
- package/dist/control-policy-CkLZsw31-DjVVWnnz.mjs.map +1 -0
- package/dist/{diff-database-schema-BFX0ZWWK-KVfAPOLF.mjs → diff-database-schema-c9IWEO2V-DCnp7F4-.mjs} +3 -3
- package/dist/{diff-database-schema-BFX0ZWWK-KVfAPOLF.mjs.map → diff-database-schema-c9IWEO2V-DCnp7F4-.mjs.map} +1 -1
- package/dist/{infer-psl-contract-BaZaJAD9-DTVu5Zab.mjs → infer-psl-contract-CBsWEERT-CdfjzeCW.mjs} +3 -7
- package/dist/{infer-psl-contract-BaZaJAD9-DTVu5Zab.mjs.map → infer-psl-contract-CBsWEERT-CdfjzeCW.mjs.map} +1 -1
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{op-factory-call-B3-CevCo-CSV5SL9W.mjs → op-factory-call-Bp6F2UEs-Bze_DuAk.mjs} +3 -3
- package/dist/{op-factory-call-B3-CevCo-CSV5SL9W.mjs.map → op-factory-call-Bp6F2UEs-Bze_DuAk.mjs.map} +1 -1
- package/dist/{planner-C_TrM6kn-Dj1rgql2.mjs → planner-D9WzYlHl-CS_7pV8A.mjs} +6 -6
- package/dist/{planner-C_TrM6kn-Dj1rgql2.mjs.map → planner-D9WzYlHl-CS_7pV8A.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-CpXQ-J0X-CL5gNUSG.mjs → planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs} +4 -3
- package/dist/planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs.map +1 -0
- package/dist/{planner-produced-postgres-migration-CNmh50cN-qepqYtvL.mjs → planner-produced-postgres-migration-92hFiR1t-BxAT0uTi.mjs} +3 -3
- package/dist/{planner-produced-postgres-migration-CNmh50cN-qepqYtvL.mjs.map → planner-produced-postgres-migration-92hFiR1t-BxAT0uTi.mjs.map} +1 -1
- package/dist/{postgres-migration-CydbiBd3-BRXOU7KP.mjs → postgres-migration-BAGJ7FgH-4XbbekAu.mjs} +3 -3
- package/dist/{postgres-migration-CydbiBd3-BRXOU7KP.mjs.map → postgres-migration-BAGJ7FgH-4XbbekAu.mjs.map} +1 -1
- package/dist/{prisma7-binding-Db1xpliZ.mjs → prisma7-binding-BBC8EYpL.mjs} +2 -2
- package/dist/{prisma7-binding-Db1xpliZ.mjs.map → prisma7-binding-BBC8EYpL.mjs.map} +1 -1
- package/dist/target.mjs +9 -9
- package/dist/target__control.mjs +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.mjs +1 -1
- package/package.json +9 -9
- package/dist/control-policy-B8x7UxGf-BjTez7am.mjs.map +0 -1
- package/dist/planner-ddl-builders-CpXQ-J0X-CL5gNUSG.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-DsyAnn56-fBvRbPLM.mjs";
|
|
2
|
-
import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-Bdz-Xa1p-
|
|
2
|
+
import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-Bdz-Xa1p-97fNF5gu.mjs";
|
|
3
3
|
import { isDdlNode } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
5
5
|
//#region ../../../3-targets/6-adapters/postgres/dist/adapter-bTD1EPrl.mjs
|
|
@@ -92,4 +92,4 @@ function createPostgresAdapterWithCodecRegistry(codecRegistry) {
|
|
|
92
92
|
//#endregion
|
|
93
93
|
export { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };
|
|
94
94
|
|
|
95
|
-
//# sourceMappingURL=adapter-bTD1EPrl-
|
|
95
|
+
//# sourceMappingURL=adapter-bTD1EPrl-BOp2y3Vk.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-bTD1EPrl-
|
|
1
|
+
{"version":3,"file":"adapter-bTD1EPrl-BOp2y3Vk.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-bTD1EPrl.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-DsyAnn56.mjs\";\nimport { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from \"./control-adapter-Bdz-Xa1p.mjs\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { isDdlNode } from \"@internal/sql-relational-core/ast\";\n//#region src/core/adapter.ts\nconst defaultCapabilities = Object.freeze({\n\tpostgres: {\n\t\torderBy: true,\n\t\tlimit: true,\n\t\tlateral: true,\n\t\tjsonAgg: true,\n\t\treturning: true,\n\t\tdistinctOn: true\n\t},\n\tsql: {\n\t\tenums: true,\n\t\treturning: true,\n\t\tdefaultInInsert: true,\n\t\tlateral: true,\n\t\tscalarList: true,\n\t\tcheckConstraint: true\n\t}\n});\nvar PostgresAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\tprofile;\n\tcodecRegistry;\n\tconstructor(codecRegistry, profileId) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tconst controlAdapter = new PostgresControlAdapter(codecRegistry);\n\t\tthis.profile = Object.freeze({\n\t\t\tid: profileId ?? \"postgres/default@1\",\n\t\t\ttarget: \"postgres\",\n\t\t\tcapabilities: defaultCapabilities,\n\t\t\treadMarker: (queryable) => controlAdapter.readMarkerDiscriminated({\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tquery: async (sql, params) => {\n\t\t\t\t\tconst rows = [];\n\t\t\t\t\tfor await (const row of queryable.query({\n\t\t\t\t\t\tsql,\n\t\t\t\t\t\t...params === void 0 ? {} : { params }\n\t\t\t\t\t})) rows.push(row);\n\t\t\t\t\treturn { rows };\n\t\t\t\t},\n\t\t\t\tclose: async () => {}\n\t\t\t}, APP_SPACE_ID)\n\t\t});\n\t}\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw adapterError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() does not lower DDL on the runtime adapter — DDL lowering is a control-plane concern handled by the control adapter.\", { meta: { surface: \"runtime-adapter\" } });\n\t\treturn renderLoweredSql(ast, context.contract, this.codecRegistry);\n\t}\n};\nconst INT4_MIN = -2147483648;\nconst INT4_MAX = 2147483647;\n/**\n* The codec a bare JS number is bound through.\n*\n* An integer picks the narrowest column type that holds it: `int4` while it\n* fits the signed 32-bit range, `int8` (number-valued) up to the safe-integer\n* limit. Past that limit a JS number is no longer an exact integer, so it\n* binds as `float8` rather than pretending to a precision it does not have.\n*/\nfunction inferNumberCodecId(value) {\n\tif (!Number.isSafeInteger(value)) return \"pg/float8@1\";\n\treturn value >= INT4_MIN && value <= INT4_MAX ? \"pg/int4@1\" : \"pg/int8number@1\";\n}\n/**\n* Codec-id lookup for bare-literal interpolations used by `fns.raw` on a postgres client. Contributed as the descriptor's static `rawCodecInferer` slot.\n*\n* The ids are versioned because that is how the codec registry keys them: lowering resolves an interpolated value's codec by exact id through `descriptorFor`.\n*/\nconst postgresRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return inferNumberCodecId(value);\n\t\tcase \"bigint\": return \"pg/int8@1\";\n\t\tcase \"string\": return \"pg/text@1\";\n\t\tcase \"boolean\": return \"pg/bool@1\";\n\t\tcase \"object\": if (value instanceof Uint8Array) return \"pg/bytea@1\";\n\t}\n\tthrow adapterError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\", { meta: { valueType: typeof value } });\n} };\nfunction createPostgresAdapter(options) {\n\tconst codecRegistry = createPostgresCodecRegistryWithBuiltins(options?.codecDescriptors);\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry, options?.profileId));\n}\nfunction createPostgresAdapterWithCodecRegistry(codecRegistry) {\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry));\n}\n//#endregion\nexport { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };\n\n//# sourceMappingURL=adapter-bTD1EPrl.mjs.map"],"mappings":";;;;;AAKA,MAAM,sBAAsB,OAAO,OAAO;CACzC,UAAU;EACT,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,WAAW;EACX,YAAY;CACb;CACA,KAAK;EACJ,OA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AA6C,+GAA+G,EAAE,MAAM,EAAE,WAAW,OAAO,MAAM,EAAE,CAAC;AACrN,EAAE;AACF,SAAS,sBAAsB,SAAS;CACvC,MAAM,gBAAgB,wCAAwC,SAAS,gBAAgB;CACvF,OAAO,OAAO,OAAO,IAAI,oBAAoB,eAAe,SAAS,SAAS,CAAC;AAChF;AACA,SAAS,uCAAuC,eAAe;CAC9D,OAAO,OAAO,OAAO,IAAI,oBAAoB,aAAa,CAAC;AAC5D"}
|
package/dist/adapter.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sq
|
|
|
2
2
|
import { t as parsePostgresDefault } from "./default-normalizer-Bjtm2F4f-uV5vvkVt.mjs";
|
|
3
3
|
import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
|
|
4
4
|
import { n as renderLoweredSql } from "./sql-renderer-DsyAnn56-fBvRbPLM.mjs";
|
|
5
|
-
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-Bdz-Xa1p-
|
|
6
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-bTD1EPrl-
|
|
5
|
+
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-Bdz-Xa1p-97fNF5gu.mjs";
|
|
6
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-bTD1EPrl-BOp2y3Vk.mjs";
|
|
7
7
|
import { C as timestamptzTemporalColumn, E as varcharColumn, S as timestamptzStringColumn, T as varbitColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as timetzColumn, x as timestamptzJsDateColumn, y as timestampStringColumn } from "./column-types-B67GtMxQ.mjs";
|
|
8
8
|
export { PostgresControlAdapter, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, dateStringColumn, dateTemporalColumn, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzJsDateColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-bTD1EPrl-
|
|
1
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-bTD1EPrl-BOp2y3Vk.mjs";
|
|
2
2
|
export { createPostgresAdapter, postgresRawCodecInferer };
|
|
@@ -3,9 +3,9 @@ import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sq
|
|
|
3
3
|
import { t as parsePostgresDefault } from "./default-normalizer-Bjtm2F4f-uV5vvkVt.mjs";
|
|
4
4
|
import { i as instantNowControlDescriptor, o as plainDateTimeNowControlDescriptor } from "./authoring-DhCDnK1T-CGirVrrH.mjs";
|
|
5
5
|
import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
|
|
6
|
-
import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-Bdz-Xa1p-
|
|
6
|
+
import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-Bdz-Xa1p-97fNF5gu.mjs";
|
|
7
7
|
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-TrRobK4g-CQJJoHqf.mjs";
|
|
8
|
-
import { timestampNowControlDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
8
|
+
import { sqlDefaultLiteralTagEntry, timestampNowControlDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
9
9
|
import { int, num, oneOf, optional, str } from "@prisma/orm-framework/psl-parser";
|
|
10
10
|
import { builtinGeneratorRegistryMetadata } from "@prisma/orm-framework/ids";
|
|
11
11
|
//#region ../../../3-targets/6-adapters/postgres/dist/control.mjs
|
|
@@ -535,6 +535,9 @@ const postgresAuthoringTypes = {
|
|
|
535
535
|
function createPostgresDefaultFunctionRegistry() {
|
|
536
536
|
return new Map(postgresDefaultFunctionRegistryEntries);
|
|
537
537
|
}
|
|
538
|
+
function createPostgresDefaultLiteralTagRegistry() {
|
|
539
|
+
return /* @__PURE__ */ new Map([["sql", sqlDefaultLiteralTagEntry("sql`...`")], ["pg.sql", sqlDefaultLiteralTagEntry("pg.sql`...`")]]);
|
|
540
|
+
}
|
|
538
541
|
function createPostgresMutationDefaultGeneratorDescriptors() {
|
|
539
542
|
return [
|
|
540
543
|
...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({
|
|
@@ -554,6 +557,7 @@ const postgresAdapterDescriptor = {
|
|
|
554
557
|
},
|
|
555
558
|
controlMutationDefaults: {
|
|
556
559
|
defaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),
|
|
560
|
+
defaultLiteralTagRegistry: createPostgresDefaultLiteralTagRegistry(),
|
|
557
561
|
generatorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()
|
|
558
562
|
},
|
|
559
563
|
create(stack) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from \"./control-adapter-Bdz-Xa1p.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-TrRobK4g.mjs\";\nimport { instantNowControlDescriptor, plainDateTimeNowControlDescriptor } from \"@internal/target-postgres/control\";\nimport { parsePostgresDefault } from \"@internal/target-postgres/default-normalizer\";\nimport { normalizeSchemaNativeType } from \"@internal/target-postgres/native-type-normalizer\";\nimport { escapeLiteral, qualifyName, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { PG_TIMESTAMPTZ_DATE_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport { timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nfunction lowerDbgenerated(input) {\n\tconst expression = input.call.args[\"expression\"];\n\tif (typeof expression !== \"string\" || expression.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = { documentation: \"Uses the current database timestamp as the default value.\" };\nconst autoincrementSig = { documentation: \"Generates an increasing integer value in the database.\" };\nconst ulidSig = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst uuidSig = {\n\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: optional(oneOf(num(4), num(7))),\n\t\tdocumentation: \"The UUID version: `4` or `7`. Defaults to `4`.\"\n\t}]\n};\nconst cuidSig = {\n\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: num(2),\n\t\tdocumentation: \"The CUID version. Only `2` is supported.\"\n\t}]\n};\nconst nanoidSig = {\n\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"size\",\n\t\ttype: optional(int({\n\t\t\tmin: 2,\n\t\t\tmax: 255\n\t\t})),\n\t\tdocumentation: \"The identifier length, from `2` through `255`. Omit to use the generator default.\"\n\t}]\n};\nconst dbgeneratedSig = {\n\tdocumentation: \"Uses a database SQL expression as the default value.\",\n\tpositional: [{\n\t\tkey: \"expression\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty SQL expression evaluated by the database.\"\n\t}]\n};\nconst postgresDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tsignature: dbgeneratedSig,\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@default(uuid())`) never re-picks a column's storage.\n*/\nconst postgresScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text stored as PostgreSQL text.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/text@1\",\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A true or false value stored as PostgreSQL boolean.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 32-bit integer represented as a JavaScript number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int4@1\",\n\t\t\tnativeType: \"int4\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 64-bit integer represented as a JavaScript bigint.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A double-precision floating-point number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float8@1\",\n\t\t\tnativeType: \"float8\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An exact decimal value stored as PostgreSQL numeric.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as PostgreSQL timestamptz and represented as Temporal.Instant.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value stored as PostgreSQL json.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/json@1\",\n\t\t\tnativeType: \"json\"\n\t\t}\n\t},\n\tJsonb: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value stored in PostgreSQL binary jsonb format.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/jsonb@1\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Binary data stored as PostgreSQL bytea.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bytea@1\",\n\t\t\tnativeType: \"bytea\"\n\t\t}\n\t}\n};\nconst postgresNativeAuthoringTypes = {\n\tVarChar: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text with an optional maximum character length.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\tnativeType: \"character varying\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tChar: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Fixed-length, blank-padded text with an optional character length.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/char@1\",\n\t\t\tnativeType: \"character\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tNumeric: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An exact decimal value with optional precision and scale.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"number\",\n\t\t\tname: \"scale\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\",\n\t\t\ttypeParams: {\n\t\t\t\tprecision: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t},\n\t\t\t\tscale: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tTimestamp: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A date and time without a time zone, represented as Temporal.PlainDateTime.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-temporal@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptz: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant represented as Temporal.Instant, with optional fractional-second precision.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day without a time zone, represented as Temporal.PlainTime.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-temporal@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimetz: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day with a UTC offset stored as PostgreSQL timetz.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timetz@1\",\n\t\t\tnativeType: \"timetz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tUuid: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A universally unique identifier stored as PostgreSQL uuid.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\tnativeType: \"uuid\"\n\t\t}\n\t},\n\tInet: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An IPv4 or IPv6 address with an optional subnet mask.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/inet@1\",\n\t\t\tnativeType: \"inet\"\n\t\t}\n\t},\n\tSmallInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 16-bit integer represented as a JavaScript number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int2@1\",\n\t\t\tnativeType: \"int2\"\n\t\t}\n\t},\n\tReal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A single-precision floating-point number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float4@1\",\n\t\t\tnativeType: \"float4\"\n\t\t}\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date represented as Temporal.PlainDate.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-temporal@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A PostgreSQL date represented as database text rather than Temporal.PlainDate.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-string@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tTimestampString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A timestamp without a time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-string@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzJsDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as PostgreSQL timestamptz and represented as a JavaScript Date.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A timestamp with time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-string@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimeString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day without a time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-string@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t}\n};\nconst postgresAuthoringTypes = {\n\t...postgresScalarAuthoringTypes,\n\t...postgresNativeAuthoringTypes\n};\nfunction createPostgresDefaultFunctionRegistry() {\n\treturn new Map(postgresDefaultFunctionRegistryEntries);\n}\nfunction createPostgresMutationDefaultGeneratorDescriptors() {\n\treturn [\n\t\t...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\t\tid,\n\t\t\tapplicableCodecIds\n\t\t})),\n\t\ttimestampNowControlDescriptor(),\n\t\tinstantNowControlDescriptor(),\n\t\tplainDateTimeNowControlDescriptor()\n\t];\n}\n//#endregion\n//#region src/exports/control.ts\nconst postgresAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tvalueObjectStorageType: \"Jsonb\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new PostgresControlAdapter(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,0BAA0B,OAAO;CACzC,OAAO;EACN,IAAI;EACJ,YAAY;GACX,MAAM;GACN,SAAS,MAAM;GACf,UAAU,MAAM,QAAQ;GACxB,MAAM,MAAM;EACb;CACD;AACD;AACA,SAAS,mBAAmB,IAAI,QAAQ;CACvC,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,WAAW;IACV,MAAM;IACN;IACA,GAAG,SAAS,EAAE,OAAO,IAAI,CAAC;GAC3B;EACD;CACD;AACD;AACA,SAAS,qBAAqB;CAC7B,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,WAAW;CACnB,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,MAAM;AACjC;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,MAAM,KAAK,KAAK,eAAe,IAAI,mBAAmB,QAAQ,IAAI,mBAAmB,QAAQ;AACrG;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,OAAO;AAClC;AACA,SAAS,YAAY,OAAO;CAC3B,MAAM,OAAO,MAAM,KAAK,KAAK;CAC7B,OAAO,OAAO,SAAS,WAAW,mBAAmB,UAAU,EAAE,KAAK,CAAC,IAAI,mBAAmB,QAAQ;AACvG;AACA,SAAS,iBAAiB,OAAO;CAChC,MAAM,aAAa,MAAM,KAAK,KAAK;CACnC,IAAI,OAAO,eAAe,YAAY,WAAW,KAAK,CAAC,CAAC,WAAW,GAAG,OAAO,0BAA0B;EACtG,SAAS,MAAM;EACf,MAAM,MAAM,KAAK;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AM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY;GACZ,YAAY,EAAE,WAAW;IACxB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;AACD;AACA,MAAM,yBAAyB;CAC9B,GAAG;CACH,GAAG;AACJ;AACA,SAAS,wCAAwC;CAChD,OAAO,IAAI,IAAI,sCAAsC;AACtD;AACA,SAAS,oDAAoD;CAC5D,OAAO;EACN,GAAG,iCAAiC,KAAK,EAAE,IAAI,0BAA0B;GACxE;GACA;EACD,EAAE;EACF,8BAA8B;EAC9B,4BAA4B;EAC5B,kCAAkC;CACnC;AACD;AAGA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,wBAAwB;CACzB;CACA,yBAAyB;EACxB,yBAAyB,sCAAsC;EAC/D,sBAAsB,kDAAkD;CACzE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,uBAAuB,8BAA8B;GAC/D,MAAM;GACN,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
|
|
1
|
+
{"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from \"./control-adapter-Bdz-Xa1p.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-TrRobK4g.mjs\";\nimport { instantNowControlDescriptor, plainDateTimeNowControlDescriptor } from \"@internal/target-postgres/control\";\nimport { parsePostgresDefault } from \"@internal/target-postgres/default-normalizer\";\nimport { normalizeSchemaNativeType } from \"@internal/target-postgres/native-type-normalizer\";\nimport { escapeLiteral, qualifyName, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { PG_TIMESTAMPTZ_DATE_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport { sqlDefaultLiteralTagEntry, timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nfunction lowerDbgenerated(input) {\n\tconst expression = input.call.args[\"expression\"];\n\tif (typeof expression !== \"string\" || expression.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = { documentation: \"Uses the current database timestamp as the default value.\" };\nconst autoincrementSig = { documentation: \"Generates an increasing integer value in the database.\" };\nconst ulidSig = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst uuidSig = {\n\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: optional(oneOf(num(4), num(7))),\n\t\tdocumentation: \"The UUID version: `4` or `7`. Defaults to `4`.\"\n\t}]\n};\nconst cuidSig = {\n\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: num(2),\n\t\tdocumentation: \"The CUID version. Only `2` is supported.\"\n\t}]\n};\nconst nanoidSig = {\n\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"size\",\n\t\ttype: optional(int({\n\t\t\tmin: 2,\n\t\t\tmax: 255\n\t\t})),\n\t\tdocumentation: \"The identifier length, from `2` through `255`. Omit to use the generator default.\"\n\t}]\n};\nconst dbgeneratedSig = {\n\tdocumentation: \"Uses a database SQL expression as the default value.\",\n\tpositional: [{\n\t\tkey: \"expression\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty SQL expression evaluated by the database.\"\n\t}]\n};\nconst postgresDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tsignature: dbgeneratedSig,\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@default(uuid())`) never re-picks a column's storage.\n*/\nconst postgresScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text stored as PostgreSQL text.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/text@1\",\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A true or false value stored as PostgreSQL boolean.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 32-bit integer represented as a JavaScript number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int4@1\",\n\t\t\tnativeType: \"int4\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 64-bit integer represented as a JavaScript bigint.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A double-precision floating-point number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float8@1\",\n\t\t\tnativeType: \"float8\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An exact decimal value stored as PostgreSQL numeric.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as PostgreSQL timestamptz and represented as Temporal.Instant.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value stored as PostgreSQL json.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/json@1\",\n\t\t\tnativeType: \"json\"\n\t\t}\n\t},\n\tJsonb: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value stored in PostgreSQL binary jsonb format.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/jsonb@1\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Binary data stored as PostgreSQL bytea.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bytea@1\",\n\t\t\tnativeType: \"bytea\"\n\t\t}\n\t}\n};\nconst postgresNativeAuthoringTypes = {\n\tVarChar: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text with an optional maximum character length.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\tnativeType: \"character varying\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tChar: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Fixed-length, blank-padded text with an optional character length.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/char@1\",\n\t\t\tnativeType: \"character\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tNumeric: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An exact decimal value with optional precision and scale.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"number\",\n\t\t\tname: \"scale\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\",\n\t\t\ttypeParams: {\n\t\t\t\tprecision: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t},\n\t\t\t\tscale: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tTimestamp: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A date and time without a time zone, represented as Temporal.PlainDateTime.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-temporal@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptz: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant represented as Temporal.Instant, with optional fractional-second precision.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day without a time zone, represented as Temporal.PlainTime.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-temporal@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimetz: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day with a UTC offset stored as PostgreSQL timetz.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timetz@1\",\n\t\t\tnativeType: \"timetz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tUuid: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A universally unique identifier stored as PostgreSQL uuid.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\tnativeType: \"uuid\"\n\t\t}\n\t},\n\tInet: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An IPv4 or IPv6 address with an optional subnet mask.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/inet@1\",\n\t\t\tnativeType: \"inet\"\n\t\t}\n\t},\n\tSmallInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 16-bit integer represented as a JavaScript number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int2@1\",\n\t\t\tnativeType: \"int2\"\n\t\t}\n\t},\n\tReal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A single-precision floating-point number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float4@1\",\n\t\t\tnativeType: \"float4\"\n\t\t}\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date represented as Temporal.PlainDate.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-temporal@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A PostgreSQL date represented as database text rather than Temporal.PlainDate.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-string@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tTimestampString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A timestamp without a time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-string@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzJsDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as PostgreSQL timestamptz and represented as a JavaScript Date.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A timestamp with time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-string@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimeString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day without a time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-string@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t}\n};\nconst postgresAuthoringTypes = {\n\t...postgresScalarAuthoringTypes,\n\t...postgresNativeAuthoringTypes\n};\nfunction createPostgresDefaultFunctionRegistry() {\n\treturn new Map(postgresDefaultFunctionRegistryEntries);\n}\nfunction createPostgresDefaultLiteralTagRegistry() {\n\treturn /* @__PURE__ */ new Map([[\"sql\", sqlDefaultLiteralTagEntry(\"sql`...`\")], [\"pg.sql\", sqlDefaultLiteralTagEntry(\"pg.sql`...`\")]]);\n}\nfunction createPostgresMutationDefaultGeneratorDescriptors() {\n\treturn [\n\t\t...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\t\tid,\n\t\t\tapplicableCodecIds\n\t\t})),\n\t\ttimestampNowControlDescriptor(),\n\t\tinstantNowControlDescriptor(),\n\t\tplainDateTimeNowControlDescriptor()\n\t];\n}\n//#endregion\n//#region src/exports/control.ts\nconst postgresAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tvalueObjectStorageType: \"Jsonb\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n\t\tdefaultLiteralTagRegistry: createPostgresDefaultLiteralTagRegistry(),\n\t\tgeneratorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new PostgresControlAdapter(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;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ACR,EAAE;EACH;CACD;AACD;AACA,MAAM,yBAAyB;CAC9B,GAAG;CACH,GAAG;AACJ;AACA,SAAS,wCAAwC;CAChD,OAAO,IAAI,IAAI,sCAAsC;AACtD;AACA,SAAS,0CAA0C;CAClD,uBAAuB,IAAI,IAAI,CAAC,CAAC,OAAO,0BAA0B,UAAU,CAAC,GAAG,CAAC,UAAU,0BAA0B,aAAa,CAAC,CAAC,CAAC;AACtI;AACA,SAAS,oDAAoD;CAC5D,OAAO;EACN,GAAG,iCAAiC,KAAK,EAAE,IAAI,0BAA0B;GACxE;GACA;EACD,EAAE;EACF,8BAA8B;EAC9B,4BAA4B;EAC5B,kCAAkC;CACnC;AACD;AAGA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,wBAAwB;CACzB;CACA,yBAAyB;EACxB,yBAAyB,sCAAsC;EAC/D,2BAA2B,wCAAwC;EACnE,sBAAsB,kDAAkD;CACzE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,uBAAuB,8BAA8B;GAC/D,MAAM;GACN,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as postgresCodecRegistry } from "./codecs-BrJWpXPJ.mjs";
|
|
2
2
|
import { a as plainDateTimeNow, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, r as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-DhCDnK1T-CGirVrrH.mjs";
|
|
3
|
-
import { n as assemblePostgresCodecRegistry } from "./control-adapter-Bdz-Xa1p-
|
|
4
|
-
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-bTD1EPrl-
|
|
3
|
+
import { n as assemblePostgresCodecRegistry } from "./control-adapter-Bdz-Xa1p-97fNF5gu.mjs";
|
|
4
|
+
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-bTD1EPrl-BOp2y3Vk.mjs";
|
|
5
5
|
import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta-TrRobK4g-CQJJoHqf.mjs";
|
|
6
6
|
import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
|
|
7
7
|
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
|
|
@@ -3,11 +3,11 @@ import { n as postgresResolveDefault } from "./default-normalizer-Bjtm2F4f-uV5vv
|
|
|
3
3
|
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-CQMRNeLX-CF4MvmN_.mjs";
|
|
4
4
|
import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
5
5
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
6
|
-
import { r as renderDefaultLiteral } from "./planner-ddl-builders-
|
|
7
|
-
import { n as contractToPostgresDatabaseSchemaNode, r as diffPostgresSchema } from "./diff-database-schema-
|
|
6
|
+
import { r as renderDefaultLiteral } from "./planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs";
|
|
7
|
+
import { n as contractToPostgresDatabaseSchemaNode, r as diffPostgresSchema } from "./diff-database-schema-c9IWEO2V-DCnp7F4-.mjs";
|
|
8
8
|
import { t as PostgresContractSerializer } from "./postgres-contract-view-BPe8r8jN-DrorQoWW.mjs";
|
|
9
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
10
|
-
import { i as inferPostgresPslContract } from "./infer-psl-contract-
|
|
9
|
+
import { t as createPostgresMigrationPlanner } from "./planner-D9WzYlHl-CS_7pV8A.mjs";
|
|
10
|
+
import { i as inferPostgresPslContract } from "./infer-psl-contract-CBsWEERT-CdfjzeCW.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";
|
|
@@ -467,4 +467,4 @@ const postgresTargetDescriptor = {
|
|
|
467
467
|
//#endregion
|
|
468
468
|
export { postgresTargetDescriptor as n, postgresRenderDefault as t };
|
|
469
469
|
|
|
470
|
-
//# sourceMappingURL=control-
|
|
470
|
+
//# sourceMappingURL=control-BIGO0LQ1.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-DDfLaDsG.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/control.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { n as postgresResolveDefault } from \"./default-normalizer-Bjtm2F4f.mjs\";\nimport { c as PLAIN_DATE_TIME_NOW_GENERATOR_ID, d as INSTANT_NOW_GENERATOR_ID, p as instantNowControlDescriptor, u as plainDateTimeNowControlDescriptor } from \"./authoring-DhCDnK1T.mjs\";\nimport { t as postgresTargetDescriptorMeta } from \"./descriptor-meta-CQMRNeLX.mjs\";\nimport { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { n as diffPostgresSchema, r as contractToPostgresDatabaseSchemaNode } from \"./diff-database-schema-BFX0ZWWK.mjs\";\nimport { r as renderDefaultLiteral } from \"./planner-ddl-builders-CpXQ-J0X.mjs\";\nimport { n as PostgresContractSerializer } from \"./postgres-contract-view-BPe8r8jN.mjs\";\nimport { t as createPostgresMigrationPlanner } from \"./planner-C_TrM6kn.mjs\";\nimport { n as inferPostgresPslContract } from \"./infer-psl-contract-BaZaJAD9.mjs\";\nimport { n as parsePostgresListText, t as decodePostgresListText } from \"./list-decoder-DXee1orj.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { buildNativeTypeExpander, runnerFailure, runnerSuccess } from \"@internal/family-sql/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { SqlSchemaVerifierBase } from \"@internal/family-sql/ir\";\nimport { SqlQueryError } from \"@internal/sql-errors\";\n//#region src/core/migrations/runner.ts\nconst LOCK_DOMAIN = \"prisma_8.contract.marker\";\n/**\n* Deep clones and freezes a record object to prevent mutation.\n* Recursively clones nested objects and arrays to ensure complete isolation.\n*/\nfunction cloneAndFreezeRecord(value) {\n\tconst cloned = {};\n\tfor (const [key, val] of Object.entries(value)) if (val === null || val === void 0) cloned[key] = val;\n\telse if (Array.isArray(val)) cloned[key] = Object.freeze([...val]);\n\telse if (typeof val === \"object\") cloned[key] = cloneAndFreezeRecord(val);\n\telse cloned[key] = val;\n\treturn Object.freeze(cloned);\n}\nfunction createPostgresMigrationRunner(family) {\n\treturn new PostgresMigrationRunner(family);\n}\nvar PostgresMigrationRunner = class {\n\tfamily;\n\tconstructor(family) {\n\t\tthis.family = family;\n\t}\n\t/**\n\t* Body of the migration runner without transaction management. The\n\t* caller ({@link PostgresMigrationRunner.execute}) owns the\n\t* `BEGIN`/`COMMIT`/`ROLLBACK` lifecycle.\n\t*/\n\tasync executeOnConnection(options) {\n\t\tconst schema = options.schemaName ?? Object.keys(options.destinationContract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;\n\t\tconst driver = options.driver;\n\t\tif (options.space !== void 0 && options.space !== options.plan.spaceId) throw postgresError(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {\n\t\t\tspace: options.space,\n\t\t\tplanSpaceId: options.plan.spaceId\n\t\t} });\n\t\tconst space = options.plan.spaceId;\n\t\tconst lockKey = `${LOCK_DOMAIN}:${schema}:${space}`;\n\t\tconst planOps = blindCast(await Promise.all(options.plan.operations));\n\t\tconst destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);\n\t\tif (!destinationCheck.ok) return destinationCheck;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, planOps);\n\t\tif (!policyCheck.ok) return policyCheck;\n\t\tawait this.acquireLock(driver, lockKey);\n\t\tconst ensureResult = await this.ensureControlTables(driver, options.destinationContract);\n\t\tif (!ensureResult.ok) return ensureResult;\n\t\tconst existingMarker = await this.family.readMarker({\n\t\t\tdriver,\n\t\t\tspace\n\t\t});\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (!markerCheck.ok) return markerCheck;\n\t\tconst markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);\n\t\tconst isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;\n\t\tconst skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;\n\t\tlet applyValue;\n\t\tif (skipOperations) applyValue = {\n\t\t\toperationsExecuted: 0,\n\t\t\texecutedOperations: []\n\t\t};\n\t\telse {\n\t\t\tconst applyResult = await this.applyPlan(driver, options, planOps);\n\t\t\tif (!applyResult.ok) return applyResult;\n\t\t\tapplyValue = applyResult.value;\n\t\t}\n\t\tif (space === APP_SPACE_ID) {\n\t\t\tconst schemaNode = await this.family.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract: options.destinationContract\n\t\t\t});\n\t\t\tconst schemaVerifyResult = this.family.verifySchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tschema: schemaNode,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t\tif (!schemaVerifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", schemaVerifyResult.summary, {\n\t\t\t\twhy: \"The resulting database schema does not satisfy the destination contract.\",\n\t\t\t\tmeta: { issues: schemaVerifyResult.schema.issues }\n\t\t\t});\n\t\t}\n\t\tconst incomingInvariants = options.plan.providedInvariants ?? [];\n\t\tconst existingInvariants = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariants.has(id));\n\t\tif (!(isSelfEdge && applyValue.operationsExecuted === 0 && incomingIsSubsetOfExisting)) {\n\t\t\tconst markerResult = await this.upsertMarker(driver, options, existingMarker, space);\n\t\t\tif (!markerResult.ok) return markerResult;\n\t\t\tawait this.recordLedgerEntries(driver, options, applyValue.executedOperations, planOps.length);\n\t\t}\n\t\treturn runnerSuccess({\n\t\t\toperationsPlanned: planOps.length,\n\t\t\toperationsExecuted: applyValue.operationsExecuted\n\t\t});\n\t}\n\tasync execute(options) {\n\t\tconst driver = options.driver;\n\t\tconst perSpaceOptions = options.perSpaceOptions;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\tawait this.beginTransaction(driver);\n\t\tlet committed = false;\n\t\ttry {\n\t\t\tconst perSpaceResults = [];\n\t\t\tfor (const spaceOptions of perSpaceOptions) {\n\t\t\t\tconst space = spaceOptions.space ?? spaceOptions.plan.spaceId;\n\t\t\t\tconst result = await this.executeOnConnection({\n\t\t\t\t\t...spaceOptions,\n\t\t\t\t\tdriver,\n\t\t\t\t\tspace\n\t\t\t\t});\n\t\t\t\tif (!result.ok) return notOk({\n\t\t\t\t\t...result.failure,\n\t\t\t\t\tfailingSpace: space\n\t\t\t\t});\n\t\t\t\tperSpaceResults.push({\n\t\t\t\t\tspace,\n\t\t\t\t\tvalue: result.value\n\t\t\t\t});\n\t\t\t}\n\t\t\tawait this.commitTransaction(driver);\n\t\t\tcommitted = true;\n\t\t\treturn ok({ perSpaceResults });\n\t\t} finally {\n\t\t\tif (!committed) await this.rollbackTransaction(driver);\n\t\t}\n\t}\n\tasync applyPlan(driver, options, ops) {\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tlet operationsExecuted = 0;\n\t\tconst executedOperations = [];\n\t\tfor (const operation of ops) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.expectationsAreSatisfied(driver, operation.postcheck)) {\n\t\t\t\t\t\texecutedOperations.push(this.createPostcheckPreSatisfiedSkipRecord(operation));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst precheckResult = await this.runExpectationSteps(driver, operation.precheck, operation, \"precheck\");\n\t\t\t\t\tif (!precheckResult.ok) return precheckResult;\n\t\t\t\t}\n\t\t\t\tconst executeResult = await this.runExecuteSteps(driver, operation.execute, operation);\n\t\t\t\tif (!executeResult.ok) return executeResult;\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst postcheckResult = await this.runExpectationSteps(driver, operation.postcheck, operation, \"postcheck\");\n\t\t\t\t\tif (!postcheckResult.ok) return postcheckResult;\n\t\t\t\t}\n\t\t\t\texecutedOperations.push(operation);\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\treturn ok({\n\t\t\toperationsExecuted,\n\t\t\texecutedOperations\n\t\t});\n\t}\n\tasync ensureControlTables(driver, contract) {\n\t\tconst lowererContext = { contract };\n\t\tconst [schemaQuery, ...tableQueries] = this.family.bootstrapControlTableQueries();\n\t\tif (schemaQuery === void 0) throw new InternalError(\"Postgres control-table bootstrap must include CREATE SCHEMA\");\n\t\tawait this.executeStatement(driver, await this.family.lowerAst(schemaQuery, lowererContext));\n\t\tconst legacyDetection = await this.detectLegacyMarkerShape(driver);\n\t\tif (!legacyDetection.ok) return legacyDetection;\n\t\tfor (const query of tableQueries) await this.executeStatement(driver, await this.family.lowerAst(query, lowererContext));\n\t\treturn okVoid();\n\t}\n\tasync detectLegacyMarkerShape(driver) {\n\t\tconst result = await driver.query(`select column_name\n from information_schema.columns\n where table_schema = 'prisma_contract'\n and table_name = 'marker'`);\n\t\tif (result.rows.length === 0) return okVoid();\n\t\tconst columns = new Set(result.rows.map((row) => row.column_name));\n\t\tif (columns.has(\"space\")) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.LEGACY_MARKER_SHAPE\", \"Legacy marker-table shape detected on prisma_contract.marker (no `space` column). Prisma 8 is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop `prisma_contract.marker` and re-run `dbInit` to reinitialise from a clean baseline.\", { meta: {\n\t\t\ttable: \"prisma_contract.marker\",\n\t\t\tcolumns: [...columns].sort()\n\t\t} });\n\t}\n\tasync runExpectationSteps(driver, steps, operation, phase) {\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return runnerFailure(phase === \"precheck\" ? \"MIGRATION.PRECHECK_FAILED\" : \"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during ${phase}: ${step.description}`, { meta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\tphase,\n\t\t\t\tstepDescription: step.description\n\t\t\t} });\n\t\t}\n\t\treturn okVoid();\n\t}\n\tasync runExecuteSteps(driver, steps, operation) {\n\t\tfor (const step of steps) try {\n\t\t\tawait driver.query(step.sql, step.params ?? []);\n\t\t} catch (error) {\n\t\t\tif (SqlQueryError.is(error)) return runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${operation.id} failed during execution: ${step.description}`, {\n\t\t\t\twhy: error.message,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql,\n\t\t\t\t\tsqlState: error.sqlState,\n\t\t\t\t\tconstraint: error.constraint,\n\t\t\t\t\ttable: error.table,\n\t\t\t\t\tcolumn: error.column,\n\t\t\t\t\tdetail: error.detail\n\t\t\t\t}\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\treturn okVoid();\n\t}\n\tstepResultIsTrue(rows) {\n\t\tif (!rows || rows.length === 0) return false;\n\t\tconst firstRow = rows[0];\n\t\tconst firstValue = firstRow ? Object.values(firstRow)[0] : void 0;\n\t\tif (typeof firstValue === \"boolean\") return firstValue;\n\t\tif (typeof firstValue === \"number\") return firstValue !== 0;\n\t\tif (typeof firstValue === \"string\") {\n\t\t\tconst lower = firstValue.toLowerCase();\n\t\t\tif (lower === \"t\" || lower === \"true\" || lower === \"1\") return true;\n\t\t\tif (lower === \"f\" || lower === \"false\" || lower === \"0\") return false;\n\t\t\treturn firstValue.length > 0;\n\t\t}\n\t\treturn Boolean(firstValue);\n\t}\n\tasync expectationsAreSatisfied(driver, steps) {\n\t\tif (steps.length === 0) return false;\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tcreatePostcheckPreSatisfiedSkipRecord(operation) {\n\t\tconst clonedMeta = operation.meta ? cloneAndFreezeRecord(operation.meta) : void 0;\n\t\tconst runnerMeta = Object.freeze({\n\t\t\tskipped: true,\n\t\t\treason: \"postcheck_pre_satisfied\"\n\t\t});\n\t\tconst mergedMeta = Object.freeze({\n\t\t\t...clonedMeta ?? {},\n\t\t\trunner: runnerMeta\n\t\t});\n\t\tconst frozenPostcheck = Object.freeze([...operation.postcheck]);\n\t\treturn Object.freeze({\n\t\t\tid: operation.id,\n\t\t\tlabel: operation.label,\n\t\t\t...ifDefined(\"summary\", operation.summary),\n\t\t\toperationClass: operation.operationClass,\n\t\t\ttarget: operation.target,\n\t\t\tprecheck: Object.freeze([]),\n\t\t\texecute: Object.freeze([]),\n\t\t\tpostcheck: frozenPostcheck,\n\t\t\t...ifDefined(\"meta\", operation.meta || mergedMeta ? mergedMeta : void 0)\n\t\t});\n\t}\n\tmarkerMatchesDestination(marker, plan) {\n\t\tif (!marker) return false;\n\t\tif (marker.storageHash !== plan.destination.storageHash) return false;\n\t\tif (plan.destination.profileHash && marker.profileHash !== plan.destination.profileHash) return false;\n\t\treturn true;\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${policy.allowedOperationClasses.join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass,\n\t\t\t\tallowedClasses: policy.allowedOperationClasses\n\t\t\t}\n\t\t});\n\t\treturn okVoid();\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return okVoid();\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t\tif (origin.profileHash && marker.profileHash !== origin.profileHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`, { meta: {\n\t\t\tmarkerProfileHash: marker.profileHash,\n\t\t\texpectedOriginProfileHash: origin.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tensurePlanMatchesDestinationContract(destination, contract) {\n\t\tif (destination.storageHash !== contract.storage.storageHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`, { meta: {\n\t\t\tplanStorageHash: destination.storageHash,\n\t\t\tcontractStorageHash: contract.storage.storageHash\n\t\t} });\n\t\tif (destination.profileHash && contract.profileHash && destination.profileHash !== contract.profileHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`, { meta: {\n\t\t\tplanProfileHash: destination.profileHash,\n\t\t\tcontractProfileHash: contract.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync upsertMarker(driver, options, existingMarker, space) {\n\t\tconst destination = {\n\t\t\tstorageHash: options.plan.destination.storageHash,\n\t\t\tprofileHash: options.plan.destination.profileHash ?? options.destinationContract.profileHash ?? options.plan.destination.storageHash,\n\t\t\tinvariants: options.plan.providedInvariants ?? []\n\t\t};\n\t\tif (!existingMarker) {\n\t\t\tawait this.family.initMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tdestination\n\t\t\t});\n\t\t\treturn okVoid();\n\t\t}\n\t\tif (!await this.family.updateMarker({\n\t\t\tdriver,\n\t\t\tspace,\n\t\t\texpectedFrom: existingMarker.storageHash,\n\t\t\tdestination\n\t\t})) return runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\tspace,\n\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\tdestinationStorageHash: options.plan.destination.storageHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync recordLedgerEntries(driver, options, executedOperations, planOpsLength) {\n\t\tconst space = options.plan.spaceId;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== planOpsLength) throw new InternalError(`Ledger write: plan.operations length (${planOpsLength}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = executedOperations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait this.family.writeLedgerEntry({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tentry: {\n\t\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\t\tfrom: edge.from,\n\t\t\t\t\tto: edge.to,\n\t\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\t\toperations: edgeOps,\n\t\t\t\t\t...ifDefined(\"destinationContractJson\", edge.destinationContractJson)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tasync acquireLock(driver, key) {\n\t\tawait driver.query(\"select pg_advisory_xact_lock(hashtext($1))\", [key]);\n\t}\n\tasync beginTransaction(driver) {\n\t\tawait driver.query(\"BEGIN\");\n\t}\n\tasync commitTransaction(driver) {\n\t\tawait driver.query(\"COMMIT\");\n\t}\n\tasync rollbackTransaction(driver) {\n\t\tawait driver.query(\"ROLLBACK\");\n\t}\n\tasync executeStatement(driver, statement) {\n\t\tawait driver.query(statement.sql, statement.params);\n\t}\n};\n//#endregion\n//#region src/core/postgres-schema-verifier.ts\n/**\n* Postgres target `SchemaVerifier` concretion. Plugs into the\n* SQL-shared verification surface; production verification today still\n* routes through the family verify verdict (`verifySqlSchemaByDiff` over\n* `diffPostgresSchema`), which carries options (codec hooks,\n* normalizers, framework components) that the framework-level\n* `SchemaVerifyOptions` shape does not yet surface.\n*\n* The hooks return the empty list pending the call-site migration that\n* routes the existing verifier behaviour through the SPI — at that\n* point `verifyCommonSqlSchema` will likely lift onto the family base\n* (mirroring `verifyCommonMongoSchema`) and `verifyTargetExtensions`\n* will house Postgres-only kinds (functions, RLS policies in a future\n* project).\n*/\nvar PostgresSchemaVerifier = class extends SqlSchemaVerifierBase {\n\tverifyCommonSqlSchema(_options) {\n\t\treturn [];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\nfunction postgresRenderDefault(def, column) {\n\tif (def.kind === \"function\") return def.expression;\n\treturn renderDefaultLiteral(def.value, column);\n}\nconst postgresTargetDescriptor = {\n\t...postgresTargetDescriptorMeta,\n\tcontractSerializer: new PostgresContractSerializer(),\n\tschemaVerifier: new PostgresSchemaVerifier(),\n\tinferPslContract(schema, describedContracts) {\n\t\tPostgresDatabaseSchemaNode.assert(schema);\n\t\treturn inferPostgresPslContract(schema, describedContracts);\n\t},\n\tdiffSchema(input) {\n\t\treturn diffPostgresSchema(input);\n\t},\n\tclassifySubjectGranularity: postgresDiffSubjectGranularity,\n\tclassifyEntityKind: postgresDiffSubjectEntityKind,\n\tmigrations: {\n\t\tcreatePlanner(adapter) {\n\t\t\treturn createPostgresMigrationPlanner(adapter);\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\treturn createPostgresMigrationRunner(family);\n\t\t},\n\t\tcontractToSchema(contract, frameworkComponents) {\n\t\t\tconst expander = buildNativeTypeExpander(frameworkComponents);\n\t\t\treturn contractToPostgresDatabaseSchemaNode(blindCast(contract), {\n\t\t\t\tannotationNamespace: \"pg\",\n\t\t\t\t...ifDefined(\"expandNativeType\", expander),\n\t\t\t\trenderDefault: postgresRenderDefault,\n\t\t\t\tresolveDefault: postgresResolveDefault\n\t\t\t});\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t},\n\t/**\n\t* Direct method for SQL-specific usage.\n\t* @deprecated Use migrations.createPlanner() for CLI compatibility.\n\t*/\n\tcreatePlanner(adapter) {\n\t\treturn createPostgresMigrationPlanner(adapter);\n\t},\n\t/**\n\t* Direct method for SQL-specific usage.\n\t* @deprecated Use migrations.createRunner() for CLI compatibility.\n\t*/\n\tcreateRunner(family) {\n\t\treturn createPostgresMigrationRunner(family);\n\t}\n};\n//#endregion\nexport { INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, decodePostgresListText, postgresTargetDescriptor as default, instantNowControlDescriptor, parsePostgresListText, plainDateTimeNowControlDescriptor, postgresRenderDefault };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,cAAc;;;;;AAKpB,SAAS,qBAAqB,OAAO;CACpC,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,KAAK,GAAG,IAAI,QAAQ,QAAQ,QAAQ,KAAK,GAAG,OAAO,OAAO;MAC7F,IAAI,MAAM,QAAQ,GAAG,GAAG,OAAO,OAAO,OAAO,OAAO,CAAC,GAAG,GAAG,CAAC;MAC5D,IAAI,OAAO,QAAQ,UAAU,OAAO,OAAO,qBAAqB,GAAG;MACnE,OAAO,OAAO;CACnB,OAAO,OAAO,OAAO,MAAM;AAC5B;AACA,SAAS,8BAA8B,QAAQ;CAC9C,OAAO,IAAI,wBAAwB,MAAM;AAC1C;AACA,IAAI,0BAA0B,MAAM;CACnC;CACA,YAAY,QAAQ;EACnB,KAAK,SAAS;CACf;;;;;;CAMA,MAAM,oBAAoB,SAAS;EAClC,MAAM,SAAS,QAAQ,cAAc,OAAO,KAAK,QAAQ,oBAAoB,QAAQ,UAAU,CAAC,CAAC,MAAM,OAAO,OAAO,oBAAoB,KAAK;EAC9I,MAAM,SAAS,QAAQ;EACvB,IAAI,QAAQ,UAAU,KAAK,KAAK,QAAQ,UAAU,QAAQ,KAAK,SAAS,MAAM,cAAc,sCAAsC,sCAAsC,QAAQ,MAAM,iCAAiC,QAAQ,K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I,yBAAyB,cAAc,sBAAsB;CAChE,sBAAsB,UAAU;EAC/B,OAAO,CAAC;CACT;CACA,uBAAuB,UAAU;EAChC,OAAO,CAAC;CACT;AACD;AAGA,SAAS,sBAAsB,KAAK,QAAQ;CAC3C,IAAI,IAAI,SAAS,YAAY,OAAO,IAAI;CACxC,OAAO,qBAAqB,IAAI,OAAO,MAAM;AAC9C;AACA,MAAM,2BAA2B;CAChC,GAAG;CACH,oBAAoB,IAAI,2BAA2B;CACnD,gBAAgB,IAAI,uBAAuB;CAC3C,iBAAiB,QAAQ,oBAAoB;EAC5C,2BAA2B,OAAO,MAAM;EACxC,OAAO,yBAAyB,QAAQ,kBAAkB;CAC3D;CACA,WAAW,OAAO;EACjB,OAAO,mBAAmB,KAAK;CAChC;CACA,4BAA4B;CAC5B,oBAAoB;CACpB,YAAY;EACX,cAAc,SAAS;GACtB,OAAO,+BAA+B,OAAO;EAC9C;EACA,aAAa,QAAQ;GACpB,OAAO,8BAA8B,MAAM;EAC5C;EACA,iBAAiB,UAAU,qBAAqB;GAC/C,MAAM,WAAW,wBAAwB,mBAAmB;GAC5D,OAAO,qCAAqC,UAAU,QAAQ,GAAG;IAChE,qBAAqB;IACrB,GAAG,UAAU,oBAAoB,QAAQ;IACzC,eAAe;IACf,gBAAgB;GACjB,CAAC;EACF;CACD;CACA,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;;;;;CAKA,cAAc,SAAS;EACtB,OAAO,+BAA+B,OAAO;CAC9C;;;;;CAKA,aAAa,QAAQ;EACpB,OAAO,8BAA8B,MAAM;CAC5C;AACD"}
|
|
1
|
+
{"version":3,"file":"control-BIGO0LQ1.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/control.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { n as postgresResolveDefault } from \"./default-normalizer-Bjtm2F4f.mjs\";\nimport { c as PLAIN_DATE_TIME_NOW_GENERATOR_ID, d as INSTANT_NOW_GENERATOR_ID, p as instantNowControlDescriptor, u as plainDateTimeNowControlDescriptor } from \"./authoring-DhCDnK1T.mjs\";\nimport { t as postgresTargetDescriptorMeta } from \"./descriptor-meta-CQMRNeLX.mjs\";\nimport { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { n as diffPostgresSchema, r as contractToPostgresDatabaseSchemaNode } from \"./diff-database-schema-c9IWEO2V.mjs\";\nimport { r as renderDefaultLiteral } from \"./planner-ddl-builders-DTCYp-qA.mjs\";\nimport { n as PostgresContractSerializer } from \"./postgres-contract-view-BPe8r8jN.mjs\";\nimport { t as createPostgresMigrationPlanner } from \"./planner-D9WzYlHl.mjs\";\nimport { n as inferPostgresPslContract } from \"./infer-psl-contract-CBsWEERT.mjs\";\nimport { n as parsePostgresListText, t as decodePostgresListText } from \"./list-decoder-DXee1orj.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { buildNativeTypeExpander, runnerFailure, runnerSuccess } from \"@internal/family-sql/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { SqlSchemaVerifierBase } from \"@internal/family-sql/ir\";\nimport { SqlQueryError } from \"@internal/sql-errors\";\n//#region src/core/migrations/runner.ts\nconst LOCK_DOMAIN = \"prisma_8.contract.marker\";\n/**\n* Deep clones and freezes a record object to prevent mutation.\n* Recursively clones nested objects and arrays to ensure complete isolation.\n*/\nfunction cloneAndFreezeRecord(value) {\n\tconst cloned = {};\n\tfor (const [key, val] of Object.entries(value)) if (val === null || val === void 0) cloned[key] = val;\n\telse if (Array.isArray(val)) cloned[key] = Object.freeze([...val]);\n\telse if (typeof val === \"object\") cloned[key] = cloneAndFreezeRecord(val);\n\telse cloned[key] = val;\n\treturn Object.freeze(cloned);\n}\nfunction createPostgresMigrationRunner(family) {\n\treturn new PostgresMigrationRunner(family);\n}\nvar PostgresMigrationRunner = class {\n\tfamily;\n\tconstructor(family) {\n\t\tthis.family = family;\n\t}\n\t/**\n\t* Body of the migration runner without transaction management. The\n\t* caller ({@link PostgresMigrationRunner.execute}) owns the\n\t* `BEGIN`/`COMMIT`/`ROLLBACK` lifecycle.\n\t*/\n\tasync executeOnConnection(options) {\n\t\tconst schema = options.schemaName ?? Object.keys(options.destinationContract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;\n\t\tconst driver = options.driver;\n\t\tif (options.space !== void 0 && options.space !== options.plan.spaceId) throw postgresError(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {\n\t\t\tspace: options.space,\n\t\t\tplanSpaceId: options.plan.spaceId\n\t\t} });\n\t\tconst space = options.plan.spaceId;\n\t\tconst lockKey = `${LOCK_DOMAIN}:${schema}:${space}`;\n\t\tconst planOps = blindCast(await Promise.all(options.plan.operations));\n\t\tconst destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);\n\t\tif (!destinationCheck.ok) return destinationCheck;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, planOps);\n\t\tif (!policyCheck.ok) return policyCheck;\n\t\tawait this.acquireLock(driver, lockKey);\n\t\tconst ensureResult = await this.ensureControlTables(driver, options.destinationContract);\n\t\tif (!ensureResult.ok) return ensureResult;\n\t\tconst existingMarker = await this.family.readMarker({\n\t\t\tdriver,\n\t\t\tspace\n\t\t});\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (!markerCheck.ok) return markerCheck;\n\t\tconst markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);\n\t\tconst isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;\n\t\tconst skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;\n\t\tlet applyValue;\n\t\tif (skipOperations) applyValue = {\n\t\t\toperationsExecuted: 0,\n\t\t\texecutedOperations: []\n\t\t};\n\t\telse {\n\t\t\tconst applyResult = await this.applyPlan(driver, options, planOps);\n\t\t\tif (!applyResult.ok) return applyResult;\n\t\t\tapplyValue = applyResult.value;\n\t\t}\n\t\tif (space === APP_SPACE_ID) {\n\t\t\tconst schemaNode = await this.family.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract: options.destinationContract\n\t\t\t});\n\t\t\tconst schemaVerifyResult = this.family.verifySchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tschema: schemaNode,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t\tif (!schemaVerifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", schemaVerifyResult.summary, {\n\t\t\t\twhy: \"The resulting database schema does not satisfy the destination contract.\",\n\t\t\t\tmeta: { issues: schemaVerifyResult.schema.issues }\n\t\t\t});\n\t\t}\n\t\tconst incomingInvariants = options.plan.providedInvariants ?? [];\n\t\tconst existingInvariants = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariants.has(id));\n\t\tif (!(isSelfEdge && applyValue.operationsExecuted === 0 && incomingIsSubsetOfExisting)) {\n\t\t\tconst markerResult = await this.upsertMarker(driver, options, existingMarker, space);\n\t\t\tif (!markerResult.ok) return markerResult;\n\t\t\tawait this.recordLedgerEntries(driver, options, applyValue.executedOperations, planOps.length);\n\t\t}\n\t\treturn runnerSuccess({\n\t\t\toperationsPlanned: planOps.length,\n\t\t\toperationsExecuted: applyValue.operationsExecuted\n\t\t});\n\t}\n\tasync execute(options) {\n\t\tconst driver = options.driver;\n\t\tconst perSpaceOptions = options.perSpaceOptions;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\tawait this.beginTransaction(driver);\n\t\tlet committed = false;\n\t\ttry {\n\t\t\tconst perSpaceResults = [];\n\t\t\tfor (const spaceOptions of perSpaceOptions) {\n\t\t\t\tconst space = spaceOptions.space ?? spaceOptions.plan.spaceId;\n\t\t\t\tconst result = await this.executeOnConnection({\n\t\t\t\t\t...spaceOptions,\n\t\t\t\t\tdriver,\n\t\t\t\t\tspace\n\t\t\t\t});\n\t\t\t\tif (!result.ok) return notOk({\n\t\t\t\t\t...result.failure,\n\t\t\t\t\tfailingSpace: space\n\t\t\t\t});\n\t\t\t\tperSpaceResults.push({\n\t\t\t\t\tspace,\n\t\t\t\t\tvalue: result.value\n\t\t\t\t});\n\t\t\t}\n\t\t\tawait this.commitTransaction(driver);\n\t\t\tcommitted = true;\n\t\t\treturn ok({ perSpaceResults });\n\t\t} finally {\n\t\t\tif (!committed) await this.rollbackTransaction(driver);\n\t\t}\n\t}\n\tasync applyPlan(driver, options, ops) {\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tlet operationsExecuted = 0;\n\t\tconst executedOperations = [];\n\t\tfor (const operation of ops) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.expectationsAreSatisfied(driver, operation.postcheck)) {\n\t\t\t\t\t\texecutedOperations.push(this.createPostcheckPreSatisfiedSkipRecord(operation));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst precheckResult = await this.runExpectationSteps(driver, operation.precheck, operation, \"precheck\");\n\t\t\t\t\tif (!precheckResult.ok) return precheckResult;\n\t\t\t\t}\n\t\t\t\tconst executeResult = await this.runExecuteSteps(driver, operation.execute, operation);\n\t\t\t\tif (!executeResult.ok) return executeResult;\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst postcheckResult = await this.runExpectationSteps(driver, operation.postcheck, operation, \"postcheck\");\n\t\t\t\t\tif (!postcheckResult.ok) return postcheckResult;\n\t\t\t\t}\n\t\t\t\texecutedOperations.push(operation);\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\treturn ok({\n\t\t\toperationsExecuted,\n\t\t\texecutedOperations\n\t\t});\n\t}\n\tasync ensureControlTables(driver, contract) {\n\t\tconst lowererContext = { contract };\n\t\tconst [schemaQuery, ...tableQueries] = this.family.bootstrapControlTableQueries();\n\t\tif (schemaQuery === void 0) throw new InternalError(\"Postgres control-table bootstrap must include CREATE SCHEMA\");\n\t\tawait this.executeStatement(driver, await this.family.lowerAst(schemaQuery, lowererContext));\n\t\tconst legacyDetection = await this.detectLegacyMarkerShape(driver);\n\t\tif (!legacyDetection.ok) return legacyDetection;\n\t\tfor (const query of tableQueries) await this.executeStatement(driver, await this.family.lowerAst(query, lowererContext));\n\t\treturn okVoid();\n\t}\n\tasync detectLegacyMarkerShape(driver) {\n\t\tconst result = await driver.query(`select column_name\n from information_schema.columns\n where table_schema = 'prisma_contract'\n and table_name = 'marker'`);\n\t\tif (result.rows.length === 0) return okVoid();\n\t\tconst columns = new Set(result.rows.map((row) => row.column_name));\n\t\tif (columns.has(\"space\")) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.LEGACY_MARKER_SHAPE\", \"Legacy marker-table shape detected on prisma_contract.marker (no `space` column). Prisma 8 is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop `prisma_contract.marker` and re-run `dbInit` to reinitialise from a clean baseline.\", { meta: {\n\t\t\ttable: \"prisma_contract.marker\",\n\t\t\tcolumns: [...columns].sort()\n\t\t} });\n\t}\n\tasync runExpectationSteps(driver, steps, operation, phase) {\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return runnerFailure(phase === \"precheck\" ? \"MIGRATION.PRECHECK_FAILED\" : \"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during ${phase}: ${step.description}`, { meta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\tphase,\n\t\t\t\tstepDescription: step.description\n\t\t\t} });\n\t\t}\n\t\treturn okVoid();\n\t}\n\tasync runExecuteSteps(driver, steps, operation) {\n\t\tfor (const step of steps) try {\n\t\t\tawait driver.query(step.sql, step.params ?? []);\n\t\t} catch (error) {\n\t\t\tif (SqlQueryError.is(error)) return runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${operation.id} failed during execution: ${step.description}`, {\n\t\t\t\twhy: error.message,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql,\n\t\t\t\t\tsqlState: error.sqlState,\n\t\t\t\t\tconstraint: error.constraint,\n\t\t\t\t\ttable: error.table,\n\t\t\t\t\tcolumn: error.column,\n\t\t\t\t\tdetail: error.detail\n\t\t\t\t}\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\treturn okVoid();\n\t}\n\tstepResultIsTrue(rows) {\n\t\tif (!rows || rows.length === 0) return false;\n\t\tconst firstRow = rows[0];\n\t\tconst firstValue = firstRow ? Object.values(firstRow)[0] : void 0;\n\t\tif (typeof firstValue === \"boolean\") return firstValue;\n\t\tif (typeof firstValue === \"number\") return firstValue !== 0;\n\t\tif (typeof firstValue === \"string\") {\n\t\t\tconst lower = firstValue.toLowerCase();\n\t\t\tif (lower === \"t\" || lower === \"true\" || lower === \"1\") return true;\n\t\t\tif (lower === \"f\" || lower === \"false\" || lower === \"0\") return false;\n\t\t\treturn firstValue.length > 0;\n\t\t}\n\t\treturn Boolean(firstValue);\n\t}\n\tasync expectationsAreSatisfied(driver, steps) {\n\t\tif (steps.length === 0) return false;\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tcreatePostcheckPreSatisfiedSkipRecord(operation) {\n\t\tconst clonedMeta = operation.meta ? cloneAndFreezeRecord(operation.meta) : void 0;\n\t\tconst runnerMeta = Object.freeze({\n\t\t\tskipped: true,\n\t\t\treason: \"postcheck_pre_satisfied\"\n\t\t});\n\t\tconst mergedMeta = Object.freeze({\n\t\t\t...clonedMeta ?? {},\n\t\t\trunner: runnerMeta\n\t\t});\n\t\tconst frozenPostcheck = Object.freeze([...operation.postcheck]);\n\t\treturn Object.freeze({\n\t\t\tid: operation.id,\n\t\t\tlabel: operation.label,\n\t\t\t...ifDefined(\"summary\", operation.summary),\n\t\t\toperationClass: operation.operationClass,\n\t\t\ttarget: operation.target,\n\t\t\tprecheck: Object.freeze([]),\n\t\t\texecute: Object.freeze([]),\n\t\t\tpostcheck: frozenPostcheck,\n\t\t\t...ifDefined(\"meta\", operation.meta || mergedMeta ? mergedMeta : void 0)\n\t\t});\n\t}\n\tmarkerMatchesDestination(marker, plan) {\n\t\tif (!marker) return false;\n\t\tif (marker.storageHash !== plan.destination.storageHash) return false;\n\t\tif (plan.destination.profileHash && marker.profileHash !== plan.destination.profileHash) return false;\n\t\treturn true;\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${policy.allowedOperationClasses.join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass,\n\t\t\t\tallowedClasses: policy.allowedOperationClasses\n\t\t\t}\n\t\t});\n\t\treturn okVoid();\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return okVoid();\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t\tif (origin.profileHash && marker.profileHash !== origin.profileHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`, { meta: {\n\t\t\tmarkerProfileHash: marker.profileHash,\n\t\t\texpectedOriginProfileHash: origin.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tensurePlanMatchesDestinationContract(destination, contract) {\n\t\tif (destination.storageHash !== contract.storage.storageHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`, { meta: {\n\t\t\tplanStorageHash: destination.storageHash,\n\t\t\tcontractStorageHash: contract.storage.storageHash\n\t\t} });\n\t\tif (destination.profileHash && contract.profileHash && destination.profileHash !== contract.profileHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`, { meta: {\n\t\t\tplanProfileHash: destination.profileHash,\n\t\t\tcontractProfileHash: contract.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync upsertMarker(driver, options, existingMarker, space) {\n\t\tconst destination = {\n\t\t\tstorageHash: options.plan.destination.storageHash,\n\t\t\tprofileHash: options.plan.destination.profileHash ?? options.destinationContract.profileHash ?? options.plan.destination.storageHash,\n\t\t\tinvariants: options.plan.providedInvariants ?? []\n\t\t};\n\t\tif (!existingMarker) {\n\t\t\tawait this.family.initMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tdestination\n\t\t\t});\n\t\t\treturn okVoid();\n\t\t}\n\t\tif (!await this.family.updateMarker({\n\t\t\tdriver,\n\t\t\tspace,\n\t\t\texpectedFrom: existingMarker.storageHash,\n\t\t\tdestination\n\t\t})) return runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\tspace,\n\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\tdestinationStorageHash: options.plan.destination.storageHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync recordLedgerEntries(driver, options, executedOperations, planOpsLength) {\n\t\tconst space = options.plan.spaceId;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== planOpsLength) throw new InternalError(`Ledger write: plan.operations length (${planOpsLength}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = executedOperations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait this.family.writeLedgerEntry({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tentry: {\n\t\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\t\tfrom: edge.from,\n\t\t\t\t\tto: edge.to,\n\t\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\t\toperations: edgeOps,\n\t\t\t\t\t...ifDefined(\"destinationContractJson\", edge.destinationContractJson)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tasync acquireLock(driver, key) {\n\t\tawait driver.query(\"select pg_advisory_xact_lock(hashtext($1))\", [key]);\n\t}\n\tasync beginTransaction(driver) {\n\t\tawait driver.query(\"BEGIN\");\n\t}\n\tasync commitTransaction(driver) {\n\t\tawait driver.query(\"COMMIT\");\n\t}\n\tasync rollbackTransaction(driver) {\n\t\tawait driver.query(\"ROLLBACK\");\n\t}\n\tasync executeStatement(driver, statement) {\n\t\tawait driver.query(statement.sql, statement.params);\n\t}\n};\n//#endregion\n//#region src/core/postgres-schema-verifier.ts\n/**\n* Postgres target `SchemaVerifier` concretion. Plugs into the\n* SQL-shared verification surface; production verification today still\n* routes through the family verify verdict (`verifySqlSchemaByDiff` over\n* `diffPostgresSchema`), which carries options (codec hooks,\n* normalizers, framework components) that the framework-level\n* `SchemaVerifyOptions` shape does not yet surface.\n*\n* The hooks return the empty list pending the call-site migration that\n* routes the existing verifier behaviour through the SPI — at that\n* point `verifyCommonSqlSchema` will likely lift onto the family base\n* (mirroring `verifyCommonMongoSchema`) and `verifyTargetExtensions`\n* will house Postgres-only kinds (functions, RLS policies in a future\n* project).\n*/\nvar PostgresSchemaVerifier = class extends SqlSchemaVerifierBase {\n\tverifyCommonSqlSchema(_options) {\n\t\treturn [];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\nfunction postgresRenderDefault(def, column) {\n\tif (def.kind === \"function\") return def.expression;\n\treturn renderDefaultLiteral(def.value, column);\n}\nconst postgresTargetDescriptor = {\n\t...postgresTargetDescriptorMeta,\n\tcontractSerializer: new PostgresContractSerializer(),\n\tschemaVerifier: new PostgresSchemaVerifier(),\n\tinferPslContract(schema, describedContracts) {\n\t\tPostgresDatabaseSchemaNode.assert(schema);\n\t\treturn inferPostgresPslContract(schema, describedContracts);\n\t},\n\tdiffSchema(input) {\n\t\treturn diffPostgresSchema(input);\n\t},\n\tclassifySubjectGranularity: postgresDiffSubjectGranularity,\n\tclassifyEntityKind: postgresDiffSubjectEntityKind,\n\tmigrations: {\n\t\tcreatePlanner(adapter) {\n\t\t\treturn createPostgresMigrationPlanner(adapter);\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\treturn createPostgresMigrationRunner(family);\n\t\t},\n\t\tcontractToSchema(contract, frameworkComponents) {\n\t\t\tconst expander = buildNativeTypeExpander(frameworkComponents);\n\t\t\treturn contractToPostgresDatabaseSchemaNode(blindCast(contract), {\n\t\t\t\tannotationNamespace: \"pg\",\n\t\t\t\t...ifDefined(\"expandNativeType\", expander),\n\t\t\t\trenderDefault: postgresRenderDefault,\n\t\t\t\tresolveDefault: postgresResolveDefault\n\t\t\t});\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t},\n\t/**\n\t* Direct method for SQL-specific usage.\n\t* @deprecated Use migrations.createPlanner() for CLI compatibility.\n\t*/\n\tcreatePlanner(adapter) {\n\t\treturn createPostgresMigrationPlanner(adapter);\n\t},\n\t/**\n\t* Direct method for SQL-specific usage.\n\t* @deprecated Use migrations.createRunner() for CLI compatibility.\n\t*/\n\tcreateRunner(family) {\n\t\treturn createPostgresMigrationRunner(family);\n\t}\n};\n//#endregion\nexport { INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, decodePostgresListText, postgresTargetDescriptor as default, instantNowControlDescriptor, parsePostgresListText, plainDateTimeNowControlDescriptor, postgresRenderDefault };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,cAAc;;;;;AAKpB,SAAS,qBAAqB,OAAO;CACpC,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,KAAK,GAAG,IAAI,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,OAAO,+BAA+B,OAAO;EAC9C;EACA,aAAa,QAAQ;GACpB,OAAO,8BAA8B,MAAM;EAC5C;EACA,iBAAiB,UAAU,qBAAqB;GAC/C,MAAM,WAAW,wBAAwB,mBAAmB;GAC5D,OAAO,qCAAqC,UAAU,QAAQ,GAAG;IAChE,qBAAqB;IACrB,GAAG,UAAU,oBAAoB,QAAQ;IACzC,eAAe;IACf,gBAAgB;GACjB,CAAC;EACF;CACD;CACA,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;;;;;CAKA,cAAc,SAAS;EACtB,OAAO,+BAA+B,OAAO;CAC9C;;;;;CAKA,aAAa,QAAQ;EACpB,OAAO,8BAA8B,MAAM;CAC5C;AACD"}
|
package/dist/{control-adapter-Bdz-Xa1p-rKiOVhsh.mjs → control-adapter-Bdz-Xa1p-97fNF5gu.mjs}
RENAMED
|
@@ -7,7 +7,7 @@ import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSign
|
|
|
7
7
|
import { t as parsePostgresDefault } from "./default-normalizer-Bjtm2F4f-uV5vvkVt.mjs";
|
|
8
8
|
import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
9
9
|
import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
10
|
-
import { r as renderDefaultLiteral } from "./planner-ddl-builders-
|
|
10
|
+
import { r as renderDefaultLiteral } from "./planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs";
|
|
11
11
|
import { n as parsePostgresListText } from "./list-decoder-DXee1orj-K3y-hxiI.mjs";
|
|
12
12
|
import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
|
|
13
13
|
import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-DsyAnn56-fBvRbPLM.mjs";
|
|
@@ -1348,4 +1348,4 @@ async function pgRenderDdlExecuteRequest(ast, codecLookup) {
|
|
|
1348
1348
|
//#endregion
|
|
1349
1349
|
export { createPostgresCodecRegistryWithBuiltins as i, assemblePostgresCodecRegistry as n, createPostgresBuiltinCodecLookup as r, PostgresControlAdapter as t };
|
|
1350
1350
|
|
|
1351
|
-
//# sourceMappingURL=control-adapter-Bdz-Xa1p-
|
|
1351
|
+
//# sourceMappingURL=control-adapter-Bdz-Xa1p-97fNF5gu.mjs.map
|