@prisma/orm-family-sql 8.0.0-rc.15-dev.1 → 8.0.0-rc.15-dev.3

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 (75) hide show
  1. package/dist/{authoring-type-constructors-dihiQslc-DqtjQyqj.mjs → authoring-type-constructors-dihiQslc-B5nYi7p2.mjs} +2 -2
  2. package/dist/{authoring-type-constructors-dihiQslc-DqtjQyqj.mjs.map → authoring-type-constructors-dihiQslc-B5nYi7p2.mjs.map} +1 -1
  3. package/dist/{config-types-CPTtyHK8.mjs → config-types-BMRDvgSW.mjs} +2 -2
  4. package/dist/{config-types-CPTtyHK8.mjs.map → config-types-BMRDvgSW.mjs.map} +1 -1
  5. package/dist/{contract-builder-Dy172HD2.mjs → contract-builder-83EIkQrg.mjs} +8 -8
  6. package/dist/{contract-builder-Dy172HD2.mjs.map → contract-builder-83EIkQrg.mjs.map} +1 -1
  7. package/dist/contract-prisma7__provider.mjs +23 -17
  8. package/dist/contract-prisma7__provider.mjs.map +1 -1
  9. package/dist/contract-psl.d.mts +6 -6
  10. package/dist/contract-psl.d.mts.map +1 -1
  11. package/dist/contract-psl.mjs +1 -1
  12. package/dist/contract-psl__attribute-specs.d.mts +2 -3
  13. package/dist/contract-psl__attribute-specs.d.mts.map +1 -1
  14. package/dist/contract-psl__attribute-specs.mjs +1 -1
  15. package/dist/contract-psl__provider.mjs +3 -3
  16. package/dist/contract-psl__provider.mjs.map +1 -1
  17. package/dist/contract-ts.mjs +3 -3
  18. package/dist/contract-ts__config-types.mjs +1 -1
  19. package/dist/contract-ts__contract-builder.mjs +2 -2
  20. package/dist/contract.d.mts +3 -3
  21. package/dist/contract.mjs +3 -3
  22. package/dist/contract__data-type-support.d.mts +2 -2
  23. package/dist/contract__data-type-support.mjs +2 -2
  24. package/dist/contract__validators.d.mts +2 -2
  25. package/dist/contract__validators.mjs +2 -2
  26. package/dist/{control-D18L8cFa.d.mts → control-Bi2JsNep.d.mts} +6 -6
  27. package/dist/control-Bi2JsNep.d.mts.map +1 -0
  28. package/dist/{control-CMe5ABYI.mjs → control-ihau09EM.mjs} +6 -6
  29. package/dist/control-ihau09EM.mjs.map +1 -0
  30. package/dist/{data-type-support-DoxtCfXq.d.mts → data-type-support-4TcZuD7d.d.mts} +6 -6
  31. package/dist/{data-type-support-DoxtCfXq.d.mts.map → data-type-support-4TcZuD7d.d.mts.map} +1 -1
  32. package/dist/{data-type-support-DeL6iJt8.mjs → data-type-support-Bu-VpT7z.mjs} +7 -7
  33. package/dist/data-type-support-Bu-VpT7z.mjs.map +1 -0
  34. package/dist/{derived-checks-DAbro9yn-DtEowq-J.mjs → derived-checks-DAbro9yn-BgBbql-q.mjs} +2 -2
  35. package/dist/{derived-checks-DAbro9yn-DtEowq-J.mjs.map → derived-checks-DAbro9yn-BgBbql-q.mjs.map} +1 -1
  36. package/dist/family.d.mts +6 -6
  37. package/dist/family.mjs +5 -5
  38. package/dist/family__control.d.mts +3 -3
  39. package/dist/family__control.mjs +3 -3
  40. package/dist/family__ir.mjs +1 -1
  41. package/dist/family__pack.mjs +2 -2
  42. package/dist/family__psl-build.d.mts +2 -2
  43. package/dist/family__psl-build.mjs +1 -1
  44. package/dist/family__psl-infer.d.mts +1 -1
  45. package/dist/{interpreter-D50jf6Dd-BW-Bj8Qr.mjs → interpreter-BF5Xrf3W-DK928Clg.mjs} +14 -20
  46. package/dist/interpreter-BF5Xrf3W-DK928Clg.mjs.map +1 -0
  47. package/dist/{psl-build-C1P-sV0c.mjs → psl-build-B_fRV6lN.mjs} +34 -33
  48. package/dist/psl-build-B_fRV6lN.mjs.map +1 -0
  49. package/dist/{psl-build-ClK2AyY1.d.mts → psl-build-C_n5uPZH.d.mts} +2 -2
  50. package/dist/psl-build-C_n5uPZH.d.mts.map +1 -0
  51. package/dist/{psl-column-resolution-BegCa1-t-1XiYCC7t.d.mts → psl-column-resolution-CNtNJ7g7-CR_auHUV.d.mts} +5 -7
  52. package/dist/psl-column-resolution-CNtNJ7g7-CR_auHUV.d.mts.map +1 -0
  53. package/dist/{psl-field-resolution-Bi-CSeoQ-Do_5hZ8Z.mjs → psl-field-resolution-DUCrDnuq-BXwISml1.mjs} +222 -279
  54. package/dist/psl-field-resolution-DUCrDnuq-BXwISml1.mjs.map +1 -0
  55. package/dist/{psl-infer-B91bSSdN.d.mts → psl-infer-Cm7eDSA-.d.mts} +2 -2
  56. package/dist/{psl-infer-B91bSSdN.d.mts.map → psl-infer-Cm7eDSA-.d.mts.map} +1 -1
  57. package/dist/{sql-contract-serializer-DDaAVCQr-h_U10PEJ.mjs → sql-contract-serializer-DDaAVCQr-D40NltYi.mjs} +2 -2
  58. package/dist/{sql-contract-serializer-DDaAVCQr-h_U10PEJ.mjs.map → sql-contract-serializer-DDaAVCQr-D40NltYi.mjs.map} +1 -1
  59. package/dist/{type-map-dnvRKl9o-avUb9OLv.d.mts → type-map-3w0ieDAb-DiMpKEc2.d.mts} +6 -8
  60. package/dist/type-map-3w0ieDAb-DiMpKEc2.d.mts.map +1 -0
  61. package/dist/{validators-BLkHaNpd.d.mts → validators-BAa0JKuB.d.mts} +7 -7
  62. package/dist/{validators-BLkHaNpd.d.mts.map → validators-BAa0JKuB.d.mts.map} +1 -1
  63. package/dist/{validators-BF_JSK38.mjs → validators-Ddcw8nHL.mjs} +9 -9
  64. package/dist/validators-Ddcw8nHL.mjs.map +1 -0
  65. package/package.json +18 -18
  66. package/dist/control-CMe5ABYI.mjs.map +0 -1
  67. package/dist/control-D18L8cFa.d.mts.map +0 -1
  68. package/dist/data-type-support-DeL6iJt8.mjs.map +0 -1
  69. package/dist/interpreter-D50jf6Dd-BW-Bj8Qr.mjs.map +0 -1
  70. package/dist/psl-build-C1P-sV0c.mjs.map +0 -1
  71. package/dist/psl-build-ClK2AyY1.d.mts.map +0 -1
  72. package/dist/psl-column-resolution-BegCa1-t-1XiYCC7t.d.mts.map +0 -1
  73. package/dist/psl-field-resolution-Bi-CSeoQ-Do_5hZ8Z.mjs.map +0 -1
  74. package/dist/type-map-dnvRKl9o-avUb9OLv.d.mts.map +0 -1
  75. package/dist/validators-BF_JSK38.mjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { d as unquotedSqlBaseNameOfCodec, l as sqlDataTypeOfCodec } from "./data-type-CAPmGXg9.mjs";
2
- import { d as validateSqlStorageConsistency, l as validateModelStorageReferences } from "./validators-BF_JSK38.mjs";
2
+ import { d as validateSqlStorageConsistency, l as validateModelStorageReferences } from "./validators-Ddcw8nHL.mjs";
3
3
  import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
4
- import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-DAbro9yn-DtEowq-J.mjs";
5
- import { d as instantiateFieldTypeConstructor, o as entryForTag, v as readDataTypeDefault } from "./psl-field-resolution-Bi-CSeoQ-Do_5hZ8Z.mjs";
6
- import { a as normalizeReferentialAction, n as buildEntityTypesByDiscriminator, r as indexFkRelations, t as applyBackrelationCandidates } from "./interpreter-D50jf6Dd-BW-Bj8Qr.mjs";
4
+ import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-DAbro9yn-BgBbql-q.mjs";
5
+ import { _ as readDataTypeDefault, u as instantiateFieldTypeConstructor } from "./psl-field-resolution-DUCrDnuq-BXwISml1.mjs";
6
+ import { a as normalizeReferentialAction, n as buildEntityTypesByDiscriminator, r as indexFkRelations, t as applyBackrelationCandidates } from "./interpreter-BF5Xrf3W-DK928Clg.mjs";
7
7
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
8
- import { getAuthoringTypeConstructor, instantiateAuthoringEntityType } from "@prisma/orm-framework/components/authoring";
8
+ import { entryForTag, getAuthoringTypeConstructor, instantiateAuthoringEntityType } from "@prisma/orm-framework/components/authoring";
9
9
  import { blindCast } from "@prisma/orm-framework/utils/casts";
10
10
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
11
11
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
@@ -132,7 +132,7 @@ function scalarValue$1(expression, input, unknown) {
132
132
  typeParams: input.typeParams
133
133
  },
134
134
  codecLookup: input.codecLookup,
135
- support: input.dataTypeSupport,
135
+ dataTypes: input.dataTypes,
136
136
  fieldPath: `${input.modelName}.${input.field.name}`
137
137
  });
138
138
  return read.ok ? read.value : unknown(refusalReason(read.refusal), span);
@@ -218,7 +218,7 @@ function writtenLiteral(expression, input) {
218
218
  * `undefined` when the body is not a document.
219
219
  */
220
220
  function jsonDocumentOf(written, input) {
221
- const entry = entryForTag(input.dataTypeSupport, "json");
221
+ const entry = entryForTag(input.dataTypes, "json");
222
222
  if (entry === void 0 || entry.entry.written.kind !== "tag") return void 0;
223
223
  const bodies = written.kind === "list" ? written.elements.flatMap((element) => element.kind === "tag" ? [element.text] : []) : written.kind === "tag" ? [written.text] : [];
224
224
  const parse = entry.entry.written.parse;
@@ -237,10 +237,15 @@ function refusalReason(refusal) {
237
237
  case "unknown-tag": return `holds a ${refusal.tag} literal${at}, which this stack does not register.`;
238
238
  case "unwritable": return `holds a ${refusal.syntax} value${at}, which this target has no data type for.`;
239
239
  case "not-a-list": return "holds a single value on a list column, which takes a list literal.";
240
- case "no-cast": return `holds a ${refusal.valueType} value${at}, which ${refusal.columnType} has no cast from; ${refusal.casts.length === 0 ? "it casts from nothing" : `it casts from ${refusal.casts.join(", ")}`}.`;
240
+ case "no-cast": return `holds a ${refusal.valueType} value${at}, which ${refusal.receivingType} has no cast from; ${describeCasts(refusal.casts)}.`;
241
+ case "no-list-cast": return `holds a list, which ${refusal.receivingType} has no cast from; ${describeCasts(refusal.casts)}.`;
242
+ case "no-element-cast": return `holds a ${refusal.valueType} value${at}, which the list cast of ${refusal.receivingType} does not take; it takes ${refusal.elementTypes.join(", ")}.`;
241
243
  case "refused-by-codec": return `holds a value${at} that ${refusal.codecId} does not read: ${refusal.message}`;
242
244
  }
243
245
  }
246
+ function describeCasts(casts) {
247
+ return casts.length === 0 ? "it casts from nothing" : `it casts from ${casts.join(", ")}`;
248
+ }
244
249
  function lowerFunction(call, input, label, unknown) {
245
250
  const fn = call.path().join(".");
246
251
  const span = input.attribute.span;
@@ -1197,7 +1202,7 @@ function interpretPrisma7Documents(input) {
1197
1202
  createNamespace,
1198
1203
  ...namespaceEntities.size > 0 ? { namespaces: [...namespaceEntities.keys()] } : {},
1199
1204
  models: modelNodes
1200
- }, input.codecLookup, input.dataTypeLookup));
1205
+ }, input.codecLookup, input.dataTypes.lookup));
1201
1206
  }
1202
1207
  function checkDatasource(datasources, fallbackSourceId, binding, diagnostics) {
1203
1208
  const [datasource] = datasources;
@@ -1359,7 +1364,7 @@ function lowerNativeEnums(enums, input, diagnostics) {
1359
1364
  family: input.binding.target.familyId,
1360
1365
  target: input.binding.target.targetId,
1361
1366
  codecLookup: input.codecLookup,
1362
- dataTypeLookup: input.dataTypeLookup,
1367
+ dataTypeLookup: input.dataTypes.lookup,
1363
1368
  sourceId: declaration.sourceId,
1364
1369
  diagnostics: { push: (diagnostic) => {
1365
1370
  diagnostics.push(blindCast(diagnostic));
@@ -1586,7 +1591,11 @@ function readField(args) {
1586
1591
  });
1587
1592
  diagnostics.push(...typeDiagnostics.toExternal());
1588
1593
  if (!resolved.ok) return;
1589
- const columnTypeName = unquotedSqlBaseNameOfCodec(resolved.descriptor.codecId, resolved.descriptor.typeParams, input);
1594
+ const typeLookups = {
1595
+ codecLookup: input.codecLookup,
1596
+ dataTypeLookup: input.dataTypes.lookup
1597
+ };
1598
+ const columnTypeName = unquotedSqlBaseNameOfCodec(resolved.descriptor.codecId, resolved.descriptor.typeParams, typeLookups);
1590
1599
  const updatedAtGeneratorId = updatedAt === void 0 ? void 0 : binding.updatedAtGeneratorId(resolved.descriptor.codecId);
1591
1600
  if (updatedAt !== void 0 && updatedAtGeneratorId === void 0) {
1592
1601
  const withoutUpdatedAt = defaultAttribute !== void 0 && givesColumnDefault(defaultAttribute) ? `. Its ${attributeText(defaultAttribute)} still sets the value on create, and neither client changes it on update.` : field.optional ? ", but neither client then fills the value, so it stays empty unless a client writes it, and updates leave it unchanged." : ", but neither client then fills the value, so both require it on create and leave it unchanged on update.";
@@ -1605,13 +1614,10 @@ function readField(args) {
1605
1614
  codecId: resolved.descriptor.codecId,
1606
1615
  typeParams: resolved.descriptor.typeParams,
1607
1616
  codecLookup: input.codecLookup,
1608
- dataTypeSupport: {
1609
- entries: input.authoringContributions?.dataTypes ?? {},
1610
- lookup: input.dataTypeLookup
1611
- },
1617
+ dataTypes: input.dataTypes,
1612
1618
  literalForm: binding.literalDefaultForm({
1613
1619
  codecId: resolved.descriptor.codecId,
1614
- dataType: sqlDataTypeOfCodec(resolved.descriptor.codecId, input).id,
1620
+ dataType: sqlDataTypeOfCodec(resolved.descriptor.codecId, typeLookups).id,
1615
1621
  typeParams: resolved.descriptor.typeParams
1616
1622
  }),
1617
1623
  enumMembers: enumDeclaration === void 0 ? void 0 : new Map(enumDeclaration.members.map((member) => [member.name, member.value])),
@@ -1768,7 +1774,7 @@ function prisma7Contract(schemaPath, options) {
1768
1774
  controlMutationDefaults: context.controlMutationDefaults,
1769
1775
  authoringContributions: context.authoringContributions,
1770
1776
  codecLookup: context.codecLookup,
1771
- dataTypeLookup: context.dataTypeLookup,
1777
+ dataTypes: context.dataTypes,
1772
1778
  composedExtensions: context.composedExtensions
1773
1779
  });
1774
1780
  if (!interpreted.ok) return interpreted;