@prisma-next/family-sql 0.14.0-dev.6 → 0.14.0-dev.60

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 (79) 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-BeN8TDZ5.d.mts} +29 -8
  4. package/dist/control-adapter-BeN8TDZ5.d.mts.map +1 -0
  5. package/dist/control-adapter.d.mts +1 -1
  6. package/dist/control.d.mts +238 -6
  7. package/dist/control.d.mts.map +1 -1
  8. package/dist/control.mjs +347 -942
  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/ir.d.mts +26 -9
  15. package/dist/ir.d.mts.map +1 -1
  16. package/dist/ir.mjs +2 -2
  17. package/dist/ir.mjs.map +1 -1
  18. package/dist/migration.d.mts +11 -2
  19. package/dist/migration.d.mts.map +1 -1
  20. package/dist/migration.mjs +7 -0
  21. package/dist/migration.mjs.map +1 -1
  22. package/dist/pack.mjs +1 -1
  23. package/dist/psl-infer.d.mts +108 -0
  24. package/dist/psl-infer.d.mts.map +1 -0
  25. package/dist/psl-infer.mjs +353 -0
  26. package/dist/psl-infer.mjs.map +1 -0
  27. package/dist/schema-differ-DnoopSXm.d.mts +45 -0
  28. package/dist/schema-differ-DnoopSXm.d.mts.map +1 -0
  29. package/dist/schema-verify-W3r631Jh.mjs +226 -0
  30. package/dist/schema-verify-W3r631Jh.mjs.map +1 -0
  31. package/dist/{sql-contract-serializer-BR2vC7Z-.mjs → sql-contract-serializer-C75cfMSS.mjs} +46 -20
  32. package/dist/sql-contract-serializer-C75cfMSS.mjs.map +1 -0
  33. package/dist/{types-kgstZ_Zd.d.mts → types-COTsneBU.d.mts} +34 -139
  34. package/dist/types-COTsneBU.d.mts.map +1 -0
  35. package/package.json +23 -23
  36. package/src/core/authoring-entity-types.ts +12 -37
  37. package/src/core/control-adapter.ts +10 -5
  38. package/src/core/control-instance.ts +210 -42
  39. package/src/core/control-target-descriptor.ts +98 -0
  40. package/src/core/diff/schema-verify.ts +324 -0
  41. package/src/core/diff/sql-schema-diff.ts +41 -0
  42. package/src/core/diff/verifier-disposition.ts +30 -0
  43. package/src/core/ir/sql-contract-serializer-base.ts +70 -56
  44. package/src/core/ir/sql-contract-serializer.ts +5 -7
  45. package/src/core/ir/sql-schema-verifier-base.ts +5 -5
  46. package/src/core/migrations/contract-to-schema-ir.ts +126 -32
  47. package/src/core/migrations/field-event-planner.ts +2 -2
  48. package/src/core/migrations/native-type-expander.ts +28 -0
  49. package/src/core/migrations/schema-differ.ts +41 -0
  50. package/src/core/migrations/types.ts +31 -34
  51. package/src/core/psl-contract-infer/name-transforms.ts +15 -0
  52. package/src/core/psl-contract-infer/printer-config.ts +12 -6
  53. package/src/core/psl-contract-infer/relation-inference.ts +9 -1
  54. package/src/core/sql-migration.ts +12 -1
  55. package/src/exports/control.ts +11 -1
  56. package/src/exports/diff.ts +25 -0
  57. package/src/exports/psl-infer.ts +40 -0
  58. package/dist/authoring-type-constructors-CjFfO6LM.mjs.map +0 -1
  59. package/dist/control-adapter-Cmw9LvEP.d.mts.map +0 -1
  60. package/dist/schema-verify.d.mts +0 -39
  61. package/dist/schema-verify.d.mts.map +0 -1
  62. package/dist/schema-verify.mjs +0 -2
  63. package/dist/sql-contract-serializer-BR2vC7Z-.mjs.map +0 -1
  64. package/dist/test-utils.d.mts +0 -2
  65. package/dist/test-utils.mjs +0 -2
  66. package/dist/types-kgstZ_Zd.d.mts.map +0 -1
  67. package/dist/verify-sql-schema-thU-jKpf.d.mts +0 -66
  68. package/dist/verify-sql-schema-thU-jKpf.d.mts.map +0 -1
  69. package/dist/verify-sql-schema-xT4udQLQ.mjs +0 -1501
  70. package/dist/verify-sql-schema-xT4udQLQ.mjs.map +0 -1
  71. package/src/core/psl-contract-infer/postgres-default-mapping.ts +0 -16
  72. package/src/core/psl-contract-infer/postgres-type-map.ts +0 -157
  73. package/src/core/psl-contract-infer/sql-schema-ir-to-psl-ast.ts +0 -795
  74. package/src/core/schema-verify/control-verify-emit.ts +0 -46
  75. package/src/core/schema-verify/verifier-disposition.ts +0 -58
  76. package/src/core/schema-verify/verify-helpers.ts +0 -820
  77. package/src/core/schema-verify/verify-sql-schema.ts +0 -1311
  78. package/src/exports/schema-verify.ts +0 -18
  79. 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,WAAW,SAAS,QACtB,IAAI;IACF,QAAQ,MAAM,WAAW,UAAU;GACrC,QAAQ;IACN,aAAa,KAAK;KAChB,MAAM;KACN,SAAS,SAAS,MAAM,KAAK,YAAY,WAAW,4BAA4B,QAAQ;KACxF;KACA,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QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,GACV;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;IACN,EACF;IACA,IAAI;GACN;EACF;EACA,QAAQ;GACN,MAAM;GACN,MAAM,CAAC,qBAAqB;GAC5B,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ;KACN,MAAM;KACN,OAAO;KACP,MAAM,CAAC,MAAM;KACb,SAAS;IACX,EACF;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACJ,QAAQ,EACN,MAAM;MACJ,MAAM;MACN,OAAO;MACP,MAAM,CAAC,MAAM;KACf,EACF;IACF,EACF;IACA,IAAI;GACN;EACF;EACA,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,GACV;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;IACN,EACF;IACA,IAAI;GACN;EACF;EACA,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,GACV;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;IACN,EACF;IACA,IAAI;GACN;EACF;CACF;AACF;;;ACpNA,MAAa,0BAA0B,EACrC,KAAK,EACH,QAAQ;CACN,MAAM;CACN,MAAM,CAAC;EAAE,MAAM;EAAU,MAAM;EAAU,SAAS;EAAM,SAAS;EAAG,SAAS;CAAS,CAAC;CACvF,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAAO;EAAE,EAClC;CACF;AACF,EACF,EACF"}
@@ -1,10 +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
@@ -110,18 +126,23 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
110
126
  readonly operations: readonly unknown[];
111
127
  }): Promise<void>;
112
128
  /**
113
- * Introspects a database schema and returns a raw SqlSchemaIR.
129
+ * Introspects a database schema and returns the target's schema-IR node.
114
130
  *
115
131
  * This is a pure schema discovery operation that queries the database catalog
116
132
  * and returns the schema structure without type mapping or contract enrichment.
117
133
  * Type mapping and enrichment are handled separately by enrichment helpers.
118
134
  *
135
+ * The return type is the family-base `SqlSchemaIRNode` so each target returns
136
+ * its own node shape: SQLite returns a flat `SqlSchemaIR`, Postgres returns a
137
+ * `PostgresDatabaseSchemaNode` tree root. Consumers `ensure` the concrete
138
+ * target type before walking it.
139
+ *
119
140
  * @param driver - ControlDriverInstance instance for executing queries (target-specific)
120
141
  * @param contract - Optional contract for contract-guided introspection (filtering, optimization)
121
142
  * @param schema - Schema name to introspect (defaults to 'public')
122
- * @returns Promise resolving to SqlSchemaIR representing the live database schema
143
+ * @returns Promise resolving to the live database schema node
123
144
  */
124
- introspect(driver: SqlControlDriverInstance<TTarget>, contract?: unknown, schema?: string): Promise<SqlSchemaIR>;
145
+ introspect(driver: SqlControlDriverInstance<TTarget>, contract?: unknown, schema?: string): Promise<SqlSchemaIRNode>;
125
146
  /**
126
147
  * Optional target-specific normalizer for raw database default expressions.
127
148
  * When provided, schema defaults (raw strings) are normalized before comparison
@@ -161,5 +182,5 @@ interface SqlControlAdapterDescriptor<TTarget extends string = string> {
161
182
  create(stack: ControlStack<'sql', TTarget>): SqlControlAdapter<TTarget>;
162
183
  }
163
184
  //#endregion
164
- export { SqlControlAdapterDescriptor as i, Lowerer as n, SqlControlAdapter as r, ExecuteRequestLowerer as t };
165
- //# sourceMappingURL=control-adapter-Cmw9LvEP.d.mts.map
185
+ export { NativeTypeNormalizer as a, SqlControlAdapterDescriptor as i, Lowerer as n, arraysEqual as o, SqlControlAdapter as r, ExecuteRequestLowerer as t };
186
+ //# sourceMappingURL=control-adapter-BeN8TDZ5.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-adapter-BeN8TDZ5.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;;AAAA;AAOlB;;;KAAY,oBAAA,IAAwB,UAAkB;AAAA;AAKtD;;AALsD,iBAKtC,WAAA,CAAY,CAAA,qBAAsB,CAAoB;;;;AAftE;;;;;;UCQiB,OAAA;EACf,KAAA,CAAM,GAAA,EAAK,WAAA,GAAc,OAAA,EAAS,OAAA,EAAS,cAAA,YAA0B,gBAAA;AAA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IAAA,SACA,UAAA;EAAA,IAEV,OAAA;EA5GoB;;;;;;;;;;;;;;;;;EA+HvB,UAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,QAAA,YACA,MAAA,YACC,OAAA,CAAQ,eAAA;EArGoB;;;;;EAAA,SA4GtB,gBAAA,GAAmB,iBAAA;EAnGzB;;;;;EAAA,SA0GM,mBAAA,GAAsB,oBAAA;EAhG7B;;;;EAsGF,4BAAA,aAAyC,OAAA;EAhGtC;;;;EAsGH,0BAAA,aAAuC,OAAA;AAAA;;;;;;;UASxB,2BAAA;EArFoB;;;;;;EA4FnC,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-BeN8TDZ5.mjs";
2
2
  export type { ExecuteRequestLowerer, Lowerer, SqlControlAdapter, SqlControlAdapterDescriptor };
@@ -1,12 +1,140 @@
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-BeN8TDZ5.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-COTsneBU.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
+ };
133
+ }): Promise<void>;
134
+ bootstrapControlTableQueries(): readonly DdlNode[];
135
+ toOperationPreview(operations: readonly MigrationPlanOperation$1[]): OperationPreview;
136
+ }
137
+ //#endregion
10
138
  //#region src/core/control-descriptor.d.ts
11
139
  declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlControlFamilyInstance> {
12
140
  readonly kind: "family";
@@ -258,6 +386,82 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
258
386
  //#region src/core/assembly.d.ts
259
387
  declare function extractCodecControlHooks(descriptors: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): Map<string, CodecControlHooks>;
260
388
  //#endregion
389
+ //#region src/core/control-target-descriptor.d.ts
390
+ /**
391
+ * One stack extension pack's already-assembled contract, paired with the
392
+ * `spaceId` its extension descriptor was registered under. `contract infer`
393
+ * needs both: the contract to know which elements the pack describes and to
394
+ * resolve the domain model a cross-space foreign key targets, the `spaceId`
395
+ * to qualify the emitted relation type (`<spaceId>:<namespace>.<Model>`).
396
+ * Neither the contract JSON nor the framework's `ContractSpace` wrapper
397
+ * self-declares its owning space id — it is only known from the extension
398
+ * descriptor that carries the `ContractSpace`.
399
+ */
400
+ interface SqlDescribedContractSpace {
401
+ readonly spaceId: string;
402
+ readonly contract: Contract<SqlStorage>;
403
+ }
404
+ interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails, TContract extends Contract<SqlStorage> = Contract<SqlStorage>> extends MigratableTargetDescriptor<'sql', TTargetId, SqlControlFamilyInstance> {
405
+ readonly queryOperations?: () => SqlOperationDescriptors;
406
+ /**
407
+ * JSON ⇄ class boundary for the SQL target's contract. The descriptor
408
+ * composes a concrete `SqlContractSerializerBase` subclass; the rest
409
+ * of the control stack reaches `descriptor.contractSerializer` rather
410
+ * than importing a per-target deserialization function.
411
+ */
412
+ readonly contractSerializer: ContractSerializer<TContract>;
413
+ /**
414
+ * Per-target schema verifier walking the contract against
415
+ * `SqlSchemaIR`. The descriptor composes a concrete
416
+ * `SqlSchemaVerifierBase` subclass; the family-shared walk lives on
417
+ * the base, the target-specific dispatch on the subclass.
418
+ */
419
+ readonly schemaVerifier: SchemaVerifier<TContract, SqlSchemaIR>;
420
+ /**
421
+ * Database→PSL inference for `contract infer`. Target logic (owns the dialect
422
+ * maps), so it lives on the descriptor. Optional: targets without `contract
423
+ * infer` (Mongo) omit it, and the family instance throws when it is absent.
424
+ * `describedContracts` carries the stack's extension packs' already-assembled
425
+ * contracts (each paired with its `spaceId`) so the inferrer can omit elements
426
+ * they already describe, and can qualify a cross-space relation with the
427
+ * owning pack's space id.
428
+ */
429
+ readonly inferPslContract?: (schema: SqlSchemaIRNode, describedContracts?: readonly SqlDescribedContractSpace[]) => PslDocumentAst;
430
+ /**
431
+ * The full-tree node diff the family verify verdict derives from —
432
+ * expected-tree derivation, pre-diff normalization, the generic differ,
433
+ * and ownership scoping, all target-side. The family applies strict
434
+ * gating + control-policy disposition over the returned issues; verify
435
+ * rejects when a surviving issue is a failure.
436
+ */
437
+ readonly diffSchema: SqlSchemaDiffFn;
438
+ /**
439
+ * Classifies a diff-tree node's `nodeKind` into its framework-neutral
440
+ * {@link DiffSubjectGranularity} — the target owns the full node vocabulary
441
+ * that appears in its diff tree (its own kinds plus the relational kinds it
442
+ * delegates to), so it is the one place that can resolve this. The family
443
+ * verdict calls it inline per issue (never stamping the result); the
444
+ * framework aggregate's unclaimed-elements sweep reaches the same
445
+ * classifier via the family instance's `classifySubjectGranularity`
446
+ * capability.
447
+ */
448
+ readonly classifySubjectGranularity: (nodeKind: string) => DiffSubjectGranularity;
449
+ /**
450
+ * Classifies a diff-tree node's `nodeKind` into its storage `entityKind` —
451
+ * the same vocabulary the contract storage's `entries` dictionary keys use
452
+ * (e.g. `'table'`). Sibling of `classifySubjectGranularity`, resolved the
453
+ * same way: the target owns the full node vocabulary, so it is the one
454
+ * place that can resolve this. `undefined` for a node kind with no
455
+ * storage entity of its own (a column, an index, …). The framework
456
+ * aggregate's unclaimed-elements sweep reaches this via the family
457
+ * instance's `classifyEntityKind` capability, so it never hardcodes a
458
+ * family entity kind.
459
+ */
460
+ readonly classifyEntityKind: (nodeKind: string) => string | undefined;
461
+ createPlanner(adapter: SqlControlAdapter<TTargetId>): SqlMigrationPlanner<TTargetDetails>;
462
+ createRunner(family: SqlControlFamilyInstance): SqlMigrationRunner<TTargetDetails>;
463
+ }
464
+ //#endregion
261
465
  //#region src/core/migrations/contract-to-schema-ir.d.ts
262
466
  /**
263
467
  * Target-specific callback that expands a column's base `nativeType` and optional
@@ -339,6 +543,21 @@ interface ContractToSchemaIROptions {
339
543
  *
340
544
  * Returns an empty schema IR when `contract` is `null` (new project).
341
545
  */
546
+ /**
547
+ * Converts the tables of a single namespace into a `SqlSchemaIR`, keyed by
548
+ * table name within that namespace. Unlike {@link contractToSchemaIR}, which
549
+ * flattens every namespace's tables into one bare-keyed record (and throws on a
550
+ * cross-namespace name collision), this scopes the table iteration to one
551
+ * namespace so the same table name can exist in two schemas.
552
+ *
553
+ * The full `storage` is still passed to `convertTable`, so value-set / enum /
554
+ * type resolution that legitimately spans namespaces is unaffected. Foreign
555
+ * keys are built purely from the FK descriptor (`fk.target`), so cross-namespace
556
+ * FKs survive per-namespace conversion. The `annotations` block (storage-type
557
+ * derived) is omitted here — the per-namespace tree consumer reads only the
558
+ * per-table fields.
559
+ */
560
+ declare function contractNamespaceToSchemaIR(storage: SqlStorage, namespaceId: string, options: ContractToSchemaIROptions): SqlSchemaIR;
342
561
  declare function contractToSchemaIR(contract: Contract<SqlStorage> | null, options: ContractToSchemaIROptions): SqlSchemaIR;
343
562
  //#endregion
344
563
  //#region src/core/migrations/control-policy.d.ts
@@ -479,6 +698,19 @@ interface PlanFieldEventOperationsOptions {
479
698
  }
480
699
  declare function planFieldEventOperations(options: PlanFieldEventOperationsOptions): readonly OpFactoryCall[];
481
700
  //#endregion
701
+ //#region src/core/migrations/native-type-expander.d.ts
702
+ /**
703
+ * Builds the codec-hook-composed `expandNativeType` callback the contract→IR
704
+ * derivation uses to expand parameterized native types (e.g. `character` +
705
+ * `{ length: 36 }` → `character(36)`). Returns `undefined` when no framework
706
+ * components are supplied, so callers can omit the option entirely.
707
+ */
708
+ declare function buildNativeTypeExpander(frameworkComponents?: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): ((input: {
709
+ readonly nativeType: string;
710
+ readonly codecId?: string;
711
+ readonly typeParams?: Record<string, unknown>;
712
+ }) => string) | undefined;
713
+ //#endregion
482
714
  //#region src/core/migrations/plan-helpers.d.ts
483
715
  declare function createMigrationPlan<TTargetDetails>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
484
716
  declare function plannerSuccess<TTargetDetails>(plan: SqlMigrationPlan<TTargetDetails>, warnings?: readonly SqlPlannerConflict[]): SqlPlannerSuccessResult<TTargetDetails>;
@@ -564,5 +796,5 @@ declare function temporalAuthoringPresets<const CodecId extends string, const Na
564
796
  //#region src/exports/control.d.ts
565
797
  declare const _default: SqlFamilyDescriptor;
566
798
  //#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 };
799
+ 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 TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
568
800
  //# 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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A;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,OAAA;IAAA,SACI,M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