@prisma/orm-family-sql 8.0.0-rc.11-dev.38 → 8.0.0-rc.11-dev.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{authored-check-naming-BEvfamnI.mjs → authored-check-naming-9UFx77db.mjs} +2 -2
- package/dist/{authored-check-naming-BEvfamnI.mjs.map → authored-check-naming-9UFx77db.mjs.map} +1 -1
- package/dist/{authoring-type-constructors-C1ogrr_x-BbEHaj9p.mjs → authoring-type-constructors-C1ogrr_x-BeSS93gc.mjs} +2 -2
- package/dist/{authoring-type-constructors-C1ogrr_x-BbEHaj9p.mjs.map → authoring-type-constructors-C1ogrr_x-BeSS93gc.mjs.map} +1 -1
- package/dist/{config-types-BZyzSC1w.mjs → config-types-B98UYjF0.mjs} +2 -2
- package/dist/{config-types-BZyzSC1w.mjs.map → config-types-B98UYjF0.mjs.map} +1 -1
- package/dist/{contract-builder-BVjdRPs_.d.mts → contract-builder-5ipbzeN-.d.mts} +26 -5
- package/dist/contract-builder-5ipbzeN-.d.mts.map +1 -0
- package/dist/{contract-builder-luQwHUCq.mjs → contract-builder-BCqPVNbs.mjs} +24 -3
- package/dist/contract-builder-BCqPVNbs.mjs.map +1 -0
- package/dist/contract-prisma7__provider.mjs +2 -2
- package/dist/contract-psl.d.mts +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +2 -2
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +2 -2
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/contract.d.mts +2 -2
- package/dist/contract.mjs +4 -4
- package/dist/contract__authored-check-naming.mjs +1 -1
- package/dist/contract__foreign-key-materialization.mjs +1 -1
- package/dist/contract__index-naming.d.mts +2 -2
- package/dist/contract__index-naming.mjs +2 -2
- package/dist/{control-l65wQ2NY.mjs → control-BGi7ayGb.mjs} +2 -2
- package/dist/{control-l65wQ2NY.mjs.map → control-BGi7ayGb.mjs.map} +1 -1
- package/dist/{derived-checks-C4BPtrnO-CmWM7df_.mjs → derived-checks-C4BPtrnO-B9MQRh6W.mjs} +4 -4
- package/dist/{derived-checks-C4BPtrnO-CmWM7df_.mjs.map → derived-checks-C4BPtrnO-B9MQRh6W.mjs.map} +1 -1
- package/dist/family.mjs +2 -2
- package/dist/family__control.mjs +1 -1
- package/dist/family__pack.mjs +1 -1
- package/dist/family__psl-infer.mjs +1 -1
- package/dist/{foreign-key-materialization-0TrwfShD.mjs → foreign-key-materialization-B3HQzQIA.mjs} +2 -2
- package/dist/{foreign-key-materialization-0TrwfShD.mjs.map → foreign-key-materialization-B3HQzQIA.mjs.map} +1 -1
- package/dist/{index-naming-Ct65z5Xk.d.mts → index-naming-BNIXvg5R.d.mts} +11 -2
- package/dist/index-naming-BNIXvg5R.d.mts.map +1 -0
- package/dist/{index-naming-fQMLqyC4-4FzPVtCR.mjs → index-naming-Cj1Anq-T-w1JL7-EM.mjs} +27 -3
- package/dist/index-naming-Cj1Anq-T-w1JL7-EM.mjs.map +1 -0
- package/dist/{interpreter-C8N5eRW1-CwRYmHO7.mjs → interpreter-Bf7Um__3-DC_thY44.mjs} +15 -4
- package/dist/interpreter-Bf7Um__3-DC_thY44.mjs.map +1 -0
- package/dist/{psl-infer-CsCbcmXS.mjs → psl-infer-6p4x9ebN.mjs} +2 -2
- package/dist/{psl-infer-CsCbcmXS.mjs.map → psl-infer-6p4x9ebN.mjs.map} +1 -1
- package/package.json +18 -18
- package/dist/contract-builder-BVjdRPs_.d.mts.map +0 -1
- package/dist/contract-builder-luQwHUCq.mjs.map +0 -1
- package/dist/index-naming-Ct65z5Xk.d.mts.map +0 -1
- package/dist/index-naming-fQMLqyC4-4FzPVtCR.mjs.map +0 -1
- package/dist/interpreter-C8N5eRW1-CwRYmHO7.mjs.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { n as isAuthoredIndexInput } from "./index-naming-Cj1Anq-T-w1JL7-EM.mjs";
|
|
1
2
|
import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
|
|
2
|
-
import { n as buildSqlContractFromDefinition } from "./derived-checks-C4BPtrnO-
|
|
3
|
+
import { n as buildSqlContractFromDefinition } from "./derived-checks-C4BPtrnO-B9MQRh6W.mjs";
|
|
3
4
|
import { a as interpretFieldAttribute, i as findModelAttributeNode, n as fieldSpecContext, o as interpretModelAttribute, r as findFieldAttributeNode, s as sqlAttributeSpecs, t as PSL_CHECK_ON_STI_VARIANT } from "./sql-attribute-specs-DAEpjrWl-C0kmaUJt.mjs";
|
|
4
5
|
import { t as defaultTableName } from "./default-table-name-BfFY8qYR-lHNcVmY5.mjs";
|
|
5
6
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
@@ -15,7 +16,7 @@ import { describeTaggedLiteralFailure } from "@prisma/orm-framework/components/c
|
|
|
15
16
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
16
17
|
import { createPslDiagnosticCollector, diagnosticSource, findBlockDescriptor, keywordPslSpan, nodePslSpan } from "@prisma/orm-framework/psl-parser";
|
|
17
18
|
import { consumeInvalidFkPairing, fkRelationPairKey, requiredOneToOneBackrelationDiagnostic } from "@prisma/orm-framework/psl-parser/interpret";
|
|
18
|
-
//#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-
|
|
19
|
+
//#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-Bf7Um__3.mjs
|
|
19
20
|
function contractError(code, message, options) {
|
|
20
21
|
return structuredError(code, message, options);
|
|
21
22
|
}
|
|
@@ -2439,7 +2440,7 @@ function buildModelNodeFromPsl(input) {
|
|
|
2439
2440
|
}
|
|
2440
2441
|
const contributedModelAttribute = input.modelAttributesByName.get(modelAttribute.name);
|
|
2441
2442
|
if (contributedModelAttribute !== void 0) {
|
|
2442
|
-
if (declaredContributedModelAttributes.has(modelAttribute.name)) {
|
|
2443
|
+
if (contributedModelAttribute.repeatable !== true && declaredContributedModelAttributes.has(modelAttribute.name)) {
|
|
2443
2444
|
diagnostics.push(duplicateModelAttributeDiagnostic({
|
|
2444
2445
|
name: modelAttribute.name,
|
|
2445
2446
|
modelName: model.name,
|
|
@@ -2471,6 +2472,8 @@ function buildModelNodeFromPsl(input) {
|
|
|
2471
2472
|
target: input.targetId,
|
|
2472
2473
|
modelName: model.name,
|
|
2473
2474
|
storageName: tableName,
|
|
2475
|
+
fieldStorageName: (fieldName) => mapping.fieldColumns.get(fieldName),
|
|
2476
|
+
fieldCodecId: (fieldName) => resolvedFields.find((resolved) => resolved.field.name === fieldName)?.descriptor.codecId,
|
|
2474
2477
|
namespaceId: modelNamespaceId ?? input.defaultNamespaceId,
|
|
2475
2478
|
sourceId: source.sources.sourceFileFor(source.node).filename,
|
|
2476
2479
|
diagnostics: { push: (d) => {
|
|
@@ -2478,6 +2481,14 @@ function buildModelNodeFromPsl(input) {
|
|
|
2478
2481
|
} }
|
|
2479
2482
|
});
|
|
2480
2483
|
if (lowered === void 0) continue;
|
|
2484
|
+
if ("index" in lowered) {
|
|
2485
|
+
if (!isAuthoredIndexInput(lowered.index)) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `model attribute "@@${modelAttribute.name}" on model "${model.name}" lowered to a malformed index. A contributed attribute that returns { index } must return an authored-index input: exactly one of a columns list or an expression, plus explicit where/unique/name/map and a type-with-options pair.`, { meta: {
|
|
2486
|
+
attribute: modelAttribute.name,
|
|
2487
|
+
modelName: model.name
|
|
2488
|
+
} });
|
|
2489
|
+
indexNodes.push(lowered.index);
|
|
2490
|
+
continue;
|
|
2491
|
+
}
|
|
2481
2492
|
const slot = modelAttributeEntities[contributedModelAttribute.attribute] ?? {};
|
|
2482
2493
|
modelAttributeEntities[contributedModelAttribute.attribute] = slot;
|
|
2483
2494
|
slot[lowered.key] = lowered.entity;
|
|
@@ -3534,4 +3545,4 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3534
3545
|
//#endregion
|
|
3535
3546
|
export { normalizeReferentialAction as a, interpretPslDocumentToSqlContract as i, buildEntityTypesByDiscriminator as n, numberLiteralDefault as o, indexFkRelations as r, resolveFieldTypeDescriptor as s, applyBackrelationCandidates as t };
|
|
3536
3547
|
|
|
3537
|
-
//# sourceMappingURL=interpreter-
|
|
3548
|
+
//# sourceMappingURL=interpreter-Bf7Um__3-DC_thY44.mjs.map
|