@prisma/orm-family-sql 8.0.0-rc.18-dev.34 → 8.0.0-rc.18-dev.36
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/contract-prisma7__provider.mjs +109 -42
- package/dist/contract-prisma7__provider.mjs.map +1 -1
- package/dist/{exports-DVsHk8HP-M-qeQrkz.mjs → exports-fEqieYlP-BuvGzB4B.mjs} +9 -3
- package/dist/{exports-DVsHk8HP-M-qeQrkz.mjs.map → exports-fEqieYlP-BuvGzB4B.mjs.map} +1 -1
- package/dist/{index-enjgL4Lb.d.mts → index-D_qFOZVN.d.mts} +7 -3
- package/dist/{index-enjgL4Lb.d.mts.map → index-D_qFOZVN.d.mts.map} +1 -1
- package/dist/orm-client.d.mts +9 -5
- package/dist/orm-client.d.mts.map +1 -1
- package/dist/orm-client.mjs +1 -1
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.mjs +2 -2
- package/package.json +18 -18
|
@@ -8,7 +8,7 @@ import { c as instantiateFieldTypeConstructor, h as readDataTypeDefault } from "
|
|
|
8
8
|
import { a as normalizeReferentialAction, n as buildEntityTypesByDiscriminator, r as indexFkRelations, t as applyBackrelationCandidates } from "./interpreter-Dq32sxoS-BcLhPY0_.mjs";
|
|
9
9
|
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
10
10
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
11
|
-
import { entryForTag, getAuthoringTypeConstructor, instantiateAuthoringEntityType } from "@prisma/orm-framework/components/authoring";
|
|
11
|
+
import { entryForTag, getAuthoringTypeConstructor, instantiateAuthoringEntityType, instantiateAuthoringTypeConstructor } from "@prisma/orm-framework/components/authoring";
|
|
12
12
|
import { clipToUtf8Bytes, utf8ByteLength } from "@prisma/orm-framework/utils/text";
|
|
13
13
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
14
14
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
@@ -36,18 +36,34 @@ function andList(items) {
|
|
|
36
36
|
function fieldList(modelName, fieldNames) {
|
|
37
37
|
return andList(fieldNames.map((name) => `"${modelName}.${name}"`));
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
function
|
|
39
|
+
const UNMAPPED_REASONS = ["ignored", "unsupported"];
|
|
40
|
+
function unmappedClause(reason, one) {
|
|
41
|
+
if (reason === "ignored") return `${one ? "is" : "are"} marked @ignore`;
|
|
42
|
+
return `${one ? "has" : "have"} type Unsupported(...), so the Prisma 8 model has no field for ${one ? "it" : "them"}`;
|
|
43
|
+
}
|
|
44
|
+
/** A field with no Prisma 8 field in the model's primary key: without it the model has no field that identifies a row. */
|
|
45
|
+
function unmappedFieldInPrimaryKey(input) {
|
|
41
46
|
const fields = fieldList(input.modelName, input.fieldNames);
|
|
42
47
|
const one = input.fieldNames.length === 1;
|
|
43
|
-
|
|
48
|
+
const modelIgnore = `@@ignore on model "${input.modelName}": Prisma 7 then requires @ignore on every relation field that points to the model, its next migration is empty, Prisma 8 keeps the model's table with its primary key, and the model disappears from both clients.`;
|
|
49
|
+
const edits = input.reason === "ignored" ? `Remove @ignore from ${fields}: Prisma 7's next migration is then empty, and ${one ? "the field appears" : "the fields appear"} in the Prisma 7 client again. Or replace ${one ? "it" : "them"} with ${modelIgnore}` : `Add ${modelIgnore}`;
|
|
50
|
+
return prisma7Diagnostic("PSL.PRISMA7_IGNORED_FIELD_REFERENCED", `${one ? "Field" : "Fields"} ${fields} ${unmappedClause(input.reason, one)}, but ${input.usedBy} uses ${one ? "it" : "them"}, and without ${one ? "it" : "them"} model "${input.modelName}" has no field that identifies a row, so Prisma 8 could not update, delete or relate its rows. ${edits}`, input.sourceId, input.span);
|
|
44
51
|
}
|
|
45
|
-
/** A relation that is not `@ignore` joins on
|
|
46
|
-
function
|
|
52
|
+
/** A relation that is not `@ignore` joins on fields with no Prisma 8 field: Prisma 8 relations join on fields. */
|
|
53
|
+
function unmappedFieldJoined(input) {
|
|
47
54
|
const fields = fieldList(input.modelName, input.fieldNames);
|
|
48
55
|
const one = input.fieldNames.length === 1;
|
|
49
56
|
const relation = `relation field "${input.relationField}"`;
|
|
50
|
-
|
|
57
|
+
const relationIgnore = `${relation} @ignore${input.reason === "ignored" ? " as well" : ""}: Prisma 7's next migration is then empty, the relation field disappears from the Prisma 7 client, and Prisma 8 keeps its foreign key while leaving the relation out of the contract's models.`;
|
|
58
|
+
const edits = input.reason === "ignored" ? `Remove @ignore from ${fields}: Prisma 7's next migration is then empty, and ${one ? "the field appears" : "the fields appear"} in the Prisma 7 client again. Or mark ${relationIgnore}` : `Mark ${relationIgnore}`;
|
|
59
|
+
return prisma7Diagnostic("PSL.PRISMA7_IGNORED_FIELD_REFERENCED", `${one ? "Field" : "Fields"} ${fields} ${unmappedClause(input.reason, one)}, but ${relation} joins on ${one ? "it" : "them"}, and Prisma 8 relations join on fields. ${edits}`, input.sourceId, input.span);
|
|
60
|
+
}
|
|
61
|
+
/** The diagnostics for the fields among `fieldNames` that have no Prisma 8 field, one per reason. */
|
|
62
|
+
function unmappedFieldDiagnostics(fieldNames, unmapped, diagnostic) {
|
|
63
|
+
return UNMAPPED_REASONS.flatMap((reason) => {
|
|
64
|
+
const names = fieldNames.filter((name) => unmapped.get(name) === reason);
|
|
65
|
+
return names.length === 0 ? [] : [diagnostic(names, reason)];
|
|
66
|
+
});
|
|
51
67
|
}
|
|
52
68
|
function parseIndexAttribute(attribute, owner, sourceId, indexTypes, diagnostics) {
|
|
53
69
|
const unsupported = (what, span) => {
|
|
@@ -187,6 +203,7 @@ function lowerPrisma7Default(input) {
|
|
|
187
203
|
const expression = argument?.expression;
|
|
188
204
|
if (argument === void 0 || expression === void 0) return unknown("needs one value.", attribute.span);
|
|
189
205
|
const call = FunctionCallAst.cast(expression.syntax);
|
|
206
|
+
if (input.onlyDbgenerated && call?.path().join(".") !== "dbgenerated") return unknown("on a field of type Unsupported(...) must be dbgenerated(\"...\"). Prisma 7 refuses this schema too: \"Only @default(dbgenerated(\"...\")) can be used for Unsupported types.\" Write the default as @default(dbgenerated(\"<sql expression>\")), or remove it.", attribute.span);
|
|
190
207
|
if (call !== void 0) return lowerFunction(call, input, label, unknown);
|
|
191
208
|
const scalar = scalarValue$1(expression, input, unknown);
|
|
192
209
|
if (scalar === void 0) return void 0;
|
|
@@ -543,7 +560,7 @@ function parseRelationAttribute(attribute, label, sourceId, diagnostics) {
|
|
|
543
560
|
};
|
|
544
561
|
}
|
|
545
562
|
function storageColumn(model, fieldName) {
|
|
546
|
-
return model.columns.get(fieldName) ?? model.
|
|
563
|
+
return model.columns.get(fieldName) ?? model.unmappedColumns.get(fieldName);
|
|
547
564
|
}
|
|
548
565
|
/** A foreign key reaches a table with a model through the model, and an `@@ignore` model's table by its name. */
|
|
549
566
|
function referenceTo(model, columns) {
|
|
@@ -675,16 +692,14 @@ function lowerRelations(models, naming, diagnostics) {
|
|
|
675
692
|
}, {
|
|
676
693
|
owner: target,
|
|
677
694
|
names: attribute.references ?? []
|
|
678
|
-
}].flatMap(({ owner, names }) => {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
})];
|
|
687
|
-
});
|
|
695
|
+
}].flatMap(({ owner, names }) => unmappedFieldDiagnostics(names, owner.unmappedFields, (fieldNames, reason) => unmappedFieldJoined({
|
|
696
|
+
modelName: owner.modelName,
|
|
697
|
+
fieldNames,
|
|
698
|
+
reason,
|
|
699
|
+
relationField: `${model.modelName}.${field.name}`,
|
|
700
|
+
sourceId: model.sourceId,
|
|
701
|
+
span: attribute.span
|
|
702
|
+
})));
|
|
688
703
|
if (joinedIgnored.length > 0) {
|
|
689
704
|
rejectFkSide(model, relationField, ...joinedIgnored);
|
|
690
705
|
continue;
|
|
@@ -928,7 +943,7 @@ function junctionModel(name, table) {
|
|
|
928
943
|
* id is at fault.
|
|
929
944
|
*/
|
|
930
945
|
function singleIdColumn(side, requester, diagnostics) {
|
|
931
|
-
if (side.model.idFields.some((name) => side.model.
|
|
946
|
+
if (side.model.idFields.some((name) => side.model.unmappedFields.has(name) || side.model.rejectedFields.has(name))) return;
|
|
932
947
|
const [idField, ...rest] = side.model.idFields;
|
|
933
948
|
const column = idField === void 0 ? void 0 : storageColumn(side.model, idField);
|
|
934
949
|
if (column === void 0 || rest.length > 0) {
|
|
@@ -1180,8 +1195,8 @@ function interpretPrisma7Documents(input) {
|
|
|
1180
1195
|
const build = {
|
|
1181
1196
|
declaration,
|
|
1182
1197
|
columns: /* @__PURE__ */ new Map(),
|
|
1183
|
-
|
|
1184
|
-
|
|
1198
|
+
unmappedColumns: /* @__PURE__ */ new Map(),
|
|
1199
|
+
unmappedFields: /* @__PURE__ */ new Map(),
|
|
1185
1200
|
ignoredRelationFields: [],
|
|
1186
1201
|
rejectedFields: /* @__PURE__ */ new Set(),
|
|
1187
1202
|
idFields: declaration.id?.fields ?? [],
|
|
@@ -1202,7 +1217,7 @@ function interpretPrisma7Documents(input) {
|
|
|
1202
1217
|
input,
|
|
1203
1218
|
diagnostics
|
|
1204
1219
|
});
|
|
1205
|
-
if (diagnostics.length > reported && !build.columns.has(field.name) && !build.
|
|
1220
|
+
if (diagnostics.length > reported && !build.columns.has(field.name) && !build.unmappedColumns.has(field.name)) build.rejectedFields.add(field.name);
|
|
1206
1221
|
}
|
|
1207
1222
|
builds.set(declaration.symbol.name, build);
|
|
1208
1223
|
}
|
|
@@ -1216,8 +1231,8 @@ function interpretPrisma7Documents(input) {
|
|
|
1216
1231
|
sourceId: build.declaration.sourceId,
|
|
1217
1232
|
sources: build.declaration.sources,
|
|
1218
1233
|
columns: build.columns,
|
|
1219
|
-
|
|
1220
|
-
|
|
1234
|
+
unmappedColumns: build.unmappedColumns,
|
|
1235
|
+
unmappedFields: build.unmappedFields,
|
|
1221
1236
|
ignoredRelationFields: build.ignoredRelationFields,
|
|
1222
1237
|
rejectedFields: build.rejectedFields,
|
|
1223
1238
|
idFields: build.idFields,
|
|
@@ -1230,16 +1245,15 @@ function interpretPrisma7Documents(input) {
|
|
|
1230
1245
|
for (const [modelName, build] of builds) {
|
|
1231
1246
|
const model = relationModels.get(modelName);
|
|
1232
1247
|
if (model === void 0) continue;
|
|
1233
|
-
const ignoredAmong = (fieldNames) => fieldNames?.filter((name) => build.ignoredFields.has(name)) ?? [];
|
|
1234
1248
|
const idAttribute = build.declaration.id;
|
|
1235
|
-
|
|
1236
|
-
if (idAttribute !== void 0 && ignoredIdFields.length > 0) diagnostics.push(ignoredFieldInPrimaryKey({
|
|
1249
|
+
if (idAttribute?.fields !== void 0) diagnostics.push(...unmappedFieldDiagnostics(idAttribute.fields, build.unmappedFields, (fieldNames, reason) => unmappedFieldInPrimaryKey({
|
|
1237
1250
|
modelName,
|
|
1238
|
-
fieldNames
|
|
1251
|
+
fieldNames,
|
|
1252
|
+
reason,
|
|
1239
1253
|
usedBy: `@@id on model "${modelName}"`,
|
|
1240
1254
|
sourceId: model.sourceId,
|
|
1241
1255
|
span: idAttribute.span
|
|
1242
|
-
}));
|
|
1256
|
+
})));
|
|
1243
1257
|
const id = keyColumns(model, model.idFields);
|
|
1244
1258
|
const indexes = [...build.uniqueIndexes.map((attribute) => ({
|
|
1245
1259
|
attribute,
|
|
@@ -1268,12 +1282,12 @@ function interpretPrisma7Documents(input) {
|
|
|
1268
1282
|
...indexes.length > 0 ? { indexes } : {},
|
|
1269
1283
|
...foreignKeys !== void 0 ? { foreignKeys } : {}
|
|
1270
1284
|
});
|
|
1271
|
-
const
|
|
1285
|
+
const unmappedColumns = [...build.unmappedColumns.values()];
|
|
1272
1286
|
if (model.ignored) {
|
|
1273
1287
|
tables.push({
|
|
1274
1288
|
...tableProperties,
|
|
1275
1289
|
namespaceId: model.namespaceId,
|
|
1276
|
-
columns:
|
|
1290
|
+
columns: unmappedColumns
|
|
1277
1291
|
});
|
|
1278
1292
|
continue;
|
|
1279
1293
|
}
|
|
@@ -1284,10 +1298,10 @@ function interpretPrisma7Documents(input) {
|
|
|
1284
1298
|
fields: [...build.columns.values()],
|
|
1285
1299
|
...relations !== void 0 ? { relations } : {}
|
|
1286
1300
|
});
|
|
1287
|
-
if (
|
|
1301
|
+
if (unmappedColumns.length > 0) tables.push({
|
|
1288
1302
|
namespaceId: model.namespaceId,
|
|
1289
1303
|
tableName: model.tableName,
|
|
1290
|
-
columns:
|
|
1304
|
+
columns: unmappedColumns
|
|
1291
1305
|
});
|
|
1292
1306
|
}
|
|
1293
1307
|
tables.push(...[...lowered.ignoredJunctions.values()].map(stateServedBackingIndexes));
|
|
@@ -1391,7 +1405,7 @@ function reportTableCollisions(models, diagnostics) {
|
|
|
1391
1405
|
function keyColumns(model, fieldNames) {
|
|
1392
1406
|
const columns = [];
|
|
1393
1407
|
for (const fieldName of fieldNames) {
|
|
1394
|
-
const column = model.columns.get(fieldName) ?? model.
|
|
1408
|
+
const column = model.columns.get(fieldName) ?? model.unmappedColumns.get(fieldName);
|
|
1395
1409
|
if (column === void 0) return void 0;
|
|
1396
1410
|
columns.push(column.columnName);
|
|
1397
1411
|
}
|
|
@@ -1571,6 +1585,32 @@ function lowerNativeEnums(enums, input, diagnostics) {
|
|
|
1571
1585
|
}
|
|
1572
1586
|
return result;
|
|
1573
1587
|
}
|
|
1588
|
+
/** The SQL family's type constructor for a column of a type no data type claims (ADR 273). */
|
|
1589
|
+
const RAW_TYPE_CONSTRUCTOR = ["Raw"];
|
|
1590
|
+
/** Prisma 7's `Unsupported("...")`, which this source reads as `Raw("...")`. */
|
|
1591
|
+
function isUnsupportedType(call) {
|
|
1592
|
+
return call?.path.length === 1 && call.path[0] === "Unsupported";
|
|
1593
|
+
}
|
|
1594
|
+
/** The one double-quoted string `Unsupported(...)` takes, as written and with its escapes undone. */
|
|
1595
|
+
function unsupportedTypeArgument(call) {
|
|
1596
|
+
const [written, ...rest] = call.args;
|
|
1597
|
+
if (written === void 0 || rest.length > 0 || written.kind !== "positional") return void 0;
|
|
1598
|
+
const literal = written.expression === void 0 ? void 0 : StringLiteralExprAst.cast(written.expression.syntax);
|
|
1599
|
+
const text = literal?.quote() === "\"" ? literal.value() : void 0;
|
|
1600
|
+
return text === void 0 ? void 0 : {
|
|
1601
|
+
written,
|
|
1602
|
+
text
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
/** Why the type parameters a constructor makes from `args` fail its codec's parameter schema, or undefined when they pass. */
|
|
1606
|
+
function typeParamsRefusal(descriptor, args, codecLookup) {
|
|
1607
|
+
const { typeParams } = instantiateAuthoringTypeConstructor(descriptor, args);
|
|
1608
|
+
const schema = codecLookup.descriptorFor(descriptor.output.codecId)?.paramsSchema;
|
|
1609
|
+
if (schema === void 0) return void 0;
|
|
1610
|
+
const result = schema["~standard"].validate(typeParams ?? {});
|
|
1611
|
+
if (result instanceof Promise) throw new InternalError(`The parameter schema of codec "${descriptor.output.codecId}" is asynchronous; authoring requires a synchronous schema.`);
|
|
1612
|
+
return result.issues?.[0]?.message;
|
|
1613
|
+
}
|
|
1574
1614
|
function nativeTypeMessage(label, nativeType) {
|
|
1575
1615
|
return `${label}: native type "@db.${nativeType}" has no Prisma 8 codec yet, and Prisma 8 cannot read this schema until it supports the column type. @ignore on the field or @@ignore on the model does not help: Prisma 8 keeps the columns of ignored fields and models in the contract. Changing the field's type to one Prisma 8 supports changes the column type on Prisma 7's next migration.`;
|
|
1576
1616
|
}
|
|
@@ -1582,8 +1622,10 @@ function readField(args) {
|
|
|
1582
1622
|
const label = `Field "${model.symbol.name}.${field.name}"`;
|
|
1583
1623
|
const isRelationField = args.modelNames.has(field.typeName) && field.typeConstructor === void 0;
|
|
1584
1624
|
const fieldIgnored = field.attributes.some((attribute) => attribute.name === "ignore") || isRelationField && args.ignoredModels.has(field.typeName);
|
|
1585
|
-
|
|
1586
|
-
const
|
|
1625
|
+
const unsupported = isUnsupportedType(field.typeConstructor);
|
|
1626
|
+
const unmappedReason = unsupported && !model.ignored ? "unsupported" : fieldIgnored ? "ignored" : void 0;
|
|
1627
|
+
if (unmappedReason !== void 0) build.unmappedFields.set(field.name, unmappedReason);
|
|
1628
|
+
const ignored = fieldIgnored || model.ignored || unsupported;
|
|
1587
1629
|
let columnName = field.name;
|
|
1588
1630
|
let nativeType;
|
|
1589
1631
|
let relation;
|
|
@@ -1608,9 +1650,10 @@ function readField(args) {
|
|
|
1608
1650
|
build.idFields = [field.name];
|
|
1609
1651
|
build.idMap = parsed.map;
|
|
1610
1652
|
}
|
|
1611
|
-
if (
|
|
1653
|
+
if (unmappedReason !== void 0) diagnostics.push(unmappedFieldInPrimaryKey({
|
|
1612
1654
|
modelName: model.symbol.name,
|
|
1613
1655
|
fieldNames: [field.name],
|
|
1656
|
+
reason: unmappedReason,
|
|
1614
1657
|
usedBy: "its @id",
|
|
1615
1658
|
sourceId,
|
|
1616
1659
|
span: attribute.span
|
|
@@ -1627,8 +1670,17 @@ function readField(args) {
|
|
|
1627
1670
|
else if (attribute.name === "ignore") {} else diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_UNKNOWN_ATTRIBUTE", `${label}: attribute "@${attribute.name}" is not supported yet by the Prisma 7 contract source.`, sourceId, attribute.span));
|
|
1628
1671
|
}
|
|
1629
1672
|
if (field.malformedType) return;
|
|
1630
|
-
if (field.typeConstructor !== void 0) {
|
|
1631
|
-
diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_UNSUPPORTED_TYPE", `${label} has type "${field.typeConstructor.path.join(".")}(...)", which
|
|
1673
|
+
if (field.typeConstructor !== void 0 && !unsupported) {
|
|
1674
|
+
diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_UNSUPPORTED_TYPE", `${label} has type "${field.typeConstructor.path.join(".")}(...)", which is not a Prisma 7 type. Prisma 7 refuses this schema too.`, sourceId, field.typeConstructor.span));
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
if (unsupported && nativeType !== void 0) {
|
|
1678
|
+
diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_UNKNOWN_ATTRIBUTE", `${label} has type Unsupported(...), which takes no native type, but has attribute "@db.${nativeType.name}". Prisma 7 refuses this schema too: "Attribute not known". Remove "@db.${nativeType.name}".`, sourceId, nativeType.attribute.span));
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
const unsupportedArgument = field.typeConstructor === void 0 ? void 0 : unsupportedTypeArgument(field.typeConstructor);
|
|
1682
|
+
if (field.typeConstructor !== void 0 && unsupportedArgument === void 0) {
|
|
1683
|
+
diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_UNSUPPORTED_TYPE", `${label}: Unsupported(...) takes one string, the column's type as the database prints it, such as Unsupported("tsvector").`, sourceId, field.typeConstructor.span));
|
|
1632
1684
|
return;
|
|
1633
1685
|
}
|
|
1634
1686
|
if (isRelationField) {
|
|
@@ -1649,9 +1701,18 @@ function readField(args) {
|
|
|
1649
1701
|
diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_UPDATED_AT_FIELD_INVALID", `${label} is a list, but @updatedAt is not allowed on a list field. Prisma 7 refuses this schema too: "Fields that are marked with @updatedAt cannot be lists." Remove @updatedAt, or make the field a single DateTime.`, sourceId, updatedAt.span));
|
|
1650
1702
|
return;
|
|
1651
1703
|
}
|
|
1652
|
-
const enumDeclaration = args.enums.get(field.typeName);
|
|
1704
|
+
const enumDeclaration = unsupported ? void 0 : args.enums.get(field.typeName);
|
|
1653
1705
|
let call;
|
|
1654
|
-
if (
|
|
1706
|
+
if (unsupportedArgument !== void 0) call = {
|
|
1707
|
+
path: RAW_TYPE_CONSTRUCTOR,
|
|
1708
|
+
args: [{
|
|
1709
|
+
kind: "positional",
|
|
1710
|
+
value: `"${unsupportedArgument.text}"`,
|
|
1711
|
+
span: unsupportedArgument.written.span
|
|
1712
|
+
}],
|
|
1713
|
+
span: unsupportedArgument.written.span
|
|
1714
|
+
};
|
|
1715
|
+
else if (enumDeclaration !== void 0) {
|
|
1655
1716
|
if (enumDeclaration.namespaceId !== model.namespaceId) {
|
|
1656
1717
|
diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_ENUM_NAMESPACE_MISMATCH", `${label} uses enum "${enumDeclaration.name}" from schema "${enumDeclaration.namespaceId}", but the model is in schema "${model.namespaceId}". Prisma 8 columns reference the enum type of their own schema; declare the enum in "${model.namespaceId}" or move the model.`, sourceId, field.span));
|
|
1657
1718
|
return;
|
|
@@ -1697,6 +1758,11 @@ function readField(args) {
|
|
|
1697
1758
|
diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_UNSUPPORTED_TYPE", `${label} type "${field.typeName}" could not be resolved against target "${binding.target.targetId}".`, sourceId, field.span));
|
|
1698
1759
|
return;
|
|
1699
1760
|
}
|
|
1761
|
+
const refusal = unsupportedArgument === void 0 ? void 0 : typeParamsRefusal(typeConstructor, [unsupportedArgument.text], input.codecLookup);
|
|
1762
|
+
if (unsupportedArgument !== void 0 && refusal !== void 0) {
|
|
1763
|
+
diagnostics.push(prisma7Diagnostic("PSL.PRISMA7_UNSUPPORTED_TYPE", `${label}: Unsupported(${unsupportedArgument.written.value}) is not one type name: ${refusal}`, sourceId, unsupportedArgument.written.span));
|
|
1764
|
+
return;
|
|
1765
|
+
}
|
|
1700
1766
|
const typeDiagnostics = createPslDiagnosticCollector(model.sources);
|
|
1701
1767
|
const resolved = instantiateFieldTypeConstructor({
|
|
1702
1768
|
call,
|
|
@@ -1724,6 +1790,7 @@ function readField(args) {
|
|
|
1724
1790
|
attribute: defaultAttribute,
|
|
1725
1791
|
field,
|
|
1726
1792
|
modelName: model.symbol.name,
|
|
1793
|
+
onlyDbgenerated: unsupported,
|
|
1727
1794
|
codecId: resolved.descriptor.codecId,
|
|
1728
1795
|
typeParams: resolved.descriptor.typeParams,
|
|
1729
1796
|
codecLookup: input.codecLookup,
|
|
@@ -1749,7 +1816,7 @@ function readField(args) {
|
|
|
1749
1816
|
...ifDefined("default", lowered?.storage)
|
|
1750
1817
|
};
|
|
1751
1818
|
if (ignored) {
|
|
1752
|
-
build.
|
|
1819
|
+
build.unmappedColumns.set(field.name, column);
|
|
1753
1820
|
return;
|
|
1754
1821
|
}
|
|
1755
1822
|
const executionDefaults = updatedAtGenerator !== void 0 ? {
|