@prisma-next/family-sql 0.14.0-dev.9 → 0.14.0-dev.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/{authoring-type-constructors-CjFfO6LM.mjs → authoring-type-constructors-CXd-8ydc.mjs} +7 -30
  2. package/dist/authoring-type-constructors-CXd-8ydc.mjs.map +1 -0
  3. package/dist/{control-adapter-Cmw9LvEP.d.mts → control-adapter-BQgad8Zc.d.mts} +30 -8
  4. package/dist/control-adapter-BQgad8Zc.d.mts.map +1 -0
  5. package/dist/control-adapter.d.mts +1 -1
  6. package/dist/control.d.mts +279 -34
  7. package/dist/control.d.mts.map +1 -1
  8. package/dist/control.mjs +378 -1005
  9. package/dist/control.mjs.map +1 -1
  10. package/dist/diff.d.mts +102 -0
  11. package/dist/diff.d.mts.map +1 -0
  12. package/dist/diff.mjs +14 -0
  13. package/dist/diff.mjs.map +1 -0
  14. package/dist/foreign-key-index-backing-BP71iI-Q.mjs +32 -0
  15. package/dist/foreign-key-index-backing-BP71iI-Q.mjs.map +1 -0
  16. package/dist/ir.d.mts +26 -9
  17. package/dist/ir.d.mts.map +1 -1
  18. package/dist/ir.mjs +2 -2
  19. package/dist/ir.mjs.map +1 -1
  20. package/dist/migration.d.mts +11 -2
  21. package/dist/migration.d.mts.map +1 -1
  22. package/dist/migration.mjs +7 -0
  23. package/dist/migration.mjs.map +1 -1
  24. package/dist/pack.mjs +1 -1
  25. package/dist/psl-infer.d.mts +119 -0
  26. package/dist/psl-infer.d.mts.map +1 -0
  27. package/dist/psl-infer.mjs +366 -0
  28. package/dist/psl-infer.mjs.map +1 -0
  29. package/dist/schema-differ-DnoopSXm.d.mts +45 -0
  30. package/dist/schema-differ-DnoopSXm.d.mts.map +1 -0
  31. package/dist/schema-verify-W3r631Jh.mjs +226 -0
  32. package/dist/schema-verify-W3r631Jh.mjs.map +1 -0
  33. package/dist/{sql-contract-serializer-BR2vC7Z-.mjs → sql-contract-serializer-C75cfMSS.mjs} +46 -20
  34. package/dist/sql-contract-serializer-C75cfMSS.mjs.map +1 -0
  35. package/dist/{types-kgstZ_Zd.d.mts → types-BPv_y7iS.d.mts} +36 -142
  36. package/dist/types-BPv_y7iS.d.mts.map +1 -0
  37. package/package.json +26 -26
  38. package/src/core/authoring-entity-types.ts +12 -37
  39. package/src/core/control-adapter.ts +11 -5
  40. package/src/core/control-instance.ts +212 -42
  41. package/src/core/control-target-descriptor.ts +98 -0
  42. package/src/core/diff/schema-verify.ts +324 -0
  43. package/src/core/diff/sql-schema-diff.ts +41 -0
  44. package/src/core/diff/verifier-disposition.ts +30 -0
  45. package/src/core/foreign-key-index-backing.ts +37 -0
  46. package/src/core/ir/sql-contract-serializer-base.ts +70 -56
  47. package/src/core/ir/sql-contract-serializer.ts +5 -7
  48. package/src/core/ir/sql-schema-verifier-base.ts +5 -5
  49. package/src/core/migrations/contract-to-schema-ir.ts +141 -37
  50. package/src/core/migrations/control-policy.ts +66 -115
  51. package/src/core/migrations/field-event-planner.ts +2 -2
  52. package/src/core/migrations/native-type-expander.ts +28 -0
  53. package/src/core/migrations/schema-differ.ts +41 -0
  54. package/src/core/migrations/types.ts +33 -37
  55. package/src/core/psl-contract-infer/name-transforms.ts +15 -0
  56. package/src/core/psl-contract-infer/printer-config.ts +14 -6
  57. package/src/core/psl-contract-infer/relation-inference.ts +27 -1
  58. package/src/core/sql-migration.ts +12 -1
  59. package/src/exports/control.ts +12 -2
  60. package/src/exports/diff.ts +25 -0
  61. package/src/exports/psl-infer.ts +40 -0
  62. package/dist/authoring-type-constructors-CjFfO6LM.mjs.map +0 -1
  63. package/dist/control-adapter-Cmw9LvEP.d.mts.map +0 -1
  64. package/dist/schema-verify.d.mts +0 -39
  65. package/dist/schema-verify.d.mts.map +0 -1
  66. package/dist/schema-verify.mjs +0 -2
  67. package/dist/sql-contract-serializer-BR2vC7Z-.mjs.map +0 -1
  68. package/dist/test-utils.d.mts +0 -2
  69. package/dist/test-utils.mjs +0 -2
  70. package/dist/types-kgstZ_Zd.d.mts.map +0 -1
  71. package/dist/verify-sql-schema-thU-jKpf.d.mts +0 -66
  72. package/dist/verify-sql-schema-thU-jKpf.d.mts.map +0 -1
  73. package/dist/verify-sql-schema-xT4udQLQ.mjs +0 -1501
  74. package/dist/verify-sql-schema-xT4udQLQ.mjs.map +0 -1
  75. package/src/core/psl-contract-infer/postgres-default-mapping.ts +0 -16
  76. package/src/core/psl-contract-infer/postgres-type-map.ts +0 -157
  77. package/src/core/psl-contract-infer/sql-schema-ir-to-psl-ast.ts +0 -795
  78. package/src/core/schema-verify/control-verify-emit.ts +0 -46
  79. package/src/core/schema-verify/verifier-disposition.ts +0 -58
  80. package/src/core/schema-verify/verify-helpers.ts +0 -820
  81. package/src/core/schema-verify/verify-sql-schema.ts +0 -1311
  82. package/src/exports/schema-verify.ts +0 -18
  83. package/src/exports/test-utils.ts +0 -9
@@ -1,55 +1,32 @@
1
+ import { resolveEnumCodecId } from "@prisma-next/framework-components/authoring";
1
2
  import { enumType } from "@prisma-next/sql-contract-ts/contract-builder";
2
3
  import { blindCast } from "@prisma-next/utils/casts";
3
- //#region src/core/authoring-entity-types.ts
4
- function parseQuotedString(raw) {
5
- if (raw.startsWith("\"") && raw.endsWith("\"") && raw.length >= 2) return raw.slice(1, -1);
6
- }
7
4
  const sqlFamilyEntityTypes = { enum: {
8
5
  kind: "entity",
9
6
  discriminator: "enum",
10
7
  output: { factory: (block, ctx) => {
11
8
  const sourceId = ctx.sourceId ?? "unknown";
12
9
  const diagnostics = ctx.diagnostics;
13
- const typeAttr = block.blockAttributes.find((a) => a.name === "type");
14
- if (!typeAttr) {
15
- diagnostics?.push({
16
- code: "PSL_ENUM_MISSING_TYPE",
17
- message: `enum "${block.name}" is missing a @@type("codecId") attribute`,
18
- sourceId,
19
- span: block.span
20
- });
21
- return;
22
- }
23
- const rawCodecArg = typeAttr.args[0]?.value;
24
- const codecId = rawCodecArg !== void 0 ? parseQuotedString(rawCodecArg) : void 0;
25
- if (!codecId) {
26
- diagnostics?.push({
27
- code: "PSL_ENUM_MISSING_TYPE",
28
- message: `enum "${block.name}" @@type attribute must have a quoted codec id argument`,
29
- sourceId,
30
- span: typeAttr.span
31
- });
32
- return;
33
- }
10
+ const resolved = resolveEnumCodecId(block, ctx);
11
+ if (resolved === void 0) return;
12
+ const { codecId, codecSpan } = resolved;
34
13
  const nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];
35
14
  if (nativeType === void 0) {
36
- const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;
37
15
  diagnostics?.push({
38
16
  code: "PSL_EXTENSION_INVALID_VALUE",
39
17
  message: `enum "${block.name}" @@type references unknown codec "${codecId}"`,
40
18
  sourceId,
41
- span: typeArgSpan
19
+ span: codecSpan
42
20
  });
43
21
  return;
44
22
  }
45
23
  const codec = ctx.codecLookup?.get(codecId);
46
24
  if (codec === void 0) {
47
- const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;
48
25
  diagnostics?.push({
49
26
  code: "PSL_EXTENSION_INVALID_VALUE",
50
27
  message: `enum "${block.name}" @@type codec "${codecId}" resolves in targetTypesFor but is absent from codecLookup.get`,
51
28
  sourceId,
52
- span: typeArgSpan
29
+ span: codecSpan
53
30
  });
54
31
  return;
55
32
  }
@@ -339,4 +316,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
339
316
  //#endregion
340
317
  export { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };
341
318
 
342
- //# sourceMappingURL=authoring-type-constructors-CjFfO6LM.mjs.map
319
+ //# sourceMappingURL=authoring-type-constructors-CXd-8ydc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-type-constructors-CXd-8ydc.mjs","names":[],"sources":["../src/core/authoring-entity-types.ts","../src/core/authoring-field-presets.ts","../src/core/authoring-type-constructors.ts"],"sourcesContent":["import type { JsonValue } from '@prisma-next/contract/types';\nimport {\n type AuthoringEntityContext,\n type AuthoringEntityTypeDescriptor,\n type AuthoringEntityTypeNamespace,\n type AuthoringPslBlockDescriptorNamespace,\n type PslExtensionBlock,\n resolveEnumCodecId,\n} from '@prisma-next/framework-components/authoring';\nimport { type EnumTypeHandle, enumType } from '@prisma-next/sql-contract-ts/contract-builder';\nimport { blindCast } from '@prisma-next/utils/casts';\n\nexport const sqlFamilyEnumEntityDescriptor = {\n kind: 'entity' as const,\n discriminator: 'enum',\n output: {\n factory: (\n block: PslExtensionBlock,\n ctx: AuthoringEntityContext,\n ): EnumTypeHandle | undefined => {\n const sourceId = ctx.sourceId ?? 'unknown';\n const diagnostics = ctx.diagnostics;\n\n const resolved = resolveEnumCodecId(block, ctx);\n if (resolved === undefined) {\n return undefined;\n }\n const { codecId, codecSpan } = resolved;\n\n const nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n if (nativeType === undefined) {\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n sourceId,\n span: codecSpan,\n });\n return undefined;\n }\n\n const codec = ctx.codecLookup?.get(codecId);\n if (codec === undefined) {\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n sourceId,\n span: codecSpan,\n });\n return undefined;\n }\n\n const seenValues = new Set<string>();\n const members: { name: string; value: unknown }[] = [];\n let memberError = false;\n\n for (const [memberName, paramValue] of Object.entries(block.parameters)) {\n let value: unknown;\n if (paramValue.kind === 'bare') {\n try {\n value = codec.decodeJson(memberName);\n } catch {\n diagnostics?.push({\n code: 'PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC',\n message: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else if (paramValue.kind === 'value') {\n let jsonValue: unknown;\n try {\n jsonValue = JSON.parse(paramValue.raw);\n } catch {\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n try {\n value = codec.decodeJson(\n blindCast<JsonValue, 'JSON.parse returns a JsonValue-compatible value'>(jsonValue),\n );\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else {\n continue;\n }\n\n const valueKey = String(value);\n if (seenValues.has(valueKey)) {\n diagnostics?.push({\n code: 'PSL_ENUM_DUPLICATE_MEMBER_VALUE',\n message: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n seenValues.add(valueKey);\n members.push({ name: memberName, value });\n }\n\n if (memberError) return undefined;\n\n if (members.length === 0) {\n diagnostics?.push({\n code: 'PSL_ENUM_MISSING_TYPE',\n message: `enum \"${block.name}\" must have at least one member`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n return enumType(\n block.name,\n { codecId, nativeType },\n ...members.map((m) => ({ name: m.name, value: m.value })),\n );\n },\n },\n} satisfies AuthoringEntityTypeDescriptor;\n\nexport const sqlFamilyEntityTypes: AuthoringEntityTypeNamespace = {\n enum: sqlFamilyEnumEntityDescriptor,\n};\n\nexport const sqlFamilyPslBlockDescriptors = {\n enum: {\n kind: 'pslBlock',\n keyword: 'enum',\n discriminator: 'enum',\n name: { required: true },\n parameters: {},\n variadicParameters: true,\n },\n} as const satisfies AuthoringPslBlockDescriptorNamespace;\n","import type { AuthoringFieldNamespace } from '@prisma-next/framework-components/authoring';\n\n/**\n * Family-level SQL authoring field presets.\n *\n * Only presets whose codec IDs align with the ID generator metadata live here\n * (see `@prisma-next/ids`). These presets are target-agnostic because the\n * generator metadata fixes their codec/native-type to `sql/char@1`\n * (`character`) regardless of target, and the PSL interpreter lets the\n * generator override the scalar descriptor.\n *\n * The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n * values as `character(36)` — portable across all SQL targets. For a native\n * Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n * `id.uuidv7Native` from `@prisma-next/target-postgres`.\n *\n * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n * `boolean`, `dateTime`) are contributed by the target pack (see\n * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the\n * TS callback surface and the PSL scalar surface lower to byte-identical\n * contracts for the active target.\n */\n\nconst CHARACTER_CODEC_ID = 'sql/char@1';\nconst CHARACTER_NATIVE_TYPE = 'character';\n\nconst nanoidOptionsArgument = {\n kind: 'object',\n optional: true,\n properties: {\n size: {\n kind: 'number',\n optional: true,\n integer: true,\n minimum: 2,\n maximum: 255,\n },\n },\n} as const;\n\nexport const sqlFamilyAuthoringFieldPresets = {\n uuidString: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n },\n },\n id: {\n uuidv4String: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv4',\n },\n },\n id: true,\n },\n },\n uuidv7String: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv7',\n },\n },\n id: true,\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ulid',\n },\n },\n id: true,\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'nanoid',\n params: {\n size: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n },\n },\n },\n },\n id: true,\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'cuid2',\n },\n },\n id: true,\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ksuid',\n },\n },\n id: true,\n },\n },\n },\n} as const satisfies AuthoringFieldNamespace;\n","import type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\n\nexport const sqlFamilyAuthoringTypes = {\n sql: {\n String: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, maximum: 10485760 }],\n output: {\n codecId: 'sql/varchar@1',\n nativeType: 'character varying',\n typeParams: {\n length: { kind: 'arg', index: 0 },\n },\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n"],"mappings":";;;AA2IA,MAAa,uBAAqD,EAChE,MAAM;CA/HN,MAAM;CACN,eAAe;CACf,QAAQ,EACN,UACE,OACA,QAC+B;EAC/B,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EAExB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAA,GACf;EAEF,MAAM,EAAE,SAAS,cAAc;EAE/B,MAAM,aAAa,IAAI,aAAa,eAAe,OAAO,CAAC,GAAG;EAC9D,IAAI,eAAe,KAAA,GAAW;GAC5B,aAAa,KAAK;IAChB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACR,CAAC;GACD;EACF;EAEA,MAAM,QAAQ,IAAI,aAAa,IAAI,OAAO;EAC1C,IAAI,UAAU,KAAA,GAAW;GACvB,aAAa,KAAK;IAChB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ;IACvD;IACA,MAAM;GACR,CAAC;GACD;EACF;EAEA,MAAM,6BAAa,IAAI,IAAY;EACnC,MAAM,UAA8C,CAAC;EACrD,IAAI,cAAc;EAElB,KAAK,MAAM,CAAC,YAAY,eAAe,OAAO,QAAQ,MAAM,UAAU,GAAG;GACvE,IAAI;GACJ,IAAI,WAA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1,26 @@
1
- import { n as NativeTypeNormalizer, t as DefaultNormalizer } from "./verify-sql-schema-thU-jKpf.mjs";
2
1
  import { ControlAdapterInstance, ControlStack } from "@prisma-next/framework-components/control";
2
+ import { ColumnDefault, ContractMarkerRecord, LedgerEntryRecord } from "@prisma-next/contract/types";
3
3
  import { SqlControlDriverInstance } from "@prisma-next/sql-contract/types";
4
- import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma-next/contract/types";
4
+ import { SqlSchemaIRNode } from "@prisma-next/sql-schema-ir/types";
5
5
  import { AnyQueryAst, DdlNode, LoweredStatement, LowererContext, SqlExecuteRequest } from "@prisma-next/sql-relational-core/ast";
6
- import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
7
6
 
7
+ //#region src/core/diff/sql-schema-diff.d.ts
8
+ /**
9
+ * Function type for normalizing raw database default expressions into ColumnDefault.
10
+ * Target-specific implementations handle database dialect differences.
11
+ */
12
+ type DefaultNormalizer = (rawDefault: string, nativeType: string) => ColumnDefault | undefined;
13
+ /**
14
+ * Function type for normalizing schema native types to canonical form for comparison.
15
+ * Target-specific implementations handle dialect-specific type name variations
16
+ * (e.g., Postgres 'varchar' → 'character varying', 'timestamptz' normalization).
17
+ */
18
+ type NativeTypeNormalizer = (nativeType: string) => string;
19
+ /**
20
+ * Compares two arrays of strings for equality (order-sensitive).
21
+ */
22
+ declare function arraysEqual(a: readonly string[], b: readonly string[]): boolean;
23
+ //#endregion
8
24
  //#region src/core/control-adapter.d.ts
9
25
  /**
10
26
  * Structural interface for anything that can lower a SQL/DDL AST node to a
@@ -108,20 +124,26 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
108
124
  readonly migrationName: string;
109
125
  readonly migrationHash: string;
110
126
  readonly operations: readonly unknown[];
127
+ readonly destinationContractJson?: unknown;
111
128
  }): Promise<void>;
112
129
  /**
113
- * Introspects a database schema and returns a raw SqlSchemaIR.
130
+ * Introspects a database schema and returns the target's schema-IR node.
114
131
  *
115
132
  * This is a pure schema discovery operation that queries the database catalog
116
133
  * and returns the schema structure without type mapping or contract enrichment.
117
134
  * Type mapping and enrichment are handled separately by enrichment helpers.
118
135
  *
136
+ * The return type is the family-base `SqlSchemaIRNode` so each target returns
137
+ * its own node shape: SQLite returns a flat `SqlSchemaIR`, Postgres returns a
138
+ * `PostgresDatabaseSchemaNode` tree root. Consumers `ensure` the concrete
139
+ * target type before walking it.
140
+ *
119
141
  * @param driver - ControlDriverInstance instance for executing queries (target-specific)
120
142
  * @param contract - Optional contract for contract-guided introspection (filtering, optimization)
121
143
  * @param schema - Schema name to introspect (defaults to 'public')
122
- * @returns Promise resolving to SqlSchemaIR representing the live database schema
144
+ * @returns Promise resolving to the live database schema node
123
145
  */
124
- introspect(driver: SqlControlDriverInstance<TTarget>, contract?: unknown, schema?: string): Promise<SqlSchemaIR>;
146
+ introspect(driver: SqlControlDriverInstance<TTarget>, contract?: unknown, schema?: string): Promise<SqlSchemaIRNode>;
125
147
  /**
126
148
  * Optional target-specific normalizer for raw database default expressions.
127
149
  * When provided, schema defaults (raw strings) are normalized before comparison
@@ -161,5 +183,5 @@ interface SqlControlAdapterDescriptor<TTarget extends string = string> {
161
183
  create(stack: ControlStack<'sql', TTarget>): SqlControlAdapter<TTarget>;
162
184
  }
163
185
  //#endregion
164
- export { SqlControlAdapterDescriptor as i, Lowerer as n, SqlControlAdapter as r, ExecuteRequestLowerer as t };
165
- //# sourceMappingURL=control-adapter-Cmw9LvEP.d.mts.map
186
+ export { NativeTypeNormalizer as a, SqlControlAdapterDescriptor as i, Lowerer as n, arraysEqual as o, SqlControlAdapter as r, ExecuteRequestLowerer as t };
187
+ //# sourceMappingURL=control-adapter-BQgad8Zc.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-adapter-BQgad8Zc.d.mts","names":[],"sources":["../src/core/diff/sql-schema-diff.ts","../src/core/control-adapter.ts"],"mappings":";;;;;;;;;;;KAeY,iBAAA,IACV,UAAA,UACA,UAAA,aACG,aAAa;;A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IAAA,SACA,WAAA;IAAA,SACA,UAAA;EAAA,IAEV,OAAA;EASgC;;;;;;EADnC,gBAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,KAAA,UACA,KAAA;IAAA,SACW,MAAA;IAAA,SACA,IAAA;IAAA,SACA,EAAA;IAAA,SACA,aAAA;IAAA,SACA,aAAA;IAAA,SACA,UAAA;IAAA,SACA,uBAAA;EAAA,IAEV,OAAA;EA/G8B;;;;;;;;;;;;;;;;;EAkIjC,UAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,QAAA,YACA,MAAA,YACC,OAAA,CAAQ,eAAA;EAhGX;;;;;EAAA,SAuGS,gBAAA,GAAmB,iBAAA;EApGR;;;;;EAAA,SA2GX,mBAAA,GAAsB,oBAAA;EA/FlB;;;;EAqGb,4BAAA,aAAyC,OAAA;EAzFzC;;;;EA+FA,0BAAA,aAAuC,OAAA;AAAA;;;;;;;UASxB,2BAAA;EAtFb;;;;;;EA6FF,MAAA,CAAO,KAAA,EAAO,YAAA,QAAoB,OAAA,IAAW,iBAAA,CAAkB,OAAA;AAAA"}
@@ -1,2 +1,2 @@
1
- import { i as SqlControlAdapterDescriptor, n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-Cmw9LvEP.mjs";
1
+ import { i as SqlControlAdapterDescriptor, n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-BQgad8Zc.mjs";
2
2
  export type { ExecuteRequestLowerer, Lowerer, SqlControlAdapter, SqlControlAdapterDescriptor };
@@ -1,12 +1,141 @@
1
- import { A as SqlPlannerResult, C as SqlMigrationRunnerResult, D as SqlPlannerConflictKind, E as SqlPlannerConflict, M as StorageTypePlanResult, N as SqlControlFamilyInstance, O as SqlPlannerConflictLocation, S as SqlMigrationRunnerFailure, T as SqlPlanTargetDetails, _ as SqlMigrationPlannerPlanOptions, a as FieldEvent, b as SqlMigrationRunnerExecuteCallbacks, c as SqlControlAdapterDescriptor, d as SqlMigrationPlan, f as SqlMigrationPlanContractInfo, g as SqlMigrationPlanner, h as SqlMigrationPlanOperationTarget, i as ExpandNativeTypeInput, j as SqlPlannerSuccessResult, k as SqlPlannerFailureResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationStep, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperation, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, t as AnyRecord, u as SqlControlTargetDescriptor, v as SqlMigrationRunner, w as SqlMigrationRunnerSuccessValue, x as SqlMigrationRunnerExecuteOptions, y as SqlMigrationRunnerErrorCode } from "./types-kgstZ_Zd.mjs";
2
- import { ControlFamilyDescriptor, ControlStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, OpFactoryCall, TargetMigrationsCapability, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
3
- import { SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
1
+ import { r as SqlControlAdapter } from "./control-adapter-BQgad8Zc.mjs";
2
+ import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, t as AnyRecord, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-BPv_y7iS.mjs";
3
+ import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DnoopSXm.mjs";
4
+ import { ContractSerializer, ControlFamilyDescriptor, ControlFamilyInstance, ControlStack, DiffSubjectGranularity, MigratableTargetDescriptor, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanOperation as MigrationPlanOperation$1, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, OpFactoryCall, OperationPreview, OperationPreviewCapable, PslContractInferCapable, SchemaDiffIssue, SchemaVerifier, SchemaViewCapable, SignDatabaseResult, TargetMigrationsCapability, VerifyDatabaseResult, VerifyDatabaseSchemaResult, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
4
5
  import { ColumnDefault, Contract, ControlPolicy } from "@prisma-next/contract/types";
6
+ import { SqlControlDriverInstance, SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
7
+ import { SqlSchemaIR, SqlSchemaIRNode } from "@prisma-next/sql-schema-ir/types";
5
8
  import { NotOk, Ok } from "@prisma-next/utils/result";
6
- import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
9
+ import { AnyQueryAst, DdlNode, LowererContext, SqlExecuteRequest } from "@prisma-next/sql-relational-core/ast";
10
+ import { EmissionSpi, TypesImportSpec } from "@prisma-next/framework-components/emission";
7
11
  import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
8
- import { EmissionSpi } from "@prisma-next/framework-components/emission";
12
+ import { PslDocumentAst } from "@prisma-next/framework-components/psl-ast";
13
+ import { SqlOperationDescriptors } from "@prisma-next/sql-operations";
9
14
 
15
+ //#region src/core/control-instance.d.ts
16
+ interface SqlTypeMetadata {
17
+ readonly typeId: string;
18
+ readonly familyId: 'sql';
19
+ readonly targetId: string;
20
+ readonly nativeType?: string;
21
+ }
22
+ type SqlTypeMetadataRegistry = Map<string, SqlTypeMetadata>;
23
+ interface SqlFamilyInstanceState {
24
+ readonly codecTypeImports: ReadonlyArray<TypesImportSpec>;
25
+ readonly extensionIds: ReadonlyArray<string>;
26
+ readonly typeMetadataRegistry: SqlTypeMetadataRegistry;
27
+ }
28
+ interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql', SqlSchemaIRNode>, SchemaViewCapable<SqlSchemaIRNode>, PslContractInferCapable<SqlSchemaIRNode>, OperationPreviewCapable, SqlFamilyInstanceState {
29
+ /**
30
+ * The family seam-of-record for on-disk contract reads. Structurally
31
+ * validates the JSON envelope, then hydrates IR-class instances via
32
+ * the per-target ContractSerializer. The single named entry point
33
+ * every CLI on-disk read crosses (TML-2536) — `as Contract` casts
34
+ * in production package sources are a serializer-bypass smell guarded
35
+ * by `pnpm lint:no-contract-cast`.
36
+ */
37
+ deserializeContract(contractJson: unknown): Contract;
38
+ verify(options: {
39
+ readonly driver: SqlControlDriverInstance<string>;
40
+ readonly contract: unknown;
41
+ readonly expectedTargetId: string;
42
+ readonly contractPath: string;
43
+ readonly configPath?: string;
44
+ }): Promise<VerifyDatabaseResult>;
45
+ /**
46
+ * Verify a contract against an already-introspected schema.
47
+ *
48
+ * Callers that need to verify against the live database compose
49
+ * `introspect({ driver })` + `verifySchema({ contract, schema, ... })`.
50
+ * The aggregate verifier hands in the full introspected schema and scopes
51
+ * the returned result to each member's contract space afterwards — so
52
+ * sibling-space tables never survive as `extras`.
53
+ */
54
+ verifySchema(options: {
55
+ readonly contract: unknown;
56
+ readonly schema: SqlSchemaIRNode;
57
+ readonly strict: boolean;
58
+ readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
59
+ }): VerifyDatabaseSchemaResult;
60
+ /**
61
+ * Classifies a diff issue's subject granularity on demand, resolved from
62
+ * its node's `nodeKind` via the target's classifier. Satisfies the
63
+ * {@link import('@prisma-next/framework-components/control').SchemaSubjectClassifierCapable}
64
+ * capability that framework consumers spanning contract spaces (the
65
+ * migration aggregate's unclaimed-elements sweep) detect via
66
+ * `hasSchemaSubjectClassifier` and call instead of reading family/target
67
+ * node vocabulary. Nothing is stamped on the issue or the node.
68
+ */
69
+ classifySubjectGranularity(issue: SchemaDiffIssue): DiffSubjectGranularity | undefined;
70
+ /**
71
+ * Classifies a diff issue's subject storage `entityKind` on demand,
72
+ * resolved from its node's `nodeKind` via the target's classifier —
73
+ * sibling of `classifySubjectGranularity` above, part of the same
74
+ * {@link import('@prisma-next/framework-components/control').SchemaSubjectClassifierCapable}
75
+ * capability. Nothing is stamped on the issue or the node.
76
+ */
77
+ classifyEntityKind(issue: SchemaDiffIssue): string | undefined;
78
+ sign(options: {
79
+ readonly driver: SqlControlDriverInstance<string>;
80
+ readonly contract: unknown;
81
+ readonly contractPath: string;
82
+ readonly configPath?: string;
83
+ }): Promise<SignDatabaseResult>;
84
+ introspect(options: {
85
+ readonly driver: SqlControlDriverInstance<string>;
86
+ readonly contract?: unknown;
87
+ }): Promise<SqlSchemaIRNode>;
88
+ inferPslContract(schemaIR: SqlSchemaIRNode): PslDocumentAst;
89
+ lowerAst(ast: AnyQueryAst | DdlNode, context: LowererContext<unknown>): Promise<SqlExecuteRequest>;
90
+ /**
91
+ * Inserts the initial marker row for `space` (upsert on `space`).
92
+ * Delegates to the target control adapter's write SPI; see
93
+ * `SqlControlAdapter.initMarker`.
94
+ */
95
+ initMarker(options: {
96
+ readonly driver: SqlControlDriverInstance<string>;
97
+ readonly space: string;
98
+ readonly destination: {
99
+ readonly storageHash: string;
100
+ readonly profileHash: string;
101
+ readonly invariants?: readonly string[];
102
+ };
103
+ }): Promise<void>;
104
+ /**
105
+ * Compare-and-swap advance of the marker row for `space`. Returns `true`
106
+ * when the swap matched a row; see `SqlControlAdapter.updateMarker`.
107
+ */
108
+ updateMarker(options: {
109
+ readonly driver: SqlControlDriverInstance<string>;
110
+ readonly space: string;
111
+ readonly expectedFrom: string;
112
+ readonly destination: {
113
+ readonly storageHash: string;
114
+ readonly profileHash: string;
115
+ readonly invariants?: readonly string[];
116
+ };
117
+ }): Promise<boolean>;
118
+ /**
119
+ * Appends a ledger entry for `space`; see
120
+ * `SqlControlAdapter.writeLedgerEntry`.
121
+ */
122
+ writeLedgerEntry(options: {
123
+ readonly driver: SqlControlDriverInstance<string>;
124
+ readonly space: string;
125
+ readonly entry: {
126
+ readonly edgeId: string;
127
+ readonly from: string;
128
+ readonly to: string;
129
+ readonly migrationName: string;
130
+ readonly migrationHash: string;
131
+ readonly operations: readonly unknown[];
132
+ readonly destinationContractJson?: unknown;
133
+ };
134
+ }): Promise<void>;
135
+ bootstrapControlTableQueries(): readonly DdlNode[];
136
+ toOperationPreview(operations: readonly MigrationPlanOperation$1[]): OperationPreview;
137
+ }
138
+ //#endregion
10
139
  //#region src/core/control-descriptor.d.ts
11
140
  declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlControlFamilyInstance> {
12
141
  readonly kind: "family";
@@ -258,6 +387,82 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
258
387
  //#region src/core/assembly.d.ts
259
388
  declare function extractCodecControlHooks(descriptors: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): Map<string, CodecControlHooks>;
260
389
  //#endregion
390
+ //#region src/core/control-target-descriptor.d.ts
391
+ /**
392
+ * One stack extension pack's already-assembled contract, paired with the
393
+ * `spaceId` its extension descriptor was registered under. `contract infer`
394
+ * needs both: the contract to know which elements the pack describes and to
395
+ * resolve the domain model a cross-space foreign key targets, the `spaceId`
396
+ * to qualify the emitted relation type (`<spaceId>:<namespace>.<Model>`).
397
+ * Neither the contract JSON nor the framework's `ContractSpace` wrapper
398
+ * self-declares its owning space id — it is only known from the extension
399
+ * descriptor that carries the `ContractSpace`.
400
+ */
401
+ interface SqlDescribedContractSpace {
402
+ readonly spaceId: string;
403
+ readonly contract: Contract<SqlStorage>;
404
+ }
405
+ interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails, TContract extends Contract<SqlStorage> = Contract<SqlStorage>> extends MigratableTargetDescriptor<'sql', TTargetId, SqlControlFamilyInstance> {
406
+ readonly queryOperations?: () => SqlOperationDescriptors;
407
+ /**
408
+ * JSON ⇄ class boundary for the SQL target's contract. The descriptor
409
+ * composes a concrete `SqlContractSerializerBase` subclass; the rest
410
+ * of the control stack reaches `descriptor.contractSerializer` rather
411
+ * than importing a per-target deserialization function.
412
+ */
413
+ readonly contractSerializer: ContractSerializer<TContract>;
414
+ /**
415
+ * Per-target schema verifier walking the contract against
416
+ * `SqlSchemaIR`. The descriptor composes a concrete
417
+ * `SqlSchemaVerifierBase` subclass; the family-shared walk lives on
418
+ * the base, the target-specific dispatch on the subclass.
419
+ */
420
+ readonly schemaVerifier: SchemaVerifier<TContract, SqlSchemaIR>;
421
+ /**
422
+ * Database→PSL inference for `contract infer`. Target logic (owns the dialect
423
+ * maps), so it lives on the descriptor. Optional: targets without `contract
424
+ * infer` (Mongo) omit it, and the family instance throws when it is absent.
425
+ * `describedContracts` carries the stack's extension packs' already-assembled
426
+ * contracts (each paired with its `spaceId`) so the inferrer can omit elements
427
+ * they already describe, and can qualify a cross-space relation with the
428
+ * owning pack's space id.
429
+ */
430
+ readonly inferPslContract?: (schema: SqlSchemaIRNode, describedContracts?: readonly SqlDescribedContractSpace[]) => PslDocumentAst;
431
+ /**
432
+ * The full-tree node diff the family verify verdict derives from —
433
+ * expected-tree derivation, pre-diff normalization, the generic differ,
434
+ * and ownership scoping, all target-side. The family applies strict
435
+ * gating + control-policy disposition over the returned issues; verify
436
+ * rejects when a surviving issue is a failure.
437
+ */
438
+ readonly diffSchema: SqlSchemaDiffFn;
439
+ /**
440
+ * Classifies a diff-tree node's `nodeKind` into its framework-neutral
441
+ * {@link DiffSubjectGranularity} — the target owns the full node vocabulary
442
+ * that appears in its diff tree (its own kinds plus the relational kinds it
443
+ * delegates to), so it is the one place that can resolve this. The family
444
+ * verdict calls it inline per issue (never stamping the result); the
445
+ * framework aggregate's unclaimed-elements sweep reaches the same
446
+ * classifier via the family instance's `classifySubjectGranularity`
447
+ * capability.
448
+ */
449
+ readonly classifySubjectGranularity: (nodeKind: string) => DiffSubjectGranularity;
450
+ /**
451
+ * Classifies a diff-tree node's `nodeKind` into its storage `entityKind` —
452
+ * the same vocabulary the contract storage's `entries` dictionary keys use
453
+ * (e.g. `'table'`). Sibling of `classifySubjectGranularity`, resolved the
454
+ * same way: the target owns the full node vocabulary, so it is the one
455
+ * place that can resolve this. `undefined` for a node kind with no
456
+ * storage entity of its own (a column, an index, …). The framework
457
+ * aggregate's unclaimed-elements sweep reaches this via the family
458
+ * instance's `classifyEntityKind` capability, so it never hardcodes a
459
+ * family entity kind.
460
+ */
461
+ readonly classifyEntityKind: (nodeKind: string) => string | undefined;
462
+ createPlanner(adapter: SqlControlAdapter<TTargetId>): SqlMigrationPlanner<TTargetDetails>;
463
+ createRunner(family: SqlControlFamilyInstance): SqlMigrationRunner<TTargetDetails>;
464
+ }
465
+ //#endregion
261
466
  //#region src/core/migrations/contract-to-schema-ir.d.ts
262
467
  /**
263
468
  * Target-specific callback that expands a column's base `nativeType` and optional
@@ -339,6 +544,21 @@ interface ContractToSchemaIROptions {
339
544
  *
340
545
  * Returns an empty schema IR when `contract` is `null` (new project).
341
546
  */
547
+ /**
548
+ * Converts the tables of a single namespace into a `SqlSchemaIR`, keyed by
549
+ * table name within that namespace. Unlike {@link contractToSchemaIR}, which
550
+ * flattens every namespace's tables into one bare-keyed record (and throws on a
551
+ * cross-namespace name collision), this scopes the table iteration to one
552
+ * namespace so the same table name can exist in two schemas.
553
+ *
554
+ * The full `storage` is still passed to `convertTable`, so value-set / enum /
555
+ * type resolution that legitimately spans namespaces is unaffected. Foreign
556
+ * keys are built purely from the FK descriptor (`fk.target`), so cross-namespace
557
+ * FKs survive per-namespace conversion. The `annotations` block (storage-type
558
+ * derived) is omitted here — the per-namespace tree consumer reads only the
559
+ * per-table fields.
560
+ */
561
+ declare function contractNamespaceToSchemaIR(storage: SqlStorage, namespaceId: string, options: ContractToSchemaIROptions): SqlSchemaIR;
342
562
  declare function contractToSchemaIR(contract: Contract<SqlStorage> | null, options: ContractToSchemaIROptions): SqlSchemaIR;
343
563
  //#endregion
344
564
  //#region src/core/migrations/control-policy.d.ts
@@ -347,13 +567,19 @@ declare function contractToSchemaIR(contract: Contract<SqlStorage> | null, optio
347
567
  * resolved from the target's own IR. `undefined` means the call's target
348
568
  * object could not be positively established — a fail-closed signal: any
349
569
  * policy stricter than `managed` drops such a call rather than emitting it.
570
+ *
571
+ * The object identity is a generic storage coordinate — `(entityKind,
572
+ * entityName)`, absent for a whole-namespace subject — never a target-specific
573
+ * `table`/`typeName` field. The family reasons about the coordinate for policy
574
+ * and deduplication; the target owns any vocabulary (table vs enum) when it
575
+ * renders a suppression.
350
576
  */
351
577
  interface ControlPolicySubject {
352
578
  readonly namespaceId: string;
353
- readonly explicitNodeControlPolicy?: ControlPolicy;
354
- readonly table?: string;
579
+ readonly entityKind?: string;
580
+ readonly entityName?: string;
355
581
  readonly column?: string;
356
- readonly typeName?: string;
582
+ readonly explicitNodeControlPolicy?: ControlPolicy;
357
583
  /**
358
584
  * Whether the call creates a whole, previously-absent top-level storage
359
585
  * object (e.g. a table or an enum/type), as opposed to modifying an
@@ -363,6 +589,25 @@ interface ControlPolicySubject {
363
589
  */
364
590
  readonly createsNewObject: boolean;
365
591
  }
592
+ /**
593
+ * The structured record a control-policy partition emits for one suppressed
594
+ * subject or call. It carries only raw data — no strings, no vocabulary — so
595
+ * the consumer (the target) renders the user-facing message itself:
596
+ *
597
+ * - `subject` — the suppressed subject (its coordinate + namespace), or
598
+ * `undefined` when the subject could not be resolved (fail-closed).
599
+ * - `policy` — the effective control policy that caused the suppression.
600
+ * - `factoryName` — the resolved creation factory name if the suppressed thing
601
+ * was a whole-object creation (e.g. `createTable`), else `undefined`. The
602
+ * family never invents a verb for a modification that produced no call.
603
+ * - `createsNewObject` — whether the suppressed thing was object creation.
604
+ */
605
+ interface SuppressionRecord {
606
+ readonly subject: ControlPolicySubject | undefined;
607
+ readonly policy: ControlPolicy;
608
+ readonly factoryName: string | undefined;
609
+ readonly createsNewObject: boolean;
610
+ }
366
611
  /**
367
612
  * The control policy that governs a single call. The `external` default is an
368
613
  * un-overridable namespace floor: when the contract default is `external`, no
@@ -374,7 +619,7 @@ declare function controlPolicyForCall(subject: ControlPolicySubject | undefined,
374
619
  /**
375
620
  * Partition the calls produced for a single set of subjects into those the
376
621
  * effective control policy permits (`kept`) and a list of
377
- * {@link SqlPlannerConflict} warnings describing the suppressed calls.
622
+ * {@link SuppressionRecord}s describing the suppressed calls.
378
623
  *
379
624
  * **Prefer {@link partitionIssuesByControlPolicy}** for the schema-issue
380
625
  * pipeline: it filters subjects out of the planner's *input* so the planner
@@ -389,10 +634,9 @@ declare function partitionCallsByControlPolicy<TCall>(options: {
389
634
  readonly contract: Contract<SqlStorage>;
390
635
  readonly resolveControlPolicySubject: (call: TCall) => ControlPolicySubject | undefined;
391
636
  readonly resolveFactoryName: (call: TCall) => string;
392
- readonly formatSubjectLabel?: (factoryName: string, subject: ControlPolicySubject | undefined) => string;
393
637
  }): {
394
638
  readonly kept: readonly TCall[];
395
- readonly warnings: readonly SqlPlannerConflict[];
639
+ readonly suppressions: readonly SuppressionRecord[];
396
640
  };
397
641
  /**
398
642
  * Partition a list of schema-issue-shaped inputs by the effective control
@@ -408,18 +652,15 @@ declare function partitionCallsByControlPolicy<TCall>(options: {
408
652
  * cannot reason about the live shape of a subject the user marked as
409
653
  * out-of-scope (`external`).
410
654
  *
411
- * `warnings` is one {@link SqlPlannerConflict} per suppressed subject (not per
412
- * suppressed issue). `factoryName` is inferred from the subject's issue mix:
413
- * if any of the subject's issues is whole-object creation, the warning takes
414
- * the corresponding creation factoryName (e.g. `createTable`,
415
- * `createEnumType`, `createSchema`); otherwise it falls back to
416
- * `defaultModificationFactoryName(subject)` — a synthetic label that names
417
- * the *kind* of mutation that would have run, since no concrete DDL call was
418
- * generated.
655
+ * `suppressions` is one {@link SuppressionRecord} per suppressed subject (not
656
+ * per suppressed issue). Its `factoryName` is the creation factory name when any
657
+ * of the subject's issues is whole-object creation (e.g. `createTable`), else
658
+ * `undefined` — the family never invents a modification verb for an op that
659
+ * produced no call; the target renders the message.
419
660
  *
420
661
  * Unresolved-subject issues (`resolveControlPolicySubject` returns
421
- * `undefined`) emit one warning each; they cannot be deduplicated because
422
- * they carry no subject coordinate.
662
+ * `undefined`) emit one record each; they cannot be deduplicated because they
663
+ * carry no subject coordinate.
423
664
  */
424
665
  declare function partitionIssuesByControlPolicy<TIssue>(options: {
425
666
  readonly issues: readonly TIssue[];
@@ -437,22 +678,13 @@ declare function partitionIssuesByControlPolicy<TIssue>(options: {
437
678
  *
438
679
  * 1. Under `tolerated`, only issues whose `resolveCreationFactoryName`
439
680
  * returns a value flow into the planner (create-if-absent).
440
- * 2. Subjects that have at least one creation-flavoured issue use the
441
- * resolved creation factoryName for their suppression warning;
442
- * otherwise they fall back to `defaultModificationFactoryName`.
681
+ * 2. A suppressed subject's record carries the resolved creation factoryName
682
+ * when it has at least one creation-flavoured issue, else `undefined`.
443
683
  */
444
684
  readonly resolveCreationFactoryName: (issue: TIssue) => string | undefined;
445
- /**
446
- * Default modification factoryName for a suppressed subject whose issues
447
- * are all non-creation (the subject exists but has a different shape).
448
- * Defaults to `'alterTable'` / `'alterType'` / `'alterSchema'` based on the
449
- * subject's populated coordinates.
450
- */
451
- readonly defaultModificationFactoryName?: (subject: ControlPolicySubject) => string;
452
- readonly formatSubjectLabel?: (factoryName: string, subject: ControlPolicySubject | undefined) => string;
453
685
  }): {
454
686
  readonly plannable: readonly TIssue[];
455
- readonly warnings: readonly SqlPlannerConflict[];
687
+ readonly suppressions: readonly SuppressionRecord[];
456
688
  };
457
689
  //#endregion
458
690
  //#region src/core/migrations/field-event-planner.d.ts
@@ -479,6 +711,19 @@ interface PlanFieldEventOperationsOptions {
479
711
  }
480
712
  declare function planFieldEventOperations(options: PlanFieldEventOperationsOptions): readonly OpFactoryCall[];
481
713
  //#endregion
714
+ //#region src/core/migrations/native-type-expander.d.ts
715
+ /**
716
+ * Builds the codec-hook-composed `expandNativeType` callback the contract→IR
717
+ * derivation uses to expand parameterized native types (e.g. `character` +
718
+ * `{ length: 36 }` → `character(36)`). Returns `undefined` when no framework
719
+ * components are supplied, so callers can omit the option entirely.
720
+ */
721
+ declare function buildNativeTypeExpander(frameworkComponents?: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): ((input: {
722
+ readonly nativeType: string;
723
+ readonly codecId?: string;
724
+ readonly typeParams?: Record<string, unknown>;
725
+ }) => string) | undefined;
726
+ //#endregion
482
727
  //#region src/core/migrations/plan-helpers.d.ts
483
728
  declare function createMigrationPlan<TTargetDetails>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
484
729
  declare function plannerSuccess<TTargetDetails>(plan: SqlMigrationPlan<TTargetDetails>, warnings?: readonly SqlPlannerConflict[]): SqlPlannerSuccessResult<TTargetDetails>;
@@ -564,5 +809,5 @@ declare function temporalAuthoringPresets<const CodecId extends string, const Na
564
809
  //#region src/exports/control.d.ts
565
810
  declare const _default: SqlFamilyDescriptor;
566
811
  //#endregion
567
- export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type StorageTypePlanResult, type TargetMigrationsCapability, assembleAuthoringContributions, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
812
+ export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type StorageTypePlanResult, type SuppressionRecord, type TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
568
813
  //# sourceMappingURL=control.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/control-policy.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;cAWa,mBAAA,YACA,uBAAA,QAA+B,wBAAA;EAAA,SAEjC,IAAA;EAAA,SACA,EAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA,EAAU,WAAA;EAAA,SACV,SAAA;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,aAAA,CAAc,KAAA;EAC5B,iBAAA;EACA,kBAAA;AAAA,IACE,EAAE,CAAC,8BAAA;;;;iBAYS,aAAA,CACd,IAAA,EAAM,2BAAA,EACN,OAAA,UACA,OAAA;EAAY,GAAA;EAAc,IAAA,GAAO,SAAA;AAAA,IAChC,KAAA,CAAM,yBAAA;;;;;;cC1KI,oBAAA,EAAsB,0BAEjC;;;;;;;;;;;;;;iBCoBc,6BAAA,IAAiC,kCAAkC;;;;;;;;;;;iBAqBnE,wBAAA,gEAGd,KAAA;EAAA,SAAkB,OAAA,EAAS,OAAA;EAAA,SAAkB,UAAA,EAAY,UAAA;AAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC6BlB,QAAA"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-instance.ts","../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/control-target-descriptor.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/control-policy.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/native-type-expander.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;;;;;;UAwLU,eAAA;EAAA,SACC,MAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;EAAA,SACA,UAAA;AAAA;AAAA,KAGN,uBAAA,GAA0B,GAAG,SAAS,eAAA;AAAA,UAEjC,sBAAA;EAAA,SACC,gBAAA,EAAkB,aAAA,CAAc,eAAA;EAAA,SAChC,YAAA,EAAc,aAAA;EAAA,SACd,oBAAA,EAAsB,uBAAA;AAAA;AAAA,UAGhB,wBAAA,SACP,qBAAA,QAA6B,eAAA,GACnC,iBAAA,CAAkB,eAAA,GAClB,uBAAA,CAAwB,eAAA,GACxB,uBAAA,EACA,sBAAA;EAjBO;;;AACU;AAAA;;;;EAyBnB,mBAAA,CAAoB,YAAA,YAAwB,QAAA;EAE5C,MAAA,CAAO,O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