@prisma/orm-family-sql 8.0.0-rc.21-dev.6 → 8.0.0-rc.21-dev.7

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 (102) hide show
  1. package/dist/{attribute-specs-CM_fC-TC.d.mts → attribute-specs-DDpSUaG9.d.mts} +3 -3
  2. package/dist/{attribute-specs-CM_fC-TC.d.mts.map → attribute-specs-DDpSUaG9.d.mts.map} +1 -1
  3. package/dist/{authoring-entity-types-CgKIgWq5--Hjkn72Y.d.mts → authoring-entity-types-CgKIgWq5-BqRjoPFF.d.mts} +2 -2
  4. package/dist/{authoring-entity-types-CgKIgWq5--Hjkn72Y.d.mts.map → authoring-entity-types-CgKIgWq5-BqRjoPFF.d.mts.map} +1 -1
  5. package/dist/{config-types-BvmmK8D-.mjs → config-types-BCXwEBZH.mjs} +2 -2
  6. package/dist/{config-types-BvmmK8D-.mjs.map → config-types-BCXwEBZH.mjs.map} +1 -1
  7. package/dist/{contract-builder-Bk-Co792.mjs → contract-builder-D50r41BU.mjs} +112 -47
  8. package/dist/contract-builder-D50r41BU.mjs.map +1 -0
  9. package/dist/{contract-builder-B8oDZ4aU.d.mts → contract-builder-D6JuOGA6.d.mts} +43 -4
  10. package/dist/{contract-builder-B8oDZ4aU.d.mts.map → contract-builder-D6JuOGA6.d.mts.map} +1 -1
  11. package/dist/contract-prisma7__provider.d.mts +3 -1
  12. package/dist/contract-prisma7__provider.d.mts.map +1 -1
  13. package/dist/contract-prisma7__provider.mjs +60 -24
  14. package/dist/contract-prisma7__provider.mjs.map +1 -1
  15. package/dist/contract-psl.d.mts +1 -1
  16. package/dist/contract-psl.mjs +1 -1
  17. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  18. package/dist/contract-psl__attribute-specs.mjs +1 -1
  19. package/dist/contract-psl__diagnostics.mjs +1 -1
  20. package/dist/contract-psl__provider.mjs +2 -2
  21. package/dist/contract-psl__provider.mjs.map +1 -1
  22. package/dist/contract-ts.d.mts +1 -1
  23. package/dist/contract-ts.mjs +3 -3
  24. package/dist/contract-ts__config-types.mjs +1 -1
  25. package/dist/contract-ts__contract-builder.d.mts +1 -1
  26. package/dist/contract-ts__contract-builder.mjs +2 -2
  27. package/dist/contract.d.mts +2 -2
  28. package/dist/contract.mjs +3 -3
  29. package/dist/contract__data-type.d.mts +2 -2
  30. package/dist/contract__data-type.mjs +2 -2
  31. package/dist/contract__validators.mjs +1 -1
  32. package/dist/{control-B2CeDfVO.d.mts → control-BE7gXqZF.d.mts} +3 -3
  33. package/dist/{control-B2CeDfVO.d.mts.map → control-BE7gXqZF.d.mts.map} +1 -1
  34. package/dist/{control-C1EjGUVq.mjs → control-DPCrkpMS.mjs} +10 -11
  35. package/dist/control-DPCrkpMS.mjs.map +1 -0
  36. package/dist/{control-adapter-SlQkTEwT.mjs → control-adapter-BetaUm2y.mjs} +2 -2
  37. package/dist/{control-adapter-SlQkTEwT.mjs.map → control-adapter-BetaUm2y.mjs.map} +1 -1
  38. package/dist/{data-type-CR0gi2GQ.d.mts → data-type-B-Do6RMA.d.mts} +13 -5
  39. package/dist/data-type-B-Do6RMA.d.mts.map +1 -0
  40. package/dist/{data-type-BFSpaotu.mjs → data-type-BfA5F0Qf.mjs} +2 -2
  41. package/dist/{data-type-BFSpaotu.mjs.map → data-type-BfA5F0Qf.mjs.map} +1 -1
  42. package/dist/{default-mapping-CAOONlKQ-CIg7JCfF.d.mts → default-mapping-CEISdj2g-B50Ag_F_.d.mts} +5 -11
  43. package/dist/default-mapping-CEISdj2g-B50Ag_F_.d.mts.map +1 -0
  44. package/dist/{derived-checks-BuTkSE9l-gyx0d0dX.mjs → derived-checks-D__agoFB-Boa1MHcA.mjs} +4 -4
  45. package/dist/{derived-checks-BuTkSE9l-gyx0d0dX.mjs.map → derived-checks-D__agoFB-Boa1MHcA.mjs.map} +1 -1
  46. package/dist/{diagnostics-C7jR1Jyf.mjs → diagnostics-CoM0OFuR.mjs} +40 -30
  47. package/dist/diagnostics-CoM0OFuR.mjs.map +1 -0
  48. package/dist/family.d.mts +7 -7
  49. package/dist/family.mjs +9 -9
  50. package/dist/family__control-adapter.mjs +1 -1
  51. package/dist/family__control.d.mts +1 -1
  52. package/dist/family__control.mjs +3 -3
  53. package/dist/family__diff.mjs +1 -1
  54. package/dist/family__ir.mjs +1 -1
  55. package/dist/family__pack.d.mts +1 -1
  56. package/dist/family__pack.mjs +2 -2
  57. package/dist/family__psl-build.d.mts +3 -3
  58. package/dist/family__psl-build.mjs +2 -2
  59. package/dist/family__psl-infer.d.mts +1 -1
  60. package/dist/family__runtime.d.mts +1 -1
  61. package/dist/family__runtime.mjs +1 -1
  62. package/dist/{generator-functions-Hy4pDDr9-BUHOsofo.mjs → generator-functions-Hy4pDDr9-CMfJOBtv.mjs} +2 -2
  63. package/dist/{generator-functions-Hy4pDDr9-BUHOsofo.mjs.map → generator-functions-Hy4pDDr9-CMfJOBtv.mjs.map} +1 -1
  64. package/dist/{interpreter-CrQFtK4p-CM5k_t4g.mjs → interpreter-ChvVEijY-FeJngsog.mjs} +16 -6
  65. package/dist/interpreter-ChvVEijY-FeJngsog.mjs.map +1 -0
  66. package/dist/{pack-BPbz6RVm.d.mts → pack-DKM1hv1E.d.mts} +3 -3
  67. package/dist/{pack-BPbz6RVm.d.mts.map → pack-DKM1hv1E.d.mts.map} +1 -1
  68. package/dist/psl-build-BA0Ndi1v.mjs +268 -0
  69. package/dist/psl-build-BA0Ndi1v.mjs.map +1 -0
  70. package/dist/{psl-build-CNncjpsa.d.mts → psl-build-DCZaF5g4.d.mts} +44 -15
  71. package/dist/psl-build-DCZaF5g4.d.mts.map +1 -0
  72. package/dist/{psl-column-resolution-djGEITmJ-DfEOkjPf.d.mts → psl-column-resolution-djGEITmJ-C0LSpwl4.d.mts} +2 -2
  73. package/dist/{psl-column-resolution-djGEITmJ-DfEOkjPf.d.mts.map → psl-column-resolution-djGEITmJ-C0LSpwl4.d.mts.map} +1 -1
  74. package/dist/{psl-field-resolution-Bvhx79fP-CuyYFk8z.mjs → psl-field-resolution-BW2_FOb9-DxqR43fo.mjs} +67 -37
  75. package/dist/psl-field-resolution-BW2_FOb9-DxqR43fo.mjs.map +1 -0
  76. package/dist/{psl-infer-BkkoyXmM.d.mts → psl-infer-Cr9AeccU.d.mts} +2 -2
  77. package/dist/{psl-infer-BkkoyXmM.d.mts.map → psl-infer-Cr9AeccU.d.mts.map} +1 -1
  78. package/dist/{runtime-BrBva2ta.d.mts → runtime-CSDcwOEG.d.mts} +4 -3
  79. package/dist/{runtime-BrBva2ta.d.mts.map → runtime-CSDcwOEG.d.mts.map} +1 -1
  80. package/dist/{runtime-CCzfa1mY.mjs → runtime-DkUiQi00.mjs} +12 -4
  81. package/dist/runtime-DkUiQi00.mjs.map +1 -0
  82. package/dist/{schema-verify-C3wbdviw-mlPO4NkT.mjs → schema-verify-C3wbdviw-nQ4tG9N7.mjs} +2 -2
  83. package/dist/{schema-verify-C3wbdviw-mlPO4NkT.mjs.map → schema-verify-C3wbdviw-nQ4tG9N7.mjs.map} +1 -1
  84. package/dist/{sql-contract-serializer-sMY3prTx-aQd4v3fE.mjs → sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs} +2 -2
  85. package/dist/{sql-contract-serializer-sMY3prTx-aQd4v3fE.mjs.map → sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs.map} +1 -1
  86. package/dist/{sql-data-type-D7M-YTTY-D2vRqDxn.mjs → sql-data-type-LVBldu1a-Bq203xWX.mjs} +13 -7
  87. package/dist/sql-data-type-LVBldu1a-Bq203xWX.mjs.map +1 -0
  88. package/dist/{validators-CnQqLEIi.mjs → validators-qcQteqs2.mjs} +2 -2
  89. package/dist/{validators-CnQqLEIi.mjs.map → validators-qcQteqs2.mjs.map} +1 -1
  90. package/package.json +18 -18
  91. package/dist/contract-builder-Bk-Co792.mjs.map +0 -1
  92. package/dist/control-C1EjGUVq.mjs.map +0 -1
  93. package/dist/data-type-CR0gi2GQ.d.mts.map +0 -1
  94. package/dist/default-mapping-CAOONlKQ-CIg7JCfF.d.mts.map +0 -1
  95. package/dist/diagnostics-C7jR1Jyf.mjs.map +0 -1
  96. package/dist/interpreter-CrQFtK4p-CM5k_t4g.mjs.map +0 -1
  97. package/dist/psl-build-CNncjpsa.d.mts.map +0 -1
  98. package/dist/psl-build-DqqYhOsa.mjs +0 -426
  99. package/dist/psl-build-DqqYhOsa.mjs.map +0 -1
  100. package/dist/psl-field-resolution-Bvhx79fP-CuyYFk8z.mjs.map +0 -1
  101. package/dist/runtime-CCzfa1mY.mjs.map +0 -1
  102. package/dist/sql-data-type-D7M-YTTY-D2vRqDxn.mjs.map +0 -1
@@ -3,7 +3,7 @@ import "./sql-expression-CKgKznXS.mjs";
3
3
  import { a as parseQuotedStringLiteral } from "./psl-attribute-parsing-BCsFWsSp-BJ-wGlY6.mjs";
4
4
  import { t as compareStrings } from "./compare-strings-BVf3BgCV-CefXnrMB.mjs";
5
5
  import { isAuthoringTypeDescriptor, printTaggedLiteral } from "@prisma/orm-framework/components/authoring";
6
- import { describeRemovedFieldPreset, removedPresetWithPhases, removedPresetWrittenAs } from "@prisma/orm-framework/psl-parser/interpret";
6
+ import { describeRemovedFieldPreset, presetType, removedPresetWithPhases, removedPresetWrittenAs } from "@prisma/orm-framework/psl-parser/interpret";
7
7
  //#region ../../../2-sql-family/2-authoring/contract-psl/dist/diagnostics.mjs
8
8
  const NANOID_OPTIONS = /^\{\s*(?:size\s*:\s*(\d+)\s*,?\s*)?\}$/;
9
9
  function nanoidSize(call) {
@@ -19,25 +19,29 @@ function qualified(namespace, name) {
19
19
  }
20
20
  /** The rows of a preset whose rewrite writes the generated id column alias `alias`, then `attributes` when given, in each namespace that may name it. */
21
21
  function idAlias(alias, attributes) {
22
- return GENERATED_ID_COLUMN_ALIAS_NAMESPACES.flatMap((namespace) => removedPresetWrittenAs(`${qualified(namespace, alias)}${attributes === void 0 ? "" : ` ${attributes}`}`, generatedIdColumnAliases[alias].output.type.codecId));
22
+ return GENERATED_ID_COLUMN_ALIAS_NAMESPACES.flatMap((namespace) => removedPresetWrittenAs(qualified(namespace, alias), generatedIdColumnAliases[alias].output.type.codecId, attributes));
23
23
  }
24
24
  function nanoid(id) {
25
25
  return GENERATED_ID_COLUMN_ALIAS_NAMESPACES.map((namespace) => {
26
- const write = (size) => {
27
- const column = size === void 0 ? qualified(namespace, "Nanoid") : qualified(namespace, `Char(${size})`);
28
- return id ? `${column} @id @onCreate(nanoid(${size ?? ""}))` : column;
26
+ const write = (size, modifier) => {
27
+ return `${size === void 0 ? qualified(namespace, "Nanoid") : qualified(namespace, `Char(${size})`)}${modifier}${id ? ` @id @onCreate(nanoid(${size ?? ""}))` : ""}`;
29
28
  };
30
29
  return {
31
- type: [...namespace, "Nanoid"],
30
+ type: presetType(qualified(namespace, "Nanoid")),
32
31
  codecId: generatedIdColumnAliases.Nanoid.output.type.codecId,
33
- rewrite: (call) => {
32
+ rewrite: (call, modifier) => {
34
33
  const options = nanoidSize(call);
35
- return options === void 0 ? `Write ${write(void 0)}, or ${write("n")} for a size of n.` : `Write ${write(options.size)}.`;
34
+ return options === void 0 ? `Write ${write(void 0, modifier)}, or ${write("n", modifier)} for a size of n.` : `Write ${write(options.size, modifier)}.`;
36
35
  }
37
36
  };
38
37
  });
39
38
  }
40
- /** The SQL family's removed field presets: each row applies only where its rewrite's type stores the preset's codec, and a row with no codec id writes a type alias only the targets with the preset contribute. A generated id preset is written with the target's top-level alias where it has one, and with the `sql.` alias elsewhere. */
39
+ const TEMPORAL_DATE_TIME = presetType("DateTime", { as: "temporal" });
40
+ const STRING_DATE_TIME = presetType("DateTime", { as: "string" });
41
+ const SQLITE_DATETIME = "sqlite/datetime@1";
42
+ const CREATED = "@onCreate(now())";
43
+ const UPDATED = "@onCreate(now()) @onUpdate(now())";
44
+ /** The SQL family's removed field presets: each row applies only where its rewrite's type stores the preset's codec. A generated id preset is written with the target's top-level alias where it has one, and with the `sql.` alias elsewhere. A date and time preset is written with the convenience call that gives the explicit type it stored, where one does (ADR 279). */
41
45
  const removedSqlFieldPresets = {
42
46
  uuidString: idAlias("UuidString"),
43
47
  ulid: idAlias("Ulid"),
@@ -58,27 +62,33 @@ const removedSqlFieldPresets = {
58
62
  boolean: removedPresetWrittenAs("Boolean", "pg/bool@1"),
59
63
  json: removedPresetWrittenAs("Jsonb", "pg/jsonb@1"),
60
64
  bytes: removedPresetWrittenAs("Bytes", "pg/bytea@1"),
61
- dateTime: removedPresetWrittenAs("DateTime", "pg/timestamptz-temporal@1"),
65
+ dateTime: removedPresetWrittenAs(TEMPORAL_DATE_TIME, "pg/timestamptz-temporal@1"),
62
66
  uuidNative: removedPresetWrittenAs("Uuid", "pg/uuid@1"),
63
- "id.uuidv4Native": removedPresetWrittenAs("Uuid @id @onCreate(uuid())", "pg/uuid@1"),
64
- "id.uuidv7Native": removedPresetWrittenAs("Uuid @id @onCreate(uuid(7))", "pg/uuid@1"),
65
- "temporal.createdAt": removedPresetWrittenAs("temporal.CreatedAt"),
66
- "temporal.updatedAt": removedPresetWrittenAs("temporal.UpdatedAt"),
67
- "temporal.createdAtString": removedPresetWrittenAs("temporal.CreatedAtString"),
68
- "temporal.updatedAtString": removedPresetWrittenAs("temporal.UpdatedAtString"),
69
- "temporal.createdAtJsDate": removedPresetWrittenAs("temporal.CreatedAtJsDate"),
70
- "temporal.updatedAtJsDate": removedPresetWrittenAs("temporal.UpdatedAtJsDate"),
67
+ "id.uuidv4Native": removedPresetWrittenAs("Uuid", "pg/uuid@1", "@id @onCreate(uuid())"),
68
+ "id.uuidv7Native": removedPresetWrittenAs("Uuid", "pg/uuid@1", "@id @onCreate(uuid(7))"),
69
+ "temporal.createdAt": [...removedPresetWrittenAs(TEMPORAL_DATE_TIME, "pg/timestamptz-temporal@1", CREATED), ...removedPresetWrittenAs("temporal.CreatedAt", SQLITE_DATETIME)],
70
+ "temporal.updatedAt": [...removedPresetWrittenAs(TEMPORAL_DATE_TIME, "pg/timestamptz-temporal@1", UPDATED), ...removedPresetWrittenAs("temporal.UpdatedAt", SQLITE_DATETIME)],
71
+ "temporal.createdAtString": removedPresetWrittenAs(STRING_DATE_TIME, "pg/timestamptz-string@1", CREATED),
72
+ "temporal.updatedAtString": removedPresetWrittenAs(STRING_DATE_TIME, "pg/timestamptz-string@1", UPDATED),
73
+ "temporal.createdAtJsDate": removedPresetWrittenAs("TimestamptzJsDate", "pg/timestamptz-date@1", CREATED),
74
+ "temporal.updatedAtJsDate": removedPresetWrittenAs("TimestamptzJsDate", "pg/timestamptz-date@1", UPDATED),
71
75
  "temporal.timestamp": removedPresetWithPhases("TimestampTemporal", "pg/timestamp-temporal@1", true),
72
- "temporal.timestamptz": removedPresetWithPhases("TimestamptzTemporal", "pg/timestamptz-temporal@1", true),
73
- "temporal.timestampString": removedPresetWithPhases("TimestampString", "pg/timestamp-string@1", true),
74
- "temporal.timestamptzString": removedPresetWithPhases("TimestamptzString", "pg/timestamptz-string@1", true),
75
- "temporal.timestamptzJsDate": removedPresetWithPhases("TimestamptzJsDate", "pg/timestamptz-date@1", true),
76
- "temporal.date": removedPresetWithPhases("Date", "pg/date-temporal@1", false),
77
- "temporal.dateString": removedPresetWithPhases("DateString", "pg/date-string@1", false),
78
- "temporal.time": removedPresetWithPhases("Time", "pg/time-temporal@1", true),
79
- "temporal.timeString": removedPresetWithPhases("TimeString", "pg/time-string@1", true),
80
- "temporal.timetz": removedPresetWithPhases("Timetz", "pg/timetz@1", true),
81
- "temporal.datetime": removedPresetWithPhases("DateTime", "sqlite/datetime@1", false)
76
+ "temporal.timestamptz": removedPresetWithPhases(TEMPORAL_DATE_TIME, "pg/timestamptz-temporal@1", true),
77
+ "temporal.timestampString": removedPresetWithPhases(presetType("DateTime", {
78
+ as: "string",
79
+ storage: "timestamp"
80
+ }), "pg/timestamp-string@1", true),
81
+ "temporal.timestamptzString": removedPresetWithPhases(STRING_DATE_TIME, "pg/timestamptz-string@1", true),
82
+ "temporal.timestamptzJsDate": removedPresetWithPhases("TimestamptzJsDate", "pg/timestamptz-date@1", true, {
83
+ type: presetType("DateTime"),
84
+ defaultPrecision: "3"
85
+ }),
86
+ "temporal.date": removedPresetWithPhases(presetType("Date", { as: "temporal" }), "pg/date-temporal@1", false),
87
+ "temporal.dateString": removedPresetWithPhases("Date", "pg/date-string@1", false),
88
+ "temporal.time": removedPresetWithPhases(presetType("Time", { as: "temporal" }), "pg/time-temporal@1", true),
89
+ "temporal.timeString": removedPresetWithPhases("Time", "pg/time-string@1", true),
90
+ "temporal.timetz": removedPresetWithPhases(presetType("Time", { storage: "timetz" }), "pg/timetz@1", true),
91
+ "temporal.datetime": removedPresetWithPhases("DateTime", SQLITE_DATETIME, false)
82
92
  };
83
93
  /** The default message for a bare type name, followed by the types of that name in a contributed namespace in sorted order, such as `sql.Ulid` for `Ulid`, or `undefined` when no namespace has one. */
84
94
  function suggestNamespacedTypes(written, types) {
@@ -96,7 +106,7 @@ function describeUnresolvedSqlType(contributions) {
96
106
  return ({ field, written, isDeclared }) => {
97
107
  const call = field.typeConstructor;
98
108
  if (call === void 0) return field.typeNamespaceId === void 0 ? suggestNamespacedTypes(written, contributions.type) : void 0;
99
- if (written !== "Unsupported") return describeRemovedFieldPreset(removedSqlFieldPresets, call, contributions.type, isDeclared);
109
+ if (written !== "Unsupported") return describeRemovedFieldPreset(removedSqlFieldPresets, field, contributions.type, isDeclared);
100
110
  const [argument, ...rest] = call.args;
101
111
  const typeName = argument?.kind === "positional" && rest.length === 0 ? parseQuotedStringLiteral(argument.value) : void 0;
102
112
  if (typeName === void 0) return void 0;
@@ -106,4 +116,4 @@ function describeUnresolvedSqlType(contributions) {
106
116
  //#endregion
107
117
  export { describeUnresolvedSqlType as t };
108
118
 
109
- //# sourceMappingURL=diagnostics-C7jR1Jyf.mjs.map
119
+ //# sourceMappingURL=diagnostics-CoM0OFuR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics-CoM0OFuR.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/diagnostics.mjs"],"sourcesContent":["import { a as parseQuotedStringLiteral } from \"./psl-attribute-parsing-BCsFWsSp.mjs\";\nimport { t as compareStrings } from \"./compare-strings-BVf3BgCV.mjs\";\nimport { isAuthoringTypeDescriptor, printTaggedLiteral } from \"@internal/framework-components/authoring\";\nimport { describeRemovedFieldPreset, presetType, removedPresetWithPhases, removedPresetWrittenAs } from \"@internal/psl-parser/interpret\";\nimport { SQL_EXPRESSION_TAG } from \"@internal/sql-contract/sql-expression\";\nimport { GENERATED_ID_COLUMN_ALIAS_NAMESPACES, generatedIdColumnAliases } from \"@internal/sql-contract/generated-id-column-aliases\";\n//#region src/removed-field-presets.ts\nconst NANOID_OPTIONS = /^\\{\\s*(?:size\\s*:\\s*(\\d+)\\s*,?\\s*)?\\}$/;\nfunction nanoidSize(call) {\n\tconst [options, ...rest] = call.args;\n\tif (options === void 0) return {};\n\tif (rest.length > 0 || options.kind !== \"positional\") return void 0;\n\tconst match = NANOID_OPTIONS.exec(options.value);\n\tif (match === null) return void 0;\n\treturn match[1] === void 0 ? {} : { size: match[1] };\n}\nfunction qualified(namespace, name) {\n\treturn [...namespace, name].join(\".\");\n}\n/** The rows of a preset whose rewrite writes the generated id column alias `alias`, then `attributes` when given, in each namespace that may name it. */\nfunction idAlias(alias, attributes) {\n\treturn GENERATED_ID_COLUMN_ALIAS_NAMESPACES.flatMap((namespace) => removedPresetWrittenAs(qualified(namespace, alias), generatedIdColumnAliases[alias].output.type.codecId, attributes));\n}\nfunction nanoid(id) {\n\treturn GENERATED_ID_COLUMN_ALIAS_NAMESPACES.map((namespace) => {\n\t\tconst write = (size, modifier) => {\n\t\t\treturn `${size === void 0 ? qualified(namespace, \"Nanoid\") : qualified(namespace, `Char(${size})`)}${modifier}${id ? ` @id @onCreate(nanoid(${size ?? \"\"}))` : \"\"}`;\n\t\t};\n\t\treturn {\n\t\t\ttype: presetType(qualified(namespace, \"Nanoid\")),\n\t\t\tcodecId: generatedIdColumnAliases.Nanoid.output.type.codecId,\n\t\t\trewrite: (call, modifier) => {\n\t\t\t\tconst options = nanoidSize(call);\n\t\t\t\treturn options === void 0 ? `Write ${write(void 0, modifier)}, or ${write(\"n\", modifier)} for a size of n.` : `Write ${write(options.size, modifier)}.`;\n\t\t\t}\n\t\t};\n\t});\n}\nconst TEMPORAL_DATE_TIME = presetType(\"DateTime\", { as: \"temporal\" });\nconst STRING_DATE_TIME = presetType(\"DateTime\", { as: \"string\" });\nconst SQLITE_DATETIME = \"sqlite/datetime@1\";\nconst CREATED = \"@onCreate(now())\";\nconst UPDATED = \"@onCreate(now()) @onUpdate(now())\";\n/** The SQL family's removed field presets: each row applies only where its rewrite's type stores the preset's codec. A generated id preset is written with the target's top-level alias where it has one, and with the `sql.` alias elsewhere. A date and time preset is written with the convenience call that gives the explicit type it stored, where one does (ADR 279). */\nconst removedSqlFieldPresets = {\n\tuuidString: idAlias(\"UuidString\"),\n\tulid: idAlias(\"Ulid\"),\n\tnanoid: nanoid(false),\n\tcuid2: idAlias(\"Cuid2\"),\n\tksuid: idAlias(\"Ksuid\"),\n\t\"id.uuidv4String\": idAlias(\"UuidString\", \"@id @onCreate(uuid())\"),\n\t\"id.uuidv7String\": idAlias(\"UuidString\", \"@id @onCreate(uuid(7))\"),\n\t\"id.ulid\": idAlias(\"Ulid\", \"@id @onCreate(ulid())\"),\n\t\"id.nanoid\": nanoid(true),\n\t\"id.cuid2\": idAlias(\"Cuid2\", \"@id @onCreate(cuid(2))\"),\n\t\"id.ksuid\": idAlias(\"Ksuid\", \"@id @onCreate(ksuid())\"),\n\ttext: removedPresetWrittenAs(\"String\", \"pg/text@1\"),\n\tint: removedPresetWrittenAs(\"Int\", \"pg/int4@1\"),\n\tbigint: removedPresetWrittenAs(\"BigInt\", \"pg/int8@1\"),\n\tfloat: removedPresetWrittenAs(\"Float\", \"pg/float8@1\"),\n\tdecimal: removedPresetWrittenAs(\"Decimal\", \"pg/numeric@1\"),\n\tboolean: removedPresetWrittenAs(\"Boolean\", \"pg/bool@1\"),\n\tjson: removedPresetWrittenAs(\"Jsonb\", \"pg/jsonb@1\"),\n\tbytes: removedPresetWrittenAs(\"Bytes\", \"pg/bytea@1\"),\n\tdateTime: removedPresetWrittenAs(TEMPORAL_DATE_TIME, \"pg/timestamptz-temporal@1\"),\n\tuuidNative: removedPresetWrittenAs(\"Uuid\", \"pg/uuid@1\"),\n\t\"id.uuidv4Native\": removedPresetWrittenAs(\"Uuid\", \"pg/uuid@1\", \"@id @onCreate(uuid())\"),\n\t\"id.uuidv7Native\": removedPresetWrittenAs(\"Uuid\", \"pg/uuid@1\", \"@id @onCreate(uuid(7))\"),\n\t\"temporal.createdAt\": [...removedPresetWrittenAs(TEMPORAL_DATE_TIME, \"pg/timestamptz-temporal@1\", CREATED), ...removedPresetWrittenAs(\"temporal.CreatedAt\", SQLITE_DATETIME)],\n\t\"temporal.updatedAt\": [...removedPresetWrittenAs(TEMPORAL_DATE_TIME, \"pg/timestamptz-temporal@1\", UPDATED), ...removedPresetWrittenAs(\"temporal.UpdatedAt\", SQLITE_DATETIME)],\n\t\"temporal.createdAtString\": removedPresetWrittenAs(STRING_DATE_TIME, \"pg/timestamptz-string@1\", CREATED),\n\t\"temporal.updatedAtString\": removedPresetWrittenAs(STRING_DATE_TIME, \"pg/timestamptz-string@1\", UPDATED),\n\t\"temporal.createdAtJsDate\": removedPresetWrittenAs(\"TimestamptzJsDate\", \"pg/timestamptz-date@1\", CREATED),\n\t\"temporal.updatedAtJsDate\": removedPresetWrittenAs(\"TimestamptzJsDate\", \"pg/timestamptz-date@1\", UPDATED),\n\t\"temporal.timestamp\": removedPresetWithPhases(\"TimestampTemporal\", \"pg/timestamp-temporal@1\", true),\n\t\"temporal.timestamptz\": removedPresetWithPhases(TEMPORAL_DATE_TIME, \"pg/timestamptz-temporal@1\", true),\n\t\"temporal.timestampString\": removedPresetWithPhases(presetType(\"DateTime\", {\n\t\tas: \"string\",\n\t\tstorage: \"timestamp\"\n\t}), \"pg/timestamp-string@1\", true),\n\t\"temporal.timestamptzString\": removedPresetWithPhases(STRING_DATE_TIME, \"pg/timestamptz-string@1\", true),\n\t\"temporal.timestamptzJsDate\": removedPresetWithPhases(\"TimestamptzJsDate\", \"pg/timestamptz-date@1\", true, {\n\t\ttype: presetType(\"DateTime\"),\n\t\tdefaultPrecision: \"3\"\n\t}),\n\t\"temporal.date\": removedPresetWithPhases(presetType(\"Date\", { as: \"temporal\" }), \"pg/date-temporal@1\", false),\n\t\"temporal.dateString\": removedPresetWithPhases(\"Date\", \"pg/date-string@1\", false),\n\t\"temporal.time\": removedPresetWithPhases(presetType(\"Time\", { as: \"temporal\" }), \"pg/time-temporal@1\", true),\n\t\"temporal.timeString\": removedPresetWithPhases(\"Time\", \"pg/time-string@1\", true),\n\t\"temporal.timetz\": removedPresetWithPhases(presetType(\"Time\", { storage: \"timetz\" }), \"pg/timetz@1\", true),\n\t\"temporal.datetime\": removedPresetWithPhases(\"DateTime\", SQLITE_DATETIME, false)\n};\n//#endregion\n//#region src/unresolved-type.ts\n/** The default message for a bare type name, followed by the types of that name in a contributed namespace in sorted order, such as `sql.Ulid` for `Ulid`, or `undefined` when no namespace has one. */\nfunction suggestNamespacedTypes(written, types) {\n\tconst candidates = Object.entries(types).flatMap(([namespace, member]) => {\n\t\tif (isAuthoringTypeDescriptor(member) || !Object.hasOwn(member, written)) return [];\n\t\tconst type = member[written];\n\t\treturn type !== void 0 && isAuthoringTypeDescriptor(type) ? [`${namespace}.${written}`] : [];\n\t}).sort(compareStrings);\n\treturn candidates.length === 0 ? void 0 : `Cannot find type \"${written}\". Did you mean ${candidates.join(\" or \")}?`;\n}\n/**\n* The message for a field type the binder cannot find. A call to a field preset Prisma 8 removed names what to write instead, and a bare name that a contributed namespace holds names that type. `Unsupported(\"x\")`, the Prisma 6 and Prisma 7 way to keep a column of a type those versions do not know, is named as no Prisma 8 type; any other name keeps the binder's message.\n*/\nfunction describeUnresolvedSqlType(contributions) {\n\treturn ({ field, written, isDeclared }) => {\n\t\tconst call = field.typeConstructor;\n\t\tif (call === void 0) return field.typeNamespaceId === void 0 ? suggestNamespacedTypes(written, contributions.type) : void 0;\n\t\tif (written !== \"Unsupported\") return describeRemovedFieldPreset(removedSqlFieldPresets, field, contributions.type, isDeclared);\n\t\tconst [argument, ...rest] = call.args;\n\t\tconst typeName = argument?.kind === \"positional\" && rest.length === 0 ? parseQuotedStringLiteral(argument.value) : void 0;\n\t\tif (typeName === void 0) return void 0;\n\t\treturn `Unsupported(${JSON.stringify(typeName)}) is not a Prisma 8 type. Write the column's type with a type constructor, or as Raw(${printTaggedLiteral(SQL_EXPRESSION_TAG, typeName)}) when no type constructor names it. If ${JSON.stringify(typeName)} comes from a database extension that has a Prisma 8 pack, add the pack to extensions in prisma.config.ts.`;\n\t};\n}\n//#endregion\nexport { describeUnresolvedSqlType };\n\n//# sourceMappingURL=diagnostics.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,iBAAiB;AACvB,SAAS,WAAW,MAAM;CACzB,MAAM,CAAC,SAAS,GAAG,QAAQ,KAAK;CAChC,IAAI,YAAY,KAAK,GAAG,OAAO,CAAC;CAChC,IAAI,KAAK,SAAS,KAAK,QAAQ,SAAS,cAAc,OAAO,KAAK;CAClE,MAAM,QAAQ,eAAe,KAAK,QAAQ,KAAK;CAC/C,IAAI,UAAU,MAAM,OAAO,KAAK;CAChC,OAAO,MAAM,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,MAAM,GAAG;AACpD;AACA,SAAS,UAAU,WAAW,MAAM;CACnC,OAAO,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC,KAAK,GAAG;AACrC;;AAEA,SAAS,QAAQ,OAAO,YAAY;CACnC,OAAO,qCAAqC,SAAS,cAAc,uBAAuB,UAAU,WAAW,KAAK,GAAG,yBAAyB,MAAM,CAAC,OAAO,KAAK,SAAS,UAAU,CAAC;AACxL;AACA,SAAS,OAAO,IAAI;CACnB,OAAO,qCAAqC,KAAK,cAAc;EAC9D,MAAM,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CACzG,qBAAqB,wBAAwB,YAAY,iBAAiB,KAAK;AAChF;;AAIA,SAAS,uBAAuB,SAAS,OAAO;CAC/C,MAAM,aAAa,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,CAAC,WAAW,YAAY;EACzE,IAAI,0BAA0B,MAAM,KAAK,CAAC,OAAO,OAAO,QAAQ,OAAO,GAAG,OAAO,CAAC;EAClF,MAAM,OAAO,OAAO;EACpB,OAAO,SAAS,KAAK,KAAK,0BAA0B,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,SAAS,IAAI,CAAC;CAC5F,CAAC,CAAC,CAAC,KAAK,cAAc;CACtB,OAAO,WAAW,WAAW,IAAI,KAAK,IAAI,qBAAqB,QAAQ,kBAAkB,WAAW,KAAK,MAAM,EAAE;AAClH;;;;AAIA,SAAS,0BAA0B,eAAe;CACjD,QAAQ,EAAE,OAAO,SAAS,iBAAiB;EAC1C,MAAM,OAAO,MAAM;EACnB,IAAI,SAAS,KAAK,GAAG,OAAO,MAAM,oBAAoB,KAAK,IAAI,uBAAuB,SAAS,cAAc,IAAI,IAAI,KAAK;EAC1H,IAAI,YAAY,eAAe,OAAO,2BAA2B,wBAAwB,OAAO,cAAc,MAAM,UAAU;EAC9H,MAAM,CAAC,UAAU,GAAG,QAAQ,KAAK;EACjC,MAAM,WAAW,UAAU,SAAS,gBAAgB,KAAK,WAAW,IAAI,yBAAyB,SAAS,KAAK,IAAI,KAAK;EACxH,IAAI,aAAa,KAAK,GAAG,OAAO,KAAK;EACrC,OAAO,eAAe,KAAK,UAAU,QAAQ,EAAE,uFAAuF,mBAAA,OAAuC,QAAQ,EAAE,0CAA0C,KAAK,UAAU,QAAQ,EAAE;CAC3P;AACD"}
package/dist/family.d.mts CHANGED
@@ -3,15 +3,15 @@ import { h as checkSqlDefaultText } from "./validators-Dt-19ywK.mjs";
3
3
  import { n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-BfyLe7rh-CiGzw3dq.mjs";
4
4
  import { C as SqlPlannerConflict, D as SqlPlannerResult, E as SqlPlannerFailureResult, O as SqlPlannerSuccessResult, S as SqlPlanTargetDetails, T as SqlPlannerConflictLocation, _ as SqlMigrationRunnerExecuteCallbacks, a as ResolveIdentityValueInput, b as SqlMigrationRunnerResult, c as SqlMigrationPlan, d as SqlMigrationPlanOperationStep, f as SqlMigrationPlanOperationTarget, g as SqlMigrationRunnerErrorCode, h as SqlMigrationRunner, i as FieldEventContext, k as StorageTypePlanResult, l as SqlMigrationPlanContractInfo, m as SqlMigrationPlannerPlanOptions, n as CreateSqlMigrationPlanOptions, o as SqlControlAdapterDescriptor, p as SqlMigrationPlanner, r as FieldEvent, s as SqlControlExtensionDescriptor, t as CodecControlHooks, u as SqlMigrationPlanOperation, v as SqlMigrationRunnerExecuteOptions, w as SqlPlannerConflictKind, x as SqlMigrationRunnerSuccessValue, y as SqlMigrationRunnerFailure } from "./types-COXfSNOP-D9vt9QDL.mjs";
5
5
  import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-BXkhxcPs.mjs";
6
- import { $ as StatementPlanningTarget, $t as resolveTableRenameAgainst, A as NoTable, At as encodeStoredValue, B as SchemaTables, Bt as partitionIssuesByControlPolicy, C as MigrationPlannerConflict, Ct as contractToSchemaIR, D as NO_RENAMED_ORIGINS, Dt as createSqlTextSources, E as ModelTable, Et as createMigrationPlan, F as ReportedBody, Ft as fieldStatementColumns, G as SqlDescribedContractSpace, Gt as plannerFailure, H as SqlControlFamilyInstance, Ht as planFieldEventCalls, I as ReportedLiteralDefault, It as isUnfilledSlot, J as SqlQuotingRules, Jt as readReportedDefault, K as SqlPslBuildContext, Kt as plannerSuccess, L as RequiredColumn, Lt as modelRenameStorageEffect, M as PlannedStatements, Mt as fieldEventStorage, N as ReadColumnDefault, Nt as fieldOfColumn, O as NamespaceRename, Ot as detectDestructiveChanges, P as ReadReportedDefault, Pt as fieldRenameStorageEffect, Q as StatementOwnership, Qt as resolveColumnRenameAgainst, R as RequiredColumnMark, Rt as otherSpaceDeclaring, S as MigrationPlanner, St as contractNamespaceToSchemaIR, T as ModelStorageEffect, Tt as convertedColumnOf, U as SqlControlTargetDescriptor, Ut as planFieldEventOperations, V as SingleOperationCall, Vt as planEnumValueRewrites, W as SqlDefaultFunctionName, Wt as planStatements, X as SqlTextSources, Xt as requiredColumnOf, Y as SqlSlot, Yt as requiredColumnMeta, Z as StatementColumn, Zt as requiredColumnsOfMigration, _ as INIT_ADDITIVE_POLICY, _n as withEnumValueOperations, _t as assembleAuthoringContributions, a as ColumnRename, an as runnerFailure, at as SuppressionRecord, b as MigrationPlan, bt as columnTakesTemporaryValue, c as ContractColumns, cn as sqlDefaultFunctions, ct as TableNameCaseGuardTable, d as ConvertedColumn, dn as storageNameOfOperation, dt as TableRenameRequest, en as rowsHoldingValueMeta, et as StoredEnumValue, f as DefaultResolver, fn as subjectsOfCalls, ft as TargetMigrationsCapability, g as FieldStorageEffect, gn as unmatchedTableRename, gt as appliedStatementsInOrder, h as FieldStatementColumns, hn as unmatchedColumnRename, i as ColumnOnOneSide, in as rowsWithoutValueSummary, it as SubjectStorage, j as PlanFieldEventOperationsOptions, jt as extractCodecControlHooks, k as NamespaceStatementTarget, kt as detectTableNameCaseChanges, l as ContractToSchemaIROptions, ln as sqlOfSlot, lt as TableRename, m as FieldEventCall, mn as unknownCallNames, mt as WorkingSchemaOrigins, n as CallSubjects, nn as rowsHoldingValueSummary, nt as StoredValueReplacement, o as ColumnRenameRequest, on as runnerSuccess, ot as TABLE_NAME_CASE_CHANGED_CODE, p as DefaultResolverColumn, pn as unconvertedFieldOf, pt as TargetRefusal, q as SqlQuote, qt as readColumnDefault, r as CallWithCompanions, rn as rowsWithoutValueFailure, rt as StoredValueRewrite, s as ContractColumn, sn as slotSource, st as TableMove, t as COLUMN_RENAME_UNMATCHED_CODE, tn as rowsHoldingValueOf, tt as StoredValueCodec, u as ControlPolicySubject, un as sqlTypeLookupsOf, ut as TableRenameByHand, v as MigrationOperationClass, vt as backfillOfDefaultedField, w as MigrationPlannerResult, wt as convertedColumnMeta, x as MigrationPlanOperation, xt as contractColumns, y as MigrationOperationPolicy, yt as checkSqlExpressionText, z as RowsHoldingValueMark, zt as partitionCallsByControlPolicy } from "./control-B2CeDfVO.mjs";
6
+ import { $ as StatementPlanningTarget, $t as resolveTableRenameAgainst, A as NoTable, At as encodeStoredValue, B as SchemaTables, Bt as partitionIssuesByControlPolicy, C as MigrationPlannerConflict, Ct as contractToSchemaIR, D as NO_RENAMED_ORIGINS, Dt as createSqlTextSources, E as ModelTable, Et as createMigrationPlan, F as ReportedBody, Ft as fieldStatementColumns, G as SqlDescribedContractSpace, Gt as plannerFailure, H as SqlControlFamilyInstance, Ht as planFieldEventCalls, I as ReportedLiteralDefault, It as isUnfilledSlot, J as SqlQuotingRules, Jt as readReportedDefault, K as SqlPslBuildContext, Kt as plannerSuccess, L as RequiredColumn, Lt as modelRenameStorageEffect, M as PlannedStatements, Mt as fieldEventStorage, N as ReadColumnDefault, Nt as fieldOfColumn, O as NamespaceRename, Ot as detectDestructiveChanges, P as ReadReportedDefault, Pt as fieldRenameStorageEffect, Q as StatementOwnership, Qt as resolveColumnRenameAgainst, R as RequiredColumnMark, Rt as otherSpaceDeclaring, S as MigrationPlanner, St as contractNamespaceToSchemaIR, T as ModelStorageEffect, Tt as convertedColumnOf, U as SqlControlTargetDescriptor, Ut as planFieldEventOperations, V as SingleOperationCall, Vt as planEnumValueRewrites, W as SqlDefaultFunctionName, Wt as planStatements, X as SqlTextSources, Xt as requiredColumnOf, Y as SqlSlot, Yt as requiredColumnMeta, Z as StatementColumn, Zt as requiredColumnsOfMigration, _ as INIT_ADDITIVE_POLICY, _n as withEnumValueOperations, _t as assembleAuthoringContributions, a as ColumnRename, an as runnerFailure, at as SuppressionRecord, b as MigrationPlan, bt as columnTakesTemporaryValue, c as ContractColumns, cn as sqlDefaultFunctions, ct as TableNameCaseGuardTable, d as ConvertedColumn, dn as storageNameOfOperation, dt as TableRenameRequest, en as rowsHoldingValueMeta, et as StoredEnumValue, f as DefaultResolver, fn as subjectsOfCalls, ft as TargetMigrationsCapability, g as FieldStorageEffect, gn as unmatchedTableRename, gt as appliedStatementsInOrder, h as FieldStatementColumns, hn as unmatchedColumnRename, i as ColumnOnOneSide, in as rowsWithoutValueSummary, it as SubjectStorage, j as PlanFieldEventOperationsOptions, jt as extractCodecControlHooks, k as NamespaceStatementTarget, kt as detectTableNameCaseChanges, l as ContractToSchemaIROptions, ln as sqlOfSlot, lt as TableRename, m as FieldEventCall, mn as unknownCallNames, mt as WorkingSchemaOrigins, n as CallSubjects, nn as rowsHoldingValueSummary, nt as StoredValueReplacement, o as ColumnRenameRequest, on as runnerSuccess, ot as TABLE_NAME_CASE_CHANGED_CODE, p as DefaultResolverColumn, pn as unconvertedFieldOf, pt as TargetRefusal, q as SqlQuote, qt as readColumnDefault, r as CallWithCompanions, rn as rowsWithoutValueFailure, rt as StoredValueRewrite, s as ContractColumn, sn as slotSource, st as TableMove, t as COLUMN_RENAME_UNMATCHED_CODE, tn as rowsHoldingValueOf, tt as StoredValueCodec, u as ControlPolicySubject, un as sqlTypeLookupsOf, ut as TableRenameByHand, v as MigrationOperationClass, vt as backfillOfDefaultedField, w as MigrationPlannerResult, wt as convertedColumnMeta, x as MigrationPlanOperation, xt as contractColumns, y as MigrationOperationPolicy, yt as checkSqlExpressionText, z as RowsHoldingValueMark, zt as partitionCallsByControlPolicy } from "./control-BE7gXqZF.mjs";
7
7
  import { t as resolveIntrospectedColumnType } from "./control-adapter-BlBhW0pc.mjs";
8
8
  import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-BlX_rfVG.mjs";
9
9
  import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-CZ5Ks7EA.mjs";
10
10
  import { t as SqlMigration } from "./migration-B35kGD-7.mjs";
11
- import { i as sqlTargetTypeConstructors, r as sqlIntegerArgumentGeneratorFunctions, t as idGeneratorFunctionBindings } from "./pack-BPbz6RVm.mjs";
12
- import { a as writeDefaultLiteral, i as writeDataTypeValue, n as DefaultMappingResult, r as mapDefault, t as DefaultMappingOptions } from "./default-mapping-CAOONlKQ-CIg7JCfF.mjs";
13
- import { a as InferredTypeConstructors, c as PslTypeCall, d as inferColumnTypes, f as inferredTypeConstructors, i as InferredTypeConstructor, l as fewestArgumentsCall, m as writtenTypeArguments, n as GeneratorCallRefusal, o as IntrospectedTable, p as toEnumMemberName, r as GeneratorCallsResult, s as PhaseCallText, t as ColumnTypeOf, u as generatorCallsFor } from "./psl-build-CNncjpsa.mjs";
14
- import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-BkkoyXmM.mjs";
15
- import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-BrBva2ta.mjs";
11
+ import { i as sqlTargetTypeConstructors, r as sqlIntegerArgumentGeneratorFunctions, t as idGeneratorFunctionBindings } from "./pack-DKM1hv1E.mjs";
12
+ import { n as DefaultMappingResult, r as mapDefault, t as DefaultMappingOptions } from "./default-mapping-CEISdj2g-B50Ag_F_.mjs";
13
+ import { _ as sameInNormalForm, a as InferredTypeConstructor, c as PhaseCallText, d as WrittenPslTypeCall, f as WrittenTypeChoiceCall, g as inferredTypeConstructors, h as inferColumnTypes, i as GeneratorCallsResult, l as PslTypeArgument, m as generatorCallsFor, n as ColumnTypeReadsDefault, o as InferredTypeConstructors, p as fewestArgumentsCall, r as GeneratorCallRefusal, s as IntrospectedTable, t as ColumnTypeOf, u as PslTypeCall, v as toEnumMemberName, y as writtenTypeChoiceCall } from "./psl-build-DCZaF5g4.mjs";
14
+ import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-Cr9AeccU.mjs";
15
+ import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-CSDcwOEG.mjs";
16
16
  import { n as parseContractMarkerRow, t as ContractMarkerRow } from "./verify-DHXbuZPB.mjs";
17
- export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ColumnTypeOf, type ContractColumn, type ContractColumns, type ContractMarkerRow, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultMappingOptions, type DefaultMappingResult, type DefaultResolver, type DefaultResolverColumn, type EnumInfo, type ExecuteRequestLowerer, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldStatementColumns, type FieldStorageEffect, type GeneratorCallRefusal, type GeneratorCallsResult, INIT_ADDITIVE_POLICY, type InferredRelations, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type Lowerer, SqlMigration as Migration, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, NO_RENAMED_ORIGINS, type NamespaceRename, type NamespaceStatementTarget, type NoTable, type PhaseCallText, type PlanFieldEventOperationsOptions, type PlannedStatements, type PslPrinterOptions, type PslTypeCall, type ReadColumnDefault, type ReadReportedDefault, type RelationField, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type ResolvedDomainModel, type ResolvedStorageTable, type RowsHoldingValueMark, type SchemaTables, type SingleOperationCall, SqlContractSerializer, SqlContractSerializerBase, type SqlControlAdapter, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDefaultFunctionName, type SqlDescribedContractSpace, type SqlDiffVerdict, type SqlDiffVerdictInput, type SqlEntityHydrationFactory, 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 SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, SqlSchemaVerifierBase, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementOwnership, type StatementPlanningTarget, type StorageTypePlanResult, type StorageTypeVerdict, type StorageTypeVerdictInput, type StoredEnumValue, type StoredValueCodec, type StoredValueReplacement, type StoredValueRewrite, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableMove, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, type TargetRefusal, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, type WorkingSchemaOrigins, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, encodeStoredValue, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, generatorCallsFor, idGeneratorFunctionBindings, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, otherSpaceDeclaring, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planEnumValueRewrites, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveIntrospectedColumnType, resolveStorageTable, resolveTableRenameAgainst, rowsHoldingValueMeta, rowsHoldingValueOf, rowsHoldingValueSummary, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlDefaultFunctions, sqlIntegerArgumentGeneratorFunctions, sqlOfSlot, sqlTargetTypeConstructors, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff, withEnumValueOperations, writeDataTypeValue, writeDefaultLiteral, writtenTypeArguments };
17
+ export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ColumnTypeOf, type ColumnTypeReadsDefault, type ContractColumn, type ContractColumns, type ContractMarkerRow, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultMappingOptions, type DefaultMappingResult, type DefaultResolver, type DefaultResolverColumn, type EnumInfo, type ExecuteRequestLowerer, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldStatementColumns, type FieldStorageEffect, type GeneratorCallRefusal, type GeneratorCallsResult, INIT_ADDITIVE_POLICY, type InferredRelations, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type Lowerer, SqlMigration as Migration, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, NO_RENAMED_ORIGINS, type NamespaceRename, type NamespaceStatementTarget, type NoTable, type PhaseCallText, type PlanFieldEventOperationsOptions, type PlannedStatements, type PslPrinterOptions, type PslTypeArgument, type PslTypeCall, type ReadColumnDefault, type ReadReportedDefault, type RelationField, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type ResolvedDomainModel, type ResolvedStorageTable, type RowsHoldingValueMark, type SchemaTables, type SingleOperationCall, SqlContractSerializer, SqlContractSerializerBase, type SqlControlAdapter, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDefaultFunctionName, type SqlDescribedContractSpace, type SqlDiffVerdict, type SqlDiffVerdictInput, type SqlEntityHydrationFactory, 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 SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, SqlSchemaVerifierBase, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementOwnership, type StatementPlanningTarget, type StorageTypePlanResult, type StorageTypeVerdict, type StorageTypeVerdictInput, type StoredEnumValue, type StoredValueCodec, type StoredValueReplacement, type StoredValueRewrite, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableMove, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, type TargetRefusal, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, type WorkingSchemaOrigins, type WrittenPslTypeCall, type WrittenTypeChoiceCall, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, encodeStoredValue, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, generatorCallsFor, idGeneratorFunctionBindings, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, otherSpaceDeclaring, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planEnumValueRewrites, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveIntrospectedColumnType, resolveStorageTable, resolveTableRenameAgainst, rowsHoldingValueMeta, rowsHoldingValueOf, rowsHoldingValueSummary, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, sameInNormalForm, slotSource, sqlDefaultFunctions, sqlIntegerArgumentGeneratorFunctions, sqlOfSlot, sqlTargetTypeConstructors, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff, withEnumValueOperations, writtenTypeChoiceCall };
package/dist/family.mjs CHANGED
@@ -1,16 +1,16 @@
1
1
  import { t as resolveStorageTable } from "./resolve-storage-table-BHLQsOza.mjs";
2
- import { n as checkSqlDefaultText } from "./validators-CnQqLEIi.mjs";
3
- import { c as sqlTargetTypeConstructors, s as sqlIntegerArgumentGeneratorFunctions, t as idGeneratorFunctionBindings } from "./generator-functions-Hy4pDDr9-BUHOsofo.mjs";
4
- import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as extractCodecControlHooks } from "./schema-verify-C3wbdviw-mlPO4NkT.mjs";
5
- import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-aQd4v3fE.mjs";
2
+ import { n as checkSqlDefaultText } from "./validators-qcQteqs2.mjs";
3
+ import { c as sqlTargetTypeConstructors, s as sqlIntegerArgumentGeneratorFunctions, t as idGeneratorFunctionBindings } from "./generator-functions-Hy4pDDr9-CMfJOBtv.mjs";
4
+ import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as extractCodecControlHooks } from "./schema-verify-C3wbdviw-nQ4tG9N7.mjs";
5
+ import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs";
6
6
  import { n as parseContractMarkerRow } from "./verify-BVk5bjdH-DhKm6hB3.mjs";
7
- import { $ as sqlTypeLookupsOf, A as planEnumValueRewrites, B as requiredColumnsOfMigration, C as fieldRenameStorageEffect, D as otherSpaceDeclaring, E as modelRenameStorageEffect, F as plannerSuccess, G as rowsHoldingValueSummary, H as resolveTableRenameAgainst, I as readColumnDefault, J as runnerFailure, K as rowsWithoutValueFailure, L as readReportedDefault, M as planFieldEventOperations, N as planStatements, O as partitionCallsByControlPolicy, P as plannerFailure, Q as sqlOfSlot, R as requiredColumnMeta, S as fieldOfColumn, T as isUnfilledSlot, U as rowsHoldingValueMeta, V as resolveColumnRenameAgainst, W as rowsHoldingValueOf, X as slotSource, Y as runnerSuccess, Z as sqlDefaultFunctions, _ as createSqlTextSources, a as appliedStatementsInOrder, at as unmatchedTableRename, b as encodeStoredValue, c as checkSqlExpressionText, d as contractNamespaceToSchemaIR, et as storageNameOfOperation, f as contractToSchemaIR, g as createMigrationPlan, h as convertedColumnOf, i as TABLE_NAME_CASE_CHANGED_CODE, it as unmatchedColumnRename, j as planFieldEventCalls, k as partitionIssuesByControlPolicy, l as columnTakesTemporaryValue, m as convertedColumnMeta, n as INIT_ADDITIVE_POLICY, nt as unconvertedFieldOf, o as assembleAuthoringContributions, ot as withEnumValueOperations, q as rowsWithoutValueSummary, r as NO_RENAMED_ORIGINS, rt as unknownCallNames, s as backfillOfDefaultedField, t as COLUMN_RENAME_UNMATCHED_CODE, tt as subjectsOfCalls, u as contractColumns, v as detectDestructiveChanges, w as fieldStatementColumns, x as fieldEventStorage, y as detectTableNameCaseChanges, z as requiredColumnOf } from "./control-C1EjGUVq.mjs";
8
- import { t as resolveIntrospectedColumnType } from "./control-adapter-SlQkTEwT.mjs";
7
+ import { $ as sqlTypeLookupsOf, A as planEnumValueRewrites, B as requiredColumnsOfMigration, C as fieldRenameStorageEffect, D as otherSpaceDeclaring, E as modelRenameStorageEffect, F as plannerSuccess, G as rowsHoldingValueSummary, H as resolveTableRenameAgainst, I as readColumnDefault, J as runnerFailure, K as rowsWithoutValueFailure, L as readReportedDefault, M as planFieldEventOperations, N as planStatements, O as partitionCallsByControlPolicy, P as plannerFailure, Q as sqlOfSlot, R as requiredColumnMeta, S as fieldOfColumn, T as isUnfilledSlot, U as rowsHoldingValueMeta, V as resolveColumnRenameAgainst, W as rowsHoldingValueOf, X as slotSource, Y as runnerSuccess, Z as sqlDefaultFunctions, _ as createSqlTextSources, a as appliedStatementsInOrder, at as unmatchedTableRename, b as encodeStoredValue, c as checkSqlExpressionText, d as contractNamespaceToSchemaIR, et as storageNameOfOperation, f as contractToSchemaIR, g as createMigrationPlan, h as convertedColumnOf, i as TABLE_NAME_CASE_CHANGED_CODE, it as unmatchedColumnRename, j as planFieldEventCalls, k as partitionIssuesByControlPolicy, l as columnTakesTemporaryValue, m as convertedColumnMeta, n as INIT_ADDITIVE_POLICY, nt as unconvertedFieldOf, o as assembleAuthoringContributions, ot as withEnumValueOperations, q as rowsWithoutValueSummary, r as NO_RENAMED_ORIGINS, rt as unknownCallNames, s as backfillOfDefaultedField, t as COLUMN_RENAME_UNMATCHED_CODE, tt as subjectsOfCalls, u as contractColumns, v as detectDestructiveChanges, w as fieldStatementColumns, x as fieldEventStorage, y as detectTableNameCaseChanges, z as requiredColumnOf } from "./control-DPCrkpMS.mjs";
8
+ import { t as resolveIntrospectedColumnType } from "./control-adapter-BetaUm2y.mjs";
9
9
  import { t as arraysEqual } from "./diff-C1rFOhek.mjs";
10
10
  import { t as SqlSchemaVerifierBase } from "./ir-DzsUDO8e.mjs";
11
11
  import { t as SqlMigration } from "./migration-BJQjkqFz.mjs";
12
12
  import { s as toEnumMemberName } from "./psl-names-C3cwe0rg-D1CTmC3a.mjs";
13
- import { a as mapDefault, c as writtenTypeArguments, i as inferredTypeConstructors, n as generatorCallsFor, o as writeDataTypeValue, r as inferColumnTypes, s as writeDefaultLiteral, t as fewestArgumentsCall } from "./psl-build-DqqYhOsa.mjs";
13
+ import { a as mapDefault, i as inferredTypeConstructors, n as generatorCallsFor, o as sameInNormalForm, r as inferColumnTypes, s as writtenTypeChoiceCall, t as fewestArgumentsCall } from "./psl-build-BA0Ndi1v.mjs";
14
14
  import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-C9kVS9ma.mjs";
15
- import { i as timestampNowRuntimeGenerator, n as resolveDomainModel, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./runtime-CCzfa1mY.mjs";
16
- export { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, SqlMigration as Migration, NO_RENAMED_ORIGINS, SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase, TABLE_NAME_CASE_CHANGED_CODE, UNBOUND_DOMAIN_NAMESPACE_ID, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, encodeStoredValue, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, generatorCallsFor, idGeneratorFunctionBindings, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, otherSpaceDeclaring, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planEnumValueRewrites, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveIntrospectedColumnType, resolveStorageTable, resolveTableRenameAgainst, rowsHoldingValueMeta, rowsHoldingValueOf, rowsHoldingValueSummary, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlDefaultFunctions, sqlIntegerArgumentGeneratorFunctions, sqlOfSlot, sqlTargetTypeConstructors, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff, withEnumValueOperations, writeDataTypeValue, writeDefaultLiteral, writtenTypeArguments };
15
+ import { i as timestampNowRuntimeGenerator, n as resolveDomainModel, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./runtime-DkUiQi00.mjs";
16
+ export { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, SqlMigration as Migration, NO_RENAMED_ORIGINS, SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase, TABLE_NAME_CASE_CHANGED_CODE, UNBOUND_DOMAIN_NAMESPACE_ID, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, encodeStoredValue, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, generatorCallsFor, idGeneratorFunctionBindings, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, otherSpaceDeclaring, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planEnumValueRewrites, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveIntrospectedColumnType, resolveStorageTable, resolveTableRenameAgainst, rowsHoldingValueMeta, rowsHoldingValueOf, rowsHoldingValueSummary, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, sameInNormalForm, slotSource, sqlDefaultFunctions, sqlIntegerArgumentGeneratorFunctions, sqlOfSlot, sqlTargetTypeConstructors, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff, withEnumValueOperations, writtenTypeChoiceCall };
@@ -1,2 +1,2 @@
1
- import { t as resolveIntrospectedColumnType } from "./control-adapter-SlQkTEwT.mjs";
1
+ import { t as resolveIntrospectedColumnType } from "./control-adapter-BetaUm2y.mjs";
2
2
  export { resolveIntrospectedColumnType };
@@ -1,5 +1,5 @@
1
1
  import { h as checkSqlDefaultText } from "./validators-Dt-19ywK.mjs";
2
2
  import { C as SqlPlannerConflict, D as SqlPlannerResult, E as SqlPlannerFailureResult, O as SqlPlannerSuccessResult, S as SqlPlanTargetDetails, T as SqlPlannerConflictLocation, _ as SqlMigrationRunnerExecuteCallbacks, a as ResolveIdentityValueInput, b as SqlMigrationRunnerResult, c as SqlMigrationPlan, d as SqlMigrationPlanOperationStep, f as SqlMigrationPlanOperationTarget, g as SqlMigrationRunnerErrorCode, h as SqlMigrationRunner, i as FieldEventContext, k as StorageTypePlanResult, l as SqlMigrationPlanContractInfo, m as SqlMigrationPlannerPlanOptions, n as CreateSqlMigrationPlanOptions, o as SqlControlAdapterDescriptor, p as SqlMigrationPlanner, r as FieldEvent, s as SqlControlExtensionDescriptor, t as CodecControlHooks, u as SqlMigrationPlanOperation, v as SqlMigrationRunnerExecuteOptions, w as SqlPlannerConflictKind, x as SqlMigrationRunnerSuccessValue, y as SqlMigrationRunnerFailure } from "./types-COXfSNOP-D9vt9QDL.mjs";
3
3
  import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-BXkhxcPs.mjs";
4
- import { $ as StatementPlanningTarget, $t as resolveTableRenameAgainst, A as NoTable, At as encodeStoredValue, B as SchemaTables, Bt as partitionIssuesByControlPolicy, C as MigrationPlannerConflict, Ct as contractToSchemaIR, D as NO_RENAMED_ORIGINS, Dt as createSqlTextSources, E as ModelTable, Et as createMigrationPlan, F as ReportedBody, Ft as fieldStatementColumns, G as SqlDescribedContractSpace, Gt as plannerFailure, H as SqlControlFamilyInstance, Ht as planFieldEventCalls, I as ReportedLiteralDefault, It as isUnfilledSlot, J as SqlQuotingRules, Jt as readReportedDefault, K as SqlPslBuildContext, Kt as plannerSuccess, L as RequiredColumn, Lt as modelRenameStorageEffect, M as PlannedStatements, Mt as fieldEventStorage, N as ReadColumnDefault, Nt as fieldOfColumn, O as NamespaceRename, Ot as detectDestructiveChanges, P as ReadReportedDefault, Pt as fieldRenameStorageEffect, Q as StatementOwnership, Qt as resolveColumnRenameAgainst, R as RequiredColumnMark, Rt as otherSpaceDeclaring, S as MigrationPlanner, St as contractNamespaceToSchemaIR, T as ModelStorageEffect, Tt as convertedColumnOf, U as SqlControlTargetDescriptor, Ut as planFieldEventOperations, V as SingleOperationCall, Vt as planEnumValueRewrites, W as SqlDefaultFunctionName, Wt as planStatements, X as SqlTextSources, Xt as requiredColumnOf, Y as SqlSlot, Yt as requiredColumnMeta, Z as StatementColumn, Zt as requiredColumnsOfMigration, _ as INIT_ADDITIVE_POLICY, _n as withEnumValueOperations, _t as assembleAuthoringContributions, a as ColumnRename, an as runnerFailure, at as SuppressionRecord, b as MigrationPlan, bt as columnTakesTemporaryValue, c as ContractColumns, cn as sqlDefaultFunctions, ct as TableNameCaseGuardTable, d as ConvertedColumn, dn as storageNameOfOperation, dt as TableRenameRequest, en as rowsHoldingValueMeta, et as StoredEnumValue, f as DefaultResolver, fn as subjectsOfCalls, ft as TargetMigrationsCapability, g as FieldStorageEffect, gn as unmatchedTableRename, gt as appliedStatementsInOrder, h as FieldStatementColumns, hn as unmatchedColumnRename, ht as _default, i as ColumnOnOneSide, in as rowsWithoutValueSummary, it as SubjectStorage, j as PlanFieldEventOperationsOptions, jt as extractCodecControlHooks, k as NamespaceStatementTarget, kt as detectTableNameCaseChanges, l as ContractToSchemaIROptions, ln as sqlOfSlot, lt as TableRename, m as FieldEventCall, mn as unknownCallNames, mt as WorkingSchemaOrigins, n as CallSubjects, nn as rowsHoldingValueSummary, nt as StoredValueReplacement, o as ColumnRenameRequest, on as runnerSuccess, ot as TABLE_NAME_CASE_CHANGED_CODE, p as DefaultResolverColumn, pn as unconvertedFieldOf, pt as TargetRefusal, q as SqlQuote, qt as readColumnDefault, r as CallWithCompanions, rn as rowsWithoutValueFailure, rt as StoredValueRewrite, s as ContractColumn, sn as slotSource, st as TableMove, t as COLUMN_RENAME_UNMATCHED_CODE, tn as rowsHoldingValueOf, tt as StoredValueCodec, u as ControlPolicySubject, un as sqlTypeLookupsOf, ut as TableRenameByHand, v as MigrationOperationClass, vt as backfillOfDefaultedField, w as MigrationPlannerResult, wt as convertedColumnMeta, x as MigrationPlanOperation, xt as contractColumns, y as MigrationOperationPolicy, yt as checkSqlExpressionText, z as RowsHoldingValueMark, zt as partitionCallsByControlPolicy } from "./control-B2CeDfVO.mjs";
4
+ import { $ as StatementPlanningTarget, $t as resolveTableRenameAgainst, A as NoTable, At as encodeStoredValue, B as SchemaTables, Bt as partitionIssuesByControlPolicy, C as MigrationPlannerConflict, Ct as contractToSchemaIR, D as NO_RENAMED_ORIGINS, Dt as createSqlTextSources, E as ModelTable, Et as createMigrationPlan, F as ReportedBody, Ft as fieldStatementColumns, G as SqlDescribedContractSpace, Gt as plannerFailure, H as SqlControlFamilyInstance, Ht as planFieldEventCalls, I as ReportedLiteralDefault, It as isUnfilledSlot, J as SqlQuotingRules, Jt as readReportedDefault, K as SqlPslBuildContext, Kt as plannerSuccess, L as RequiredColumn, Lt as modelRenameStorageEffect, M as PlannedStatements, Mt as fieldEventStorage, N as ReadColumnDefault, Nt as fieldOfColumn, O as NamespaceRename, Ot as detectDestructiveChanges, P as ReadReportedDefault, Pt as fieldRenameStorageEffect, Q as StatementOwnership, Qt as resolveColumnRenameAgainst, R as RequiredColumnMark, Rt as otherSpaceDeclaring, S as MigrationPlanner, St as contractNamespaceToSchemaIR, T as ModelStorageEffect, Tt as convertedColumnOf, U as SqlControlTargetDescriptor, Ut as planFieldEventOperations, V as SingleOperationCall, Vt as planEnumValueRewrites, W as SqlDefaultFunctionName, Wt as planStatements, X as SqlTextSources, Xt as requiredColumnOf, Y as SqlSlot, Yt as requiredColumnMeta, Z as StatementColumn, Zt as requiredColumnsOfMigration, _ as INIT_ADDITIVE_POLICY, _n as withEnumValueOperations, _t as assembleAuthoringContributions, a as ColumnRename, an as runnerFailure, at as SuppressionRecord, b as MigrationPlan, bt as columnTakesTemporaryValue, c as ContractColumns, cn as sqlDefaultFunctions, ct as TableNameCaseGuardTable, d as ConvertedColumn, dn as storageNameOfOperation, dt as TableRenameRequest, en as rowsHoldingValueMeta, et as StoredEnumValue, f as DefaultResolver, fn as subjectsOfCalls, ft as TargetMigrationsCapability, g as FieldStorageEffect, gn as unmatchedTableRename, gt as appliedStatementsInOrder, h as FieldStatementColumns, hn as unmatchedColumnRename, ht as _default, i as ColumnOnOneSide, in as rowsWithoutValueSummary, it as SubjectStorage, j as PlanFieldEventOperationsOptions, jt as extractCodecControlHooks, k as NamespaceStatementTarget, kt as detectTableNameCaseChanges, l as ContractToSchemaIROptions, ln as sqlOfSlot, lt as TableRename, m as FieldEventCall, mn as unknownCallNames, mt as WorkingSchemaOrigins, n as CallSubjects, nn as rowsHoldingValueSummary, nt as StoredValueReplacement, o as ColumnRenameRequest, on as runnerSuccess, ot as TABLE_NAME_CASE_CHANGED_CODE, p as DefaultResolverColumn, pn as unconvertedFieldOf, pt as TargetRefusal, q as SqlQuote, qt as readColumnDefault, r as CallWithCompanions, rn as rowsWithoutValueFailure, rt as StoredValueRewrite, s as ContractColumn, sn as slotSource, st as TableMove, t as COLUMN_RENAME_UNMATCHED_CODE, tn as rowsHoldingValueOf, tt as StoredValueCodec, u as ControlPolicySubject, un as sqlTypeLookupsOf, ut as TableRenameByHand, v as MigrationOperationClass, vt as backfillOfDefaultedField, w as MigrationPlannerResult, wt as convertedColumnMeta, x as MigrationPlanOperation, xt as contractColumns, y as MigrationOperationPolicy, yt as checkSqlExpressionText, z as RowsHoldingValueMark, zt as partitionCallsByControlPolicy } from "./control-BE7gXqZF.mjs";
5
5
  export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ContractColumn, type ContractColumns, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultResolver, type DefaultResolverColumn, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldStatementColumns, type FieldStorageEffect, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, NO_RENAMED_ORIGINS, type NamespaceRename, type NamespaceStatementTarget, type NoTable, type PlanFieldEventOperationsOptions, type PlannedStatements, type ReadColumnDefault, type ReadReportedDefault, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type RowsHoldingValueMark, type SchemaTables, type SingleOperationCall, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDefaultFunctionName, 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 SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementOwnership, type StatementPlanningTarget, type StorageTypePlanResult, type StoredEnumValue, type StoredValueCodec, type StoredValueReplacement, type StoredValueRewrite, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableMove, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, type TargetRefusal, type WorkingSchemaOrigins, appliedStatementsInOrder, assembleAuthoringContributions, backfillOfDefaultedField, checkSqlDefaultText, checkSqlExpressionText, columnTakesTemporaryValue, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, _default as default, detectDestructiveChanges, detectTableNameCaseChanges, encodeStoredValue, extractCodecControlHooks, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, isUnfilledSlot, modelRenameStorageEffect, otherSpaceDeclaring, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planEnumValueRewrites, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveTableRenameAgainst, rowsHoldingValueMeta, rowsHoldingValueOf, rowsHoldingValueSummary, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlDefaultFunctions, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, withEnumValueOperations };
@@ -1,4 +1,4 @@
1
- import { n as checkSqlDefaultText } from "./validators-CnQqLEIi.mjs";
2
- import { s as extractCodecControlHooks } from "./schema-verify-C3wbdviw-mlPO4NkT.mjs";
3
- import { $ as sqlTypeLookupsOf, A as planEnumValueRewrites, B as requiredColumnsOfMigration, C as fieldRenameStorageEffect, D as otherSpaceDeclaring, E as modelRenameStorageEffect, F as plannerSuccess, G as rowsHoldingValueSummary, H as resolveTableRenameAgainst, I as readColumnDefault, J as runnerFailure, K as rowsWithoutValueFailure, L as readReportedDefault, M as planFieldEventOperations, N as planStatements, O as partitionCallsByControlPolicy, P as plannerFailure, Q as sqlOfSlot, R as requiredColumnMeta, S as fieldOfColumn, T as isUnfilledSlot, U as rowsHoldingValueMeta, V as resolveColumnRenameAgainst, W as rowsHoldingValueOf, X as slotSource, Y as runnerSuccess, Z as sqlDefaultFunctions, _ as createSqlTextSources, a as appliedStatementsInOrder, at as unmatchedTableRename, b as encodeStoredValue, c as checkSqlExpressionText, d as contractNamespaceToSchemaIR, et as storageNameOfOperation, f as contractToSchemaIR, g as createMigrationPlan, h as convertedColumnOf, i as TABLE_NAME_CASE_CHANGED_CODE, it as unmatchedColumnRename, j as planFieldEventCalls, k as partitionIssuesByControlPolicy, l as columnTakesTemporaryValue, m as convertedColumnMeta, n as INIT_ADDITIVE_POLICY, nt as unconvertedFieldOf, o as assembleAuthoringContributions, ot as withEnumValueOperations, p as control_default, q as rowsWithoutValueSummary, r as NO_RENAMED_ORIGINS, rt as unknownCallNames, s as backfillOfDefaultedField, t as COLUMN_RENAME_UNMATCHED_CODE, tt as subjectsOfCalls, u as contractColumns, v as detectDestructiveChanges, w as fieldStatementColumns, x as fieldEventStorage, y as detectTableNameCaseChanges, z as requiredColumnOf } from "./control-C1EjGUVq.mjs";
1
+ import { n as checkSqlDefaultText } from "./validators-qcQteqs2.mjs";
2
+ import { s as extractCodecControlHooks } from "./schema-verify-C3wbdviw-nQ4tG9N7.mjs";
3
+ import { $ as sqlTypeLookupsOf, A as planEnumValueRewrites, B as requiredColumnsOfMigration, C as fieldRenameStorageEffect, D as otherSpaceDeclaring, E as modelRenameStorageEffect, F as plannerSuccess, G as rowsHoldingValueSummary, H as resolveTableRenameAgainst, I as readColumnDefault, J as runnerFailure, K as rowsWithoutValueFailure, L as readReportedDefault, M as planFieldEventOperations, N as planStatements, O as partitionCallsByControlPolicy, P as plannerFailure, Q as sqlOfSlot, R as requiredColumnMeta, S as fieldOfColumn, T as isUnfilledSlot, U as rowsHoldingValueMeta, V as resolveColumnRenameAgainst, W as rowsHoldingValueOf, X as slotSource, Y as runnerSuccess, Z as sqlDefaultFunctions, _ as createSqlTextSources, a as appliedStatementsInOrder, at as unmatchedTableRename, b as encodeStoredValue, c as checkSqlExpressionText, d as contractNamespaceToSchemaIR, et as storageNameOfOperation, f as contractToSchemaIR, g as createMigrationPlan, h as convertedColumnOf, i as TABLE_NAME_CASE_CHANGED_CODE, it as unmatchedColumnRename, j as planFieldEventCalls, k as partitionIssuesByControlPolicy, l as columnTakesTemporaryValue, m as convertedColumnMeta, n as INIT_ADDITIVE_POLICY, nt as unconvertedFieldOf, o as assembleAuthoringContributions, ot as withEnumValueOperations, p as control_default, q as rowsWithoutValueSummary, r as NO_RENAMED_ORIGINS, rt as unknownCallNames, s as backfillOfDefaultedField, t as COLUMN_RENAME_UNMATCHED_CODE, tt as subjectsOfCalls, u as contractColumns, v as detectDestructiveChanges, w as fieldStatementColumns, x as fieldEventStorage, y as detectTableNameCaseChanges, z as requiredColumnOf } from "./control-DPCrkpMS.mjs";
4
4
  export { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, NO_RENAMED_ORIGINS, TABLE_NAME_CASE_CHANGED_CODE, appliedStatementsInOrder, assembleAuthoringContributions, backfillOfDefaultedField, checkSqlDefaultText, checkSqlExpressionText, columnTakesTemporaryValue, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, control_default as default, detectDestructiveChanges, detectTableNameCaseChanges, encodeStoredValue, extractCodecControlHooks, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, isUnfilledSlot, modelRenameStorageEffect, otherSpaceDeclaring, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planEnumValueRewrites, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveTableRenameAgainst, rowsHoldingValueMeta, rowsHoldingValueOf, rowsHoldingValueSummary, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlDefaultFunctions, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, withEnumValueOperations };
@@ -1,3 +1,3 @@
1
- import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue } from "./schema-verify-C3wbdviw-mlPO4NkT.mjs";
1
+ import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue } from "./schema-verify-C3wbdviw-nQ4tG9N7.mjs";
2
2
  import { t as arraysEqual } from "./diff-C1rFOhek.mjs";
3
3
  export { arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
@@ -1,3 +1,3 @@
1
- import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-aQd4v3fE.mjs";
1
+ import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs";
2
2
  import { t as SqlSchemaVerifierBase } from "./ir-DzsUDO8e.mjs";
3
3
  export { SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase };
@@ -1,2 +1,2 @@
1
- import { i as sqlTargetTypeConstructors, n as sqlFamilyPack, r as sqlIntegerArgumentGeneratorFunctions, t as idGeneratorFunctionBindings } from "./pack-BPbz6RVm.mjs";
1
+ import { i as sqlTargetTypeConstructors, n as sqlFamilyPack, r as sqlIntegerArgumentGeneratorFunctions, t as idGeneratorFunctionBindings } from "./pack-DKM1hv1E.mjs";
2
2
  export { sqlFamilyPack as default, idGeneratorFunctionBindings, sqlIntegerArgumentGeneratorFunctions, sqlTargetTypeConstructors };
@@ -1,6 +1,6 @@
1
1
  import { f as sqlExpressionRegistration } from "./sql-expression-CKgKznXS.mjs";
2
- import { b as sqlAttributeSpecs } from "./psl-field-resolution-Bvhx79fP-CuyYFk8z.mjs";
3
- import { a as sqlFamilyGeneratorFunctions, c as sqlTargetTypeConstructors, i as sqlFamilyGeneratorDescriptors, n as sqlFamilyAuthoringTypes, o as sqlFamilyPslBlockDescriptors, r as sqlFamilyEntityTypes, s as sqlIntegerArgumentGeneratorFunctions, t as idGeneratorFunctionBindings } from "./generator-functions-Hy4pDDr9-BUHOsofo.mjs";
2
+ import { b as sqlAttributeSpecs } from "./psl-field-resolution-BW2_FOb9-DxqR43fo.mjs";
3
+ import { a as sqlFamilyGeneratorFunctions, c as sqlTargetTypeConstructors, i as sqlFamilyGeneratorDescriptors, n as sqlFamilyAuthoringTypes, o as sqlFamilyPslBlockDescriptors, r as sqlFamilyEntityTypes, s as sqlIntegerArgumentGeneratorFunctions, t as idGeneratorFunctionBindings } from "./generator-functions-Hy4pDDr9-CMfJOBtv.mjs";
4
4
  //#region ../../../2-sql-family/9-family/dist/pack.mjs
5
5
  const sqlFamilyPack = {
6
6
  kind: "family",
@@ -1,3 +1,3 @@
1
- import { a as writeDefaultLiteral, i as writeDataTypeValue, n as DefaultMappingResult, r as mapDefault, t as DefaultMappingOptions } from "./default-mapping-CAOONlKQ-CIg7JCfF.mjs";
2
- import { a as InferredTypeConstructors, c as PslTypeCall, d as inferColumnTypes, f as inferredTypeConstructors, i as InferredTypeConstructor, l as fewestArgumentsCall, m as writtenTypeArguments, n as GeneratorCallRefusal, o as IntrospectedTable, p as toEnumMemberName, r as GeneratorCallsResult, s as PhaseCallText, t as ColumnTypeOf, u as generatorCallsFor } from "./psl-build-CNncjpsa.mjs";
3
- export { type ColumnTypeOf, type DefaultMappingOptions, type DefaultMappingResult, type GeneratorCallRefusal, type GeneratorCallsResult, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type PhaseCallText, type PslTypeCall, fewestArgumentsCall, generatorCallsFor, inferColumnTypes, inferredTypeConstructors, mapDefault, toEnumMemberName, writeDataTypeValue, writeDefaultLiteral, writtenTypeArguments };
1
+ import { n as DefaultMappingResult, r as mapDefault, t as DefaultMappingOptions } from "./default-mapping-CEISdj2g-B50Ag_F_.mjs";
2
+ import { _ as sameInNormalForm, a as InferredTypeConstructor, c as PhaseCallText, d as WrittenPslTypeCall, f as WrittenTypeChoiceCall, g as inferredTypeConstructors, h as inferColumnTypes, i as GeneratorCallsResult, l as PslTypeArgument, m as generatorCallsFor, n as ColumnTypeReadsDefault, o as InferredTypeConstructors, p as fewestArgumentsCall, r as GeneratorCallRefusal, s as IntrospectedTable, t as ColumnTypeOf, u as PslTypeCall, v as toEnumMemberName, y as writtenTypeChoiceCall } from "./psl-build-DCZaF5g4.mjs";
3
+ export { type ColumnTypeOf, type ColumnTypeReadsDefault, type DefaultMappingOptions, type DefaultMappingResult, type GeneratorCallRefusal, type GeneratorCallsResult, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type PhaseCallText, type PslTypeArgument, type PslTypeCall, type WrittenPslTypeCall, type WrittenTypeChoiceCall, fewestArgumentsCall, generatorCallsFor, inferColumnTypes, inferredTypeConstructors, mapDefault, sameInNormalForm, toEnumMemberName, writtenTypeChoiceCall };
@@ -1,3 +1,3 @@
1
1
  import { s as toEnumMemberName } from "./psl-names-C3cwe0rg-D1CTmC3a.mjs";
2
- import { a as mapDefault, c as writtenTypeArguments, i as inferredTypeConstructors, n as generatorCallsFor, o as writeDataTypeValue, r as inferColumnTypes, s as writeDefaultLiteral, t as fewestArgumentsCall } from "./psl-build-DqqYhOsa.mjs";
3
- export { fewestArgumentsCall, generatorCallsFor, inferColumnTypes, inferredTypeConstructors, mapDefault, toEnumMemberName, writeDataTypeValue, writeDefaultLiteral, writtenTypeArguments };
2
+ import { a as mapDefault, i as inferredTypeConstructors, n as generatorCallsFor, o as sameInNormalForm, r as inferColumnTypes, s as writtenTypeChoiceCall, t as fewestArgumentsCall } from "./psl-build-BA0Ndi1v.mjs";
3
+ export { fewestArgumentsCall, generatorCallsFor, inferColumnTypes, inferredTypeConstructors, mapDefault, sameInNormalForm, toEnumMemberName, writtenTypeChoiceCall };
@@ -1,2 +1,2 @@
1
- import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-BkkoyXmM.mjs";
1
+ import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-Cr9AeccU.mjs";
2
2
  export { type EnumInfo, type InferredRelations, type PslPrinterOptions, type RelationField, buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, pluralize, toEnumName, toFieldName, toModelName };
@@ -1,3 +1,3 @@
1
1
  import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-D1rXCcCk.mjs";
2
- import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-BrBva2ta.mjs";
2
+ import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-CSDcwOEG.mjs";
3
3
  export { type ResolvedDomainModel, type ResolvedStorageTable, UNBOUND_DOMAIN_NAMESPACE_ID, sqlRuntimeFamilyDescriptor as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };
@@ -1,3 +1,3 @@
1
1
  import { t as resolveStorageTable } from "./resolve-storage-table-BHLQsOza.mjs";
2
- import { i as timestampNowRuntimeGenerator, n as resolveDomainModel, r as runtime_default, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./runtime-CCzfa1mY.mjs";
2
+ import { i as timestampNowRuntimeGenerator, n as resolveDomainModel, r as runtime_default, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./runtime-DkUiQi00.mjs";
3
3
  export { UNBOUND_DOMAIN_NAMESPACE_ID, runtime_default as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };
@@ -1,5 +1,5 @@
1
1
  import { n as generatedIdColumnAliases } from "./generated-id-column-aliases-DPUii1fN.mjs";
2
- import { c as enumType } from "./contract-builder-Bk-Co792.mjs";
2
+ import { c as enumType } from "./contract-builder-D50r41BU.mjs";
3
3
  import { c as SQL_TEXT_CODEC_ID, i as SQL_CHAR_CODEC_ID, l as SQL_VARCHAR_CODEC_ID } from "./ast-C3itulLi.mjs";
4
4
  import { readEnumBlockMembers, resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
5
5
  import { enumRefusalOf, requiredParamKeys } from "@prisma/orm-framework/components/codec";
@@ -402,4 +402,4 @@ function checkedInteger(integer, dataTypes, allowed, refusal) {
402
402
  //#endregion
403
403
  export { sqlFamilyGeneratorFunctions as a, sqlTargetTypeConstructors as c, sqlFamilyGeneratorDescriptors as i, sqlFamilyAuthoringTypes as n, sqlFamilyPslBlockDescriptors as o, sqlFamilyEntityTypes as r, sqlIntegerArgumentGeneratorFunctions as s, idGeneratorFunctionBindings as t };
404
404
 
405
- //# sourceMappingURL=generator-functions-Hy4pDDr9-BUHOsofo.mjs.map
405
+ //# sourceMappingURL=generator-functions-Hy4pDDr9-CMfJOBtv.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generator-functions-Hy4pDDr9-BUHOsofo.mjs","names":[],"sources":["../../../../2-sql-family/9-family/dist/generator-functions-Hy4pDDr9.mjs"],"sourcesContent":["import { readEnumBlockMembers, resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { enumRefusalOf, requiredParamKeys } from \"@internal/framework-components/codec\";\nimport { blockAttribute, dataTypeValue, enumMemberValue, leafDiagnostic, mapBlock, optional, refineArg, str } from \"@internal/psl-parser\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\nimport { generatedIdColumnAliases } from \"@internal/sql-contract/generated-id-column-aliases\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { CUID_VERSION, NANOID_SIZE, UUID_VERSIONS, generatedLength } from \"@internal/ids\";\nimport { SQL_CHAR_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/sql-relational-core/ast\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/core/authoring-entity-types.ts\nfunction sqlFamilyEnumSpec() {\n\treturn mapBlock({\n\t\tvalue: {\n\t\t\ttype: enumMemberValue(),\n\t\t\tdocumentation: \"The member's value, written as a value of the enum's data type; a bare member stores its own name.\"\n\t\t},\n\t\tallowBare: true\n\t});\n}\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst descriptor = ctx.codecLookup.descriptorFor(codecId);\n\t\tconst codec = ctx.codecLookup.get(codecId);\n\t\tif (descriptor === void 0 || codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst enumRefusal = enumRefusalOf(descriptor);\n\t\tif (enumRefusal !== void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" cannot use the codec \"${codecId}\". ${enumRefusal}`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst dataType = ctx.dataTypes.lookup.get(descriptor.dataType);\n\t\tif (dataType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" represents data type \"${descriptor.dataType}\", which no component registers`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst [requiredParam] = requiredParamKeys(dataType);\n\t\tif (requiredParam !== void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_TYPE_NEEDS_PARAMETERS\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" represents data type \"${dataType.id}\", which requires the parameter \"${requiredParam}\"; an enum block gives it none`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst members = readEnumBlockMembers(block, codecId, codec, ctx);\n\t\tif (members === void 0) return void 0;\n\t\treturn enumType(block.name, { codecId }, ...members);\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tspec: sqlFamilyEnumSpec,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\n//#region src/core/authoring-types.ts\nconst sqlFamilyAuthoringTypes = {\n\tRaw: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A column of a type no other column type covers, written exactly as the database catalog prints it, such as Raw(sql`tsvector`). Its values are typed unknown, and its default is a sql expression.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: \"sql/expression\",\n\t\t\tname: \"sql\"\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/raw@1\",\n\t\t\ttypeParams: { sql: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tsql: generatedIdColumnAliases\n};\n/**\n* The type constructors every SQL target contributes itself, because their arguments are sizes, such as a length, and only the target names the data type a size is a value of: `sizeType`, such as `pg/int4`.\n*/\nfunction sqlTargetTypeConstructors(input) {\n\treturn { sql: {\n\t\tString: {\n\t\t\tkind: \"typeConstructor\",\n\t\t\tdocumentation: \"Variable-length text with a required maximum character length.\",\n\t\t\targs: [{\n\t\t\t\tkind: \"value\",\n\t\t\t\tdataType: input.sizeType,\n\t\t\t\tname: \"length\"\n\t\t\t}],\n\t\t\toutput: {\n\t\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t} }\n\t\t\t}\n\t\t},\n\t\tChar: {\n\t\t\tkind: \"typeConstructor\",\n\t\t\tdocumentation: \"Fixed-length text with a required character length.\",\n\t\t\targs: [{\n\t\t\t\tkind: \"value\",\n\t\t\t\tdataType: input.sizeType,\n\t\t\t\tname: \"length\"\n\t\t\t}],\n\t\t\toutput: {\n\t\t\t\tcodecId: \"sql/char@1\",\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t} }\n\t\t\t}\n\t\t}\n\t} };\n}\n//#endregion\n//#region src/core/generator-functions.ts\nconst NANOID_DEFAULT_SIZE = 21;\nconst nowSignature = { documentation: \"Writes the current time, as the column's codec represents it.\" };\nconst ulidSignature = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst ksuidSignature = { documentation: \"Generates a KSUID when a value is not supplied.\" };\nfunction refused(message) {\n\treturn {\n\t\tok: false,\n\t\tmessage\n\t};\n}\nfunction generated(id, params) {\n\treturn {\n\t\tok: true,\n\t\tgenerator: params === void 0 ? {\n\t\t\tkind: \"generator\",\n\t\t\tid\n\t\t} : {\n\t\t\tkind: \"generator\",\n\t\t\tid,\n\t\t\tparams\n\t\t}\n\t};\n}\nfunction uuidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"uuidv4\", \"uuidv7\"],\n\t\tresolve: ({ args }) => {\n\t\t\tconst version = args[\"version\"];\n\t\t\tif (version === void 0 || version === UUID_VERSIONS.v4) return generated(\"uuidv4\");\n\t\t\tif (version === UUID_VERSIONS.v7) return generated(\"uuidv7\");\n\t\t\treturn refused(`uuid: version must be ${UUID_VERSIONS.v4} or ${UUID_VERSIONS.v7}, got ${String(version)}`);\n\t\t},\n\t\tprintArguments: (generator) => {\n\t\t\tif (generator.id === \"uuidv4\") return {\n\t\t\t\targs: {},\n\t\t\t\ttext: \"\"\n\t\t\t};\n\t\t\tif (generator.id === \"uuidv7\") return {\n\t\t\t\targs: { version: UUID_VERSIONS.v7 },\n\t\t\t\ttext: String(UUID_VERSIONS.v7)\n\t\t\t};\n\t\t}\n\t};\n}\nfunction cuidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"cuid2\"],\n\t\tresolve: ({ args }) => {\n\t\t\tconst version = args[\"version\"];\n\t\t\treturn version === CUID_VERSION ? generated(\"cuid2\") : refused(`cuid: version must be ${CUID_VERSION}, got ${String(version)}`);\n\t\t},\n\t\tprintArguments: (generator) => generator.id === \"cuid2\" ? {\n\t\t\targs: { version: CUID_VERSION },\n\t\t\ttext: String(CUID_VERSION)\n\t\t} : void 0\n\t};\n}\nfunction isNanoidSize(size) {\n\treturn typeof size === \"number\" && Number.isInteger(size) && size >= NANOID_SIZE.min && size <= NANOID_SIZE.max;\n}\n/**\n* A Nano ID has the size the call gives, or 21; the column's length never sets it. A shorter identifier in a fixed-length column is padded by the database, as Prisma 7 does.\n*/\nfunction nanoidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"nanoid\"],\n\t\tresolve: ({ args }) => {\n\t\t\tconst explicit = args[\"size\"];\n\t\t\tif (explicit !== void 0 && !isNanoidSize(explicit)) return refused(`nanoid: size must be between ${NANOID_SIZE.min} and ${NANOID_SIZE.max}, got ${String(explicit)}`);\n\t\t\treturn explicit === void 0 ? generated(\"nanoid\") : generated(\"nanoid\", { size: explicit });\n\t\t},\n\t\tprintArguments: (generator) => {\n\t\t\tif (generator.id !== \"nanoid\") return void 0;\n\t\t\tconst size = generator.params?.[\"size\"];\n\t\t\treturn typeof size === \"number\" ? {\n\t\t\t\targs: { size },\n\t\t\t\ttext: String(size)\n\t\t\t} : {\n\t\t\t\targs: {},\n\t\t\t\ttext: \"\"\n\t\t\t};\n\t\t}\n\t};\n}\n/**\n* `binding`, refusing a column whose length, in its data type's normal form, is shorter than the identifier the generator writes. The database would refuse every insert of a longer value.\n*/\nfunction fittingColumn(name, binding) {\n\treturn {\n\t\t...binding,\n\t\tresolve: (input) => {\n\t\t\tconst resolution = binding.resolve(input);\n\t\t\tconst length = input.field.length;\n\t\t\tif (!resolution.ok || length === void 0) return resolution;\n\t\t\tconst { generator } = resolution;\n\t\t\tconst written = generatedLength(blindCast(generator.id), generator.params);\n\t\t\tif (written <= length) return resolution;\n\t\t\treturn refused(`${`${name}(${binding.printArguments(generator, input.field)?.text ?? \"\"})`} writes ${written} characters, which does not fit a column of ${length} ${length === 1 ? \"character\" : \"characters\"}.`);\n\t\t}\n\t};\n}\n/** The identifier generator functions bound to a target's text codecs, and `uuid` to its uuid codecs. Each refuses a column too short for what it writes. */\nfunction idGeneratorFunctionBindings(codecs) {\n\tconst { text } = codecs;\n\treturn [\n\t\t{\n\t\t\tname: \"uuid\",\n\t\t\tbindings: [fittingColumn(\"uuid\", uuidBinding([...text, ...codecs.uuid ?? []]))]\n\t\t},\n\t\t{\n\t\t\tname: \"cuid\",\n\t\t\tbindings: [fittingColumn(\"cuid\", cuidBinding(text))]\n\t\t},\n\t\t{\n\t\t\tname: \"ulid\",\n\t\t\tbindings: [fittingColumn(\"ulid\", singleGeneratorBinding({\n\t\t\t\tcodecIds: text,\n\t\t\t\tgeneratorId: \"ulid\"\n\t\t\t}))]\n\t\t},\n\t\t{\n\t\t\tname: \"ksuid\",\n\t\t\tbindings: [fittingColumn(\"ksuid\", singleGeneratorBinding({\n\t\t\t\tcodecIds: text,\n\t\t\t\tgeneratorId: \"ksuid\"\n\t\t\t}))]\n\t\t},\n\t\t{\n\t\t\tname: \"nanoid\",\n\t\t\tbindings: [fittingColumn(\"nanoid\", nanoidBinding(text))]\n\t\t}\n\t];\n}\nconst familyIdBindings = idGeneratorFunctionBindings({ text: [\n\tSQL_CHAR_CODEC_ID,\n\tSQL_VARCHAR_CODEC_ID,\n\tSQL_TEXT_CODEC_ID\n] });\nfunction familyBindingsOf(name) {\n\treturn familyIdBindings.find((contribution) => contribution.name === name)?.bindings ?? [];\n}\n/** The generator functions the SQL family declares, with their bindings to the family's codecs. Targets bind `now` and their own codecs. */\nconst sqlFamilyGeneratorFunctions = [\n\t{\n\t\tname: \"now\",\n\t\tsignature: nowSignature,\n\t\tbindings: []\n\t},\n\t{\n\t\tname: \"uuid\",\n\t\tbindings: familyBindingsOf(\"uuid\")\n\t},\n\t{\n\t\tname: \"cuid\",\n\t\tbindings: familyBindingsOf(\"cuid\")\n\t},\n\t{\n\t\tname: \"ulid\",\n\t\tsignature: ulidSignature,\n\t\tbindings: familyBindingsOf(\"ulid\")\n\t},\n\t{\n\t\tname: \"nanoid\",\n\t\tbindings: familyBindingsOf(\"nanoid\")\n\t},\n\t{\n\t\tname: \"ksuid\",\n\t\tsignature: ksuidSignature,\n\t\tbindings: familyBindingsOf(\"ksuid\")\n\t}\n];\n/** The identifier generators the family's bindings produce, which the family registers so that a target binding them through `idGeneratorFunctionBindings` registers none. */\nconst sqlFamilyGeneratorDescriptors = [...new Set(sqlFamilyGeneratorFunctions.flatMap(({ bindings }) => bindings.flatMap(({ generatorIds }) => generatorIds)))].map((id) => ({ id }));\n/**\n* The generator functions whose arguments are integers, declared with their signatures: `uuid(version?)`, `cuid(version)` and `nanoid(size?)`. Each argument is a value of `integer`, the target's integer data type, read and cast like a default, then checked by its function. A target declares them, because only it knows its integer type; the family and the target bind them.\n*/\nfunction sqlIntegerArgumentGeneratorFunctions({ integer }) {\n\treturn [\n\t\t{\n\t\t\tname: \"uuid\",\n\t\t\tsignature: (dataTypes) => uuidSignature(integer, dataTypes),\n\t\t\tbindings: []\n\t\t},\n\t\t{\n\t\t\tname: \"cuid\",\n\t\t\tsignature: (dataTypes) => cuidSignature(integer, dataTypes),\n\t\t\tbindings: []\n\t\t},\n\t\t{\n\t\t\tname: \"nanoid\",\n\t\t\tsignature: (dataTypes) => nanoidSignature(integer, dataTypes),\n\t\t\tbindings: []\n\t\t}\n\t];\n}\nfunction uuidSignature(integer, dataTypes) {\n\tconst versions = [UUID_VERSIONS.v4, UUID_VERSIONS.v7];\n\treturn {\n\t\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\t\tpositional: [{\n\t\t\tkey: \"version\",\n\t\t\ttype: optional(checkedInteger(integer, dataTypes, listed(versions), (version, written) => versions.some((allowed) => allowed === version) ? void 0 : `uuid: version must be ${UUID_VERSIONS.v4} or ${UUID_VERSIONS.v7}, got ${written}`)),\n\t\t\tdocumentation: `The UUID version: \\`${UUID_VERSIONS.v4}\\` or \\`${UUID_VERSIONS.v7}\\`. Defaults to \\`${UUID_VERSIONS.v4}\\`.`\n\t\t}]\n\t};\n}\nfunction cuidSignature(integer, dataTypes) {\n\treturn {\n\t\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\t\tpositional: [{\n\t\t\tkey: \"version\",\n\t\t\ttype: checkedInteger(integer, dataTypes, listed([CUID_VERSION]), (version, written) => version === CUID_VERSION ? void 0 : `cuid: version must be ${CUID_VERSION}, got ${written}`),\n\t\t\tdocumentation: `The CUID version. Only \\`${CUID_VERSION}\\` is supported.`\n\t\t}]\n\t};\n}\nfunction nanoidSignature(integer, dataTypes) {\n\treturn {\n\t\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\t\tpositional: [{\n\t\t\tkey: \"size\",\n\t\t\ttype: optional(checkedInteger(integer, dataTypes, {\n\t\t\t\tlabel: `integer from ${NANOID_SIZE.min} to ${NANOID_SIZE.max}`,\n\t\t\t\tsuggestions: []\n\t\t\t}, (size, written) => isNanoidSize(size) ? void 0 : `nanoid: size must be between ${NANOID_SIZE.min} and ${NANOID_SIZE.max}, got ${written}`)),\n\t\t\tdocumentation: `The identifier length, from \\`${NANOID_SIZE.min}\\` through \\`${NANOID_SIZE.max}\\`. Defaults to ${NANOID_DEFAULT_SIZE}.`\n\t\t}]\n\t};\n}\n/** The completion suggestions of an argument that takes one of `values`, which its label lists. */\nfunction listed(values) {\n\treturn {\n\t\tsuggestions: values.map(String),\n\t\tlabelIsUnion: true\n\t};\n}\n/**\n* One value of the integer data type, as a number, refused at the argument with the function's message when `refusal` returns one.\n*/\nfunction checkedInteger(integer, dataTypes, allowed, refusal) {\n\treturn refineArg(dataTypeValue(integer, dataTypes, allowed), ({ value }, arg, ctx) => {\n\t\tconst stored = value.value;\n\t\tif (typeof stored !== \"number\" && typeof stored !== \"string\") throw new InternalError(`Data type \"${integer}\" stores an integer as ${typeof stored}, not a number or digit text.`);\n\t\tconst message = refusal(Number(stored), String(stored));\n\t\treturn message === void 0 ? ok(blindCast(Number(stored))) : notOk([leafDiagnostic(ctx, arg, message, \"PSL_INVALID_GENERATOR_ARGUMENT\")]);\n\t});\n}\n//#endregion\nexport { sqlFamilyAuthoringTypes as a, sqlFamilyPslBlockDescriptors as c, sqlIntegerArgumentGeneratorFunctions as i, sqlFamilyGeneratorDescriptors as n, sqlTargetTypeConstructors as o, sqlFamilyGeneratorFunctions as r, sqlFamilyEntityTypes as s, idGeneratorFunctionBindings as t };\n\n//# sourceMappingURL=generator-functions-Hy4pDDr9.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oBAAoB;CAC5B,OAAO,SAAS;EACf,OAAO;GACN,MAAM,gBAAgB;GACtB,eAAe;EAChB;EACA,WAAW;CACZ,CAAC;AACF;AACA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WA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Y,OAAO,WAAW,UAAU,MAAM,IAAI,cAAc,cAAc,QAAQ,yBAAyB,OAAO,OAAO,8BAA8B;EACjL,MAAM,UAAU,QAAQ,OAAO,MAAM,GAAG,OAAO,MAAM,CAAC;EACtD,OAAO,YAAY,KAAK,IAAI,GAAG,UAAU,OAAO,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,eAAe,KAAK,KAAK,SAAS,gCAAgC,CAAC,CAAC;CACxI,CAAC;AACF"}
1
+ {"version":3,"file":"generator-functions-Hy4pDDr9-CMfJOBtv.mjs","names":[],"sources":["../../../../2-sql-family/9-family/dist/generator-functions-Hy4pDDr9.mjs"],"sourcesContent":["import { readEnumBlockMembers, resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { enumRefusalOf, requiredParamKeys } from \"@internal/framework-components/codec\";\nimport { blockAttribute, dataTypeValue, enumMemberValue, leafDiagnostic, mapBlock, optional, refineArg, str } from \"@internal/psl-parser\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\nimport { generatedIdColumnAliases } from \"@internal/sql-contract/generated-id-column-aliases\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { CUID_VERSION, NANOID_SIZE, UUID_VERSIONS, generatedLength } from \"@internal/ids\";\nimport { SQL_CHAR_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/sql-relational-core/ast\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/core/authoring-entity-types.ts\nfunction sqlFamilyEnumSpec() {\n\treturn mapBlock({\n\t\tvalue: {\n\t\t\ttype: enumMemberValue(),\n\t\t\tdocumentation: \"The member's value, written as a value of the enum's data type; a bare member stores its own name.\"\n\t\t},\n\t\tallowBare: true\n\t});\n}\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst descriptor = ctx.codecLookup.descriptorFor(codecId);\n\t\tconst codec = ctx.codecLookup.get(codecId);\n\t\tif (descriptor === void 0 || codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst enumRefusal = enumRefusalOf(descriptor);\n\t\tif (enumRefusal !== void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" cannot use the codec \"${codecId}\". ${enumRefusal}`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst dataType = ctx.dataTypes.lookup.get(descriptor.dataType);\n\t\tif (dataType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" represents data type \"${descriptor.dataType}\", which no component registers`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst [requiredParam] = requiredParamKeys(dataType);\n\t\tif (requiredParam !== void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_TYPE_NEEDS_PARAMETERS\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" represents data type \"${dataType.id}\", which requires the parameter \"${requiredParam}\"; an enum block gives it none`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst members = readEnumBlockMembers(block, codecId, codec, ctx);\n\t\tif (members === void 0) return void 0;\n\t\treturn enumType(block.name, { codecId }, ...members);\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tspec: sqlFamilyEnumSpec,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\n//#region src/core/authoring-types.ts\nconst sqlFamilyAuthoringTypes = {\n\tRaw: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A column of a type no other column type covers, written exactly as the database catalog prints it, such as Raw(sql`tsvector`). Its values are typed unknown, and its default is a sql expression.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: \"sql/expression\",\n\t\t\tname: \"sql\"\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/raw@1\",\n\t\t\ttypeParams: { sql: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tsql: generatedIdColumnAliases\n};\n/**\n* The type constructors every SQL target contributes itself, because their arguments are sizes, such as a length, and only the target names the data type a size is a value of: `sizeType`, such as `pg/int4`.\n*/\nfunction sqlTargetTypeConstructors(input) {\n\treturn { sql: {\n\t\tString: {\n\t\t\tkind: \"typeConstructor\",\n\t\t\tdocumentation: \"Variable-length text with a required maximum character length.\",\n\t\t\targs: [{\n\t\t\t\tkind: \"value\",\n\t\t\t\tdataType: input.sizeType,\n\t\t\t\tname: \"length\"\n\t\t\t}],\n\t\t\toutput: {\n\t\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t} }\n\t\t\t}\n\t\t},\n\t\tChar: {\n\t\t\tkind: \"typeConstructor\",\n\t\t\tdocumentation: \"Fixed-length text with a required character length.\",\n\t\t\targs: [{\n\t\t\t\tkind: \"value\",\n\t\t\t\tdataType: input.sizeType,\n\t\t\t\tname: \"length\"\n\t\t\t}],\n\t\t\toutput: {\n\t\t\t\tcodecId: \"sql/char@1\",\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t} }\n\t\t\t}\n\t\t}\n\t} };\n}\n//#endregion\n//#region src/core/generator-functions.ts\nconst NANOID_DEFAULT_SIZE = 21;\nconst nowSignature = { documentation: \"Writes the current time, as the column's codec represents it.\" };\nconst ulidSignature = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst ksuidSignature = { documentation: \"Generates a KSUID when a value is not supplied.\" };\nfunction refused(message) {\n\treturn {\n\t\tok: false,\n\t\tmessage\n\t};\n}\nfunction generated(id, params) {\n\treturn {\n\t\tok: true,\n\t\tgenerator: params === void 0 ? {\n\t\t\tkind: \"generator\",\n\t\t\tid\n\t\t} : {\n\t\t\tkind: \"generator\",\n\t\t\tid,\n\t\t\tparams\n\t\t}\n\t};\n}\nfunction uuidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"uuidv4\", \"uuidv7\"],\n\t\tresolve: ({ args }) => {\n\t\t\tconst version = args[\"version\"];\n\t\t\tif (version === void 0 || version === UUID_VERSIONS.v4) return generated(\"uuidv4\");\n\t\t\tif (version === UUID_VERSIONS.v7) return generated(\"uuidv7\");\n\t\t\treturn refused(`uuid: version must be ${UUID_VERSIONS.v4} or ${UUID_VERSIONS.v7}, got ${String(version)}`);\n\t\t},\n\t\tprintArguments: (generator) => {\n\t\t\tif (generator.id === \"uuidv4\") return {\n\t\t\t\targs: {},\n\t\t\t\ttext: \"\"\n\t\t\t};\n\t\t\tif (generator.id === \"uuidv7\") return {\n\t\t\t\targs: { version: UUID_VERSIONS.v7 },\n\t\t\t\ttext: String(UUID_VERSIONS.v7)\n\t\t\t};\n\t\t}\n\t};\n}\nfunction cuidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"cuid2\"],\n\t\tresolve: ({ args }) => {\n\t\t\tconst version = args[\"version\"];\n\t\t\treturn version === CUID_VERSION ? generated(\"cuid2\") : refused(`cuid: version must be ${CUID_VERSION}, got ${String(version)}`);\n\t\t},\n\t\tprintArguments: (generator) => generator.id === \"cuid2\" ? {\n\t\t\targs: { version: CUID_VERSION },\n\t\t\ttext: String(CUID_VERSION)\n\t\t} : void 0\n\t};\n}\nfunction isNanoidSize(size) {\n\treturn typeof size === \"number\" && Number.isInteger(size) && size >= NANOID_SIZE.min && size <= NANOID_SIZE.max;\n}\n/**\n* A Nano ID has the size the call gives, or 21; the column's length never sets it. A shorter identifier in a fixed-length column is padded by the database, as Prisma 7 does.\n*/\nfunction nanoidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"nanoid\"],\n\t\tresolve: ({ args }) => {\n\t\t\tconst explicit = args[\"size\"];\n\t\t\tif (explicit !== void 0 && !isNanoidSize(explicit)) return refused(`nanoid: size must be between ${NANOID_SIZE.min} and ${NANOID_SIZE.max}, got ${String(explicit)}`);\n\t\t\treturn explicit === void 0 ? generated(\"nanoid\") : generated(\"nanoid\", { size: explicit });\n\t\t},\n\t\tprintArguments: (generator) => {\n\t\t\tif (generator.id !== \"nanoid\") return void 0;\n\t\t\tconst size = generator.params?.[\"size\"];\n\t\t\treturn typeof size === \"number\" ? {\n\t\t\t\targs: { size },\n\t\t\t\ttext: String(size)\n\t\t\t} : {\n\t\t\t\targs: {},\n\t\t\t\ttext: \"\"\n\t\t\t};\n\t\t}\n\t};\n}\n/**\n* `binding`, refusing a column whose length, in its data type's normal form, is shorter than the identifier the generator writes. The database would refuse every insert of a longer value.\n*/\nfunction fittingColumn(name, binding) {\n\treturn {\n\t\t...binding,\n\t\tresolve: (input) => {\n\t\t\tconst resolution = binding.resolve(input);\n\t\t\tconst length = input.field.length;\n\t\t\tif (!resolution.ok || length === void 0) return resolution;\n\t\t\tconst { generator } = resolution;\n\t\t\tconst written = generatedLength(blindCast(generator.id), generator.params);\n\t\t\tif (written <= length) return resolution;\n\t\t\treturn refused(`${`${name}(${binding.printArguments(generator, input.field)?.text ?? \"\"})`} writes ${written} characters, which does not fit a column of ${length} ${length === 1 ? \"character\" : \"characters\"}.`);\n\t\t}\n\t};\n}\n/** The identifier generator functions bound to a target's text codecs, and `uuid` to its uuid codecs. Each refuses a column too short for what it writes. */\nfunction idGeneratorFunctionBindings(codecs) {\n\tconst { text } = codecs;\n\treturn [\n\t\t{\n\t\t\tname: \"uuid\",\n\t\t\tbindings: [fittingColumn(\"uuid\", uuidBinding([...text, ...codecs.uuid ?? []]))]\n\t\t},\n\t\t{\n\t\t\tname: \"cuid\",\n\t\t\tbindings: [fittingColumn(\"cuid\", cuidBinding(text))]\n\t\t},\n\t\t{\n\t\t\tname: \"ulid\",\n\t\t\tbindings: [fittingColumn(\"ulid\", singleGeneratorBinding({\n\t\t\t\tcodecIds: text,\n\t\t\t\tgeneratorId: \"ulid\"\n\t\t\t}))]\n\t\t},\n\t\t{\n\t\t\tname: \"ksuid\",\n\t\t\tbindings: [fittingColumn(\"ksuid\", singleGeneratorBinding({\n\t\t\t\tcodecIds: text,\n\t\t\t\tgeneratorId: \"ksuid\"\n\t\t\t}))]\n\t\t},\n\t\t{\n\t\t\tname: \"nanoid\",\n\t\t\tbindings: [fittingColumn(\"nanoid\", nanoidBinding(text))]\n\t\t}\n\t];\n}\nconst familyIdBindings = idGeneratorFunctionBindings({ text: [\n\tSQL_CHAR_CODEC_ID,\n\tSQL_VARCHAR_CODEC_ID,\n\tSQL_TEXT_CODEC_ID\n] });\nfunction familyBindingsOf(name) {\n\treturn familyIdBindings.find((contribution) => contribution.name === name)?.bindings ?? [];\n}\n/** The generator functions the SQL family declares, with their bindings to the family's codecs. Targets bind `now` and their own codecs. */\nconst sqlFamilyGeneratorFunctions = [\n\t{\n\t\tname: \"now\",\n\t\tsignature: nowSignature,\n\t\tbindings: []\n\t},\n\t{\n\t\tname: \"uuid\",\n\t\tbindings: familyBindingsOf(\"uuid\")\n\t},\n\t{\n\t\tname: \"cuid\",\n\t\tbindings: familyBindingsOf(\"cuid\")\n\t},\n\t{\n\t\tname: \"ulid\",\n\t\tsignature: ulidSignature,\n\t\tbindings: familyBindingsOf(\"ulid\")\n\t},\n\t{\n\t\tname: \"nanoid\",\n\t\tbindings: familyBindingsOf(\"nanoid\")\n\t},\n\t{\n\t\tname: \"ksuid\",\n\t\tsignature: ksuidSignature,\n\t\tbindings: familyBindingsOf(\"ksuid\")\n\t}\n];\n/** The identifier generators the family's bindings produce, which the family registers so that a target binding them through `idGeneratorFunctionBindings` registers none. */\nconst sqlFamilyGeneratorDescriptors = [...new Set(sqlFamilyGeneratorFunctions.flatMap(({ bindings }) => bindings.flatMap(({ generatorIds }) => generatorIds)))].map((id) => ({ id }));\n/**\n* The generator functions whose arguments are integers, declared with their signatures: `uuid(version?)`, `cuid(version)` and `nanoid(size?)`. Each argument is a value of `integer`, the target's integer data type, read and cast like a default, then checked by its function. A target declares them, because only it knows its integer type; the family and the target bind them.\n*/\nfunction sqlIntegerArgumentGeneratorFunctions({ integer }) {\n\treturn [\n\t\t{\n\t\t\tname: \"uuid\",\n\t\t\tsignature: (dataTypes) => uuidSignature(integer, dataTypes),\n\t\t\tbindings: []\n\t\t},\n\t\t{\n\t\t\tname: \"cuid\",\n\t\t\tsignature: (dataTypes) => cuidSignature(integer, dataTypes),\n\t\t\tbindings: []\n\t\t},\n\t\t{\n\t\t\tname: \"nanoid\",\n\t\t\tsignature: (dataTypes) => nanoidSignature(integer, dataTypes),\n\t\t\tbindings: []\n\t\t}\n\t];\n}\nfunction uuidSignature(integer, dataTypes) {\n\tconst versions = [UUID_VERSIONS.v4, UUID_VERSIONS.v7];\n\treturn {\n\t\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\t\tpositional: [{\n\t\t\tkey: \"version\",\n\t\t\ttype: optional(checkedInteger(integer, dataTypes, listed(versions), (version, written) => versions.some((allowed) => allowed === version) ? void 0 : `uuid: version must be ${UUID_VERSIONS.v4} or ${UUID_VERSIONS.v7}, got ${written}`)),\n\t\t\tdocumentation: `The UUID version: \\`${UUID_VERSIONS.v4}\\` or \\`${UUID_VERSIONS.v7}\\`. Defaults to \\`${UUID_VERSIONS.v4}\\`.`\n\t\t}]\n\t};\n}\nfunction cuidSignature(integer, dataTypes) {\n\treturn {\n\t\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\t\tpositional: [{\n\t\t\tkey: \"version\",\n\t\t\ttype: checkedInteger(integer, dataTypes, listed([CUID_VERSION]), (version, written) => version === CUID_VERSION ? void 0 : `cuid: version must be ${CUID_VERSION}, got ${written}`),\n\t\t\tdocumentation: `The CUID version. Only \\`${CUID_VERSION}\\` is supported.`\n\t\t}]\n\t};\n}\nfunction nanoidSignature(integer, dataTypes) {\n\treturn {\n\t\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\t\tpositional: [{\n\t\t\tkey: \"size\",\n\t\t\ttype: optional(checkedInteger(integer, dataTypes, {\n\t\t\t\tlabel: `integer from ${NANOID_SIZE.min} to ${NANOID_SIZE.max}`,\n\t\t\t\tsuggestions: []\n\t\t\t}, (size, written) => isNanoidSize(size) ? void 0 : `nanoid: size must be between ${NANOID_SIZE.min} and ${NANOID_SIZE.max}, got ${written}`)),\n\t\t\tdocumentation: `The identifier length, from \\`${NANOID_SIZE.min}\\` through \\`${NANOID_SIZE.max}\\`. Defaults to ${NANOID_DEFAULT_SIZE}.`\n\t\t}]\n\t};\n}\n/** The completion suggestions of an argument that takes one of `values`, which its label lists. */\nfunction listed(values) {\n\treturn {\n\t\tsuggestions: values.map(String),\n\t\tlabelIsUnion: true\n\t};\n}\n/**\n* One value of the integer data type, as a number, refused at the argument with the function's message when `refusal` returns one.\n*/\nfunction checkedInteger(integer, dataTypes, allowed, refusal) {\n\treturn refineArg(dataTypeValue(integer, dataTypes, allowed), ({ value }, arg, ctx) => {\n\t\tconst stored = value.value;\n\t\tif (typeof stored !== \"number\" && typeof stored !== \"string\") throw new InternalError(`Data type \"${integer}\" stores an integer as ${typeof stored}, not a number or digit text.`);\n\t\tconst message = refusal(Number(stored), String(stored));\n\t\treturn message === void 0 ? ok(blindCast(Number(stored))) : notOk([leafDiagnostic(ctx, arg, message, \"PSL_INVALID_GENERATOR_ARGUMENT\")]);\n\t});\n}\n//#endregion\nexport { sqlFamilyAuthoringTypes as a, sqlFamilyPslBlockDescriptors as c, sqlIntegerArgumentGeneratorFunctions as i, sqlFamilyGeneratorDescriptors as n, sqlTargetTypeConstructors as o, sqlFamilyGeneratorFunctions as r, sqlFamilyEntityTypes as s, idGeneratorFunctionBindings as t };\n\n//# sourceMappingURL=generator-functions-Hy4pDDr9.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oBAAoB;CAC5B,OAAO,SAAS;EACf,OAAO;GACN,MAAM,gBAAgB;GACtB,eAAe;EAChB;EACA,WAAW;CACZ,CAAC;AACF;AACA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,aAAa,IAAI,YAAY,cAAc,OAAO;EACxD,MAAM,QAAQ,IAAI,YAAY,IAAI,O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AAC,eAAe,KAAK,KAAK,SAAS,gCAAgC,CAAC,CAAC;CACxI,CAAC;AACF"}
@@ -1,12 +1,12 @@
1
1
  import { n as isAuthoredIndexInput } from "./index-naming-BOcJT1B3-D-49owHA.mjs";
2
- import { u as sqlCodecColumnLength } from "./sql-data-type-D7M-YTTY-D2vRqDxn.mjs";
2
+ import { u as sqlCodecColumnLength } from "./sql-data-type-LVBldu1a-Bq203xWX.mjs";
3
3
  import { n as providesPslEntityPlacement } from "./entity-handle-lowering-hook-BJZSlVVF.mjs";
4
4
  import "./foreign-key-materialization-CCHAR789.mjs";
5
5
  import { p as sqlTextFromStored } from "./sql-expression-CKgKznXS.mjs";
6
6
  import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-HVaxhALD.mjs";
7
- import { n as buildSqlContractFromDefinition } from "./derived-checks-BuTkSE9l-gyx0d0dX.mjs";
7
+ import { n as buildSqlContractFromDefinition } from "./derived-checks-D__agoFB-Boa1MHcA.mjs";
8
8
  import { i as mapFieldNamesToColumns, n as getAttribute, o as storageName, r as getNamedArgument, t as formatDbAttributeMigrationMessage } from "./psl-attribute-parsing-BCsFWsSp-BJ-wGlY6.mjs";
9
- import { _ as modelSpecContext, b as sqlAttributeSpecs, d as interpretModelAttribute, f as lowerEnumDefault, g as modelCoordinateKey, h as modelAttributeSpecsFrom, l as instantiatePslTypeConstructor, m as lowerTypeGenerators, n as collectResolvedFields, o as fieldSpecContext, p as lowerTypeDefault, r as contractError, s as getAuthoringEntity, t as PSL_CHECK_ON_STI_VARIANT, u as interpretFieldAttribute, y as resolveFieldTypeDescriptor } from "./psl-field-resolution-Bvhx79fP-CuyYFk8z.mjs";
9
+ import { _ as modelSpecContext, b as sqlAttributeSpecs, d as interpretModelAttribute, f as lowerEnumDefault, g as modelCoordinateKey, h as modelAttributeSpecsFrom, l as instantiatePslTypeConstructor, m as lowerTypeGenerators, n as collectResolvedFields, o as fieldSpecContext, p as lowerTypeDefault, r as contractError, s as getAuthoringEntity, t as PSL_CHECK_ON_STI_VARIANT, u as interpretFieldAttribute, y as resolveFieldTypeDescriptor } from "./psl-field-resolution-BW2_FOb9-DxqR43fo.mjs";
10
10
  import { t as defaultTableName } from "./default-table-name-BfFY8qYR-CWZFDX6v.mjs";
11
11
  import { t as compareStrings } from "./compare-strings-BVf3BgCV-CefXnrMB.mjs";
12
12
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
@@ -21,14 +21,24 @@ import { NamespaceDeclarationAst } from "@prisma/orm-framework/psl-parser/syntax
21
21
  import { resolveToOneRelationNullable } from "@prisma/orm-framework/contract-authoring";
22
22
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
23
23
  import { contributedTypeAliasOf, createPslDiagnosticCollector, diagnosticSource, findBlockDescriptor, interpretExtensionBlocks, nodePslSpan, resolveTypeAliases, typeAliasAttributeNames, typeAliasSpecContext, typeReferenceNode } from "@prisma/orm-framework/psl-parser";
24
- import { claimedBlockKeywords, enumMemberAttributeDiagnostics, fkRelationPairKey, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic } from "@prisma/orm-framework/psl-parser/interpret";
25
- //#region ../../../2-sql-family/2-authoring/contract-psl/dist/interpreter-CrQFtK4p.mjs
24
+ import { claimedBlockKeywords, enumMemberAttributeDiagnostics, fkRelationPairKey, instantiatePslTypeChoice, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic } from "@prisma/orm-framework/psl-parser/interpret";
25
+ //#region ../../../2-sql-family/2-authoring/contract-psl/dist/interpreter-ChvVEijY.mjs
26
26
  function describeUnsupportedSqlAliasAttribute(attribute) {
27
27
  return attribute.name.startsWith("db.") ? formatDbAttributeMigrationMessage(attribute) : void 0;
28
28
  }
29
29
  function aliasDescriptor(alias, input) {
30
30
  const { base, symbol } = alias;
31
31
  const source = diagnosticSource(input.sources, symbol.node.syntax);
32
+ if (base.kind === "typeChoice") return instantiatePslTypeChoice({
33
+ symbol: base.symbol,
34
+ call: base.call,
35
+ span: symbol.span,
36
+ codecLookup: input.codecLookup,
37
+ diagnostics: input.diagnostics,
38
+ source,
39
+ entityLabel: `Type alias "${symbol.name}"`,
40
+ dataTypes: input.dataTypes
41
+ });
32
42
  if (base.kind === "typeConstructor") {
33
43
  if (base.call === void 0) return instantiateAuthoringTypeConstructor(base.descriptor, []);
34
44
  return instantiatePslTypeConstructor({
@@ -2317,4 +2327,4 @@ function interpretPslDocumentToSqlContract(input) {
2317
2327
  //#endregion
2318
2328
  export { normalizeReferentialAction as a, interpretPslDocumentToSqlContract as i, buildEntityTypesByDiscriminator as n, indexFkRelations as r, applyBackrelationCandidates as t };
2319
2329
 
2320
- //# sourceMappingURL=interpreter-CrQFtK4p-CM5k_t4g.mjs.map
2330
+ //# sourceMappingURL=interpreter-ChvVEijY-FeJngsog.mjs.map