@prisma/client 7.3.0-integration-engines-7-3-0-13-parameterization-ffcc2ffa23a1cf2fa93cc75600377a7bcf8b3b08.1 → 7.3.0-integration-parameterization.4
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/generator-build/index.js +543 -5
- package/package.json +34 -32
- package/runtime/client.d.mts +134 -0
- package/runtime/client.d.ts +134 -0
- package/runtime/client.js +23 -23
- package/runtime/client.js.map +4 -4
- package/runtime/client.mjs +23 -23
- package/runtime/client.mjs.map +4 -4
- package/runtime/wasm-compiler-edge.js +19 -19
- package/runtime/wasm-compiler-edge.js.map +4 -4
- package/runtime/wasm-compiler-edge.mjs +19 -19
- package/runtime/wasm-compiler-edge.mjs.map +4 -4
- package/scripts/default-index.js +1 -1
package/generator-build/index.js
CHANGED
|
@@ -4573,7 +4573,7 @@ var import_path4 = __toESM(require("path"));
|
|
|
4573
4573
|
// package.json
|
|
4574
4574
|
var package_default = {
|
|
4575
4575
|
name: "@prisma/client",
|
|
4576
|
-
version: "7.3.0-integration-
|
|
4576
|
+
version: "7.3.0-integration-parameterization.4",
|
|
4577
4577
|
description: "Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.",
|
|
4578
4578
|
keywords: [
|
|
4579
4579
|
"ORM",
|
|
@@ -4782,6 +4782,8 @@ var package_default = {
|
|
|
4782
4782
|
"@prisma/internals": "workspace:*",
|
|
4783
4783
|
"@prisma/json-protocol": "workspace:*",
|
|
4784
4784
|
"@prisma/migrate": "workspace:*",
|
|
4785
|
+
"@prisma/param-graph": "workspace:*",
|
|
4786
|
+
"@prisma/param-graph-builder": "workspace:*",
|
|
4785
4787
|
"@prisma/query-compiler-wasm": "7.3.0-13.parameterization-ffcc2ffa23a1cf2fa93cc75600377a7bcf8b3b08",
|
|
4786
4788
|
"@prisma/query-plan-executor": "workspace:*",
|
|
4787
4789
|
"@prisma/sqlcommenter": "workspace:*",
|
|
@@ -7398,6 +7400,7 @@ ${aggregateTypes.length > 1 ? aggregateTypes.slice(1).map((type) => {
|
|
|
7398
7400
|
name: field.name,
|
|
7399
7401
|
isNullable: false,
|
|
7400
7402
|
isRequired: false,
|
|
7403
|
+
isParameterizable: false,
|
|
7401
7404
|
inputTypes: [
|
|
7402
7405
|
{
|
|
7403
7406
|
isList: false,
|
|
@@ -7869,6 +7872,535 @@ function fluentWrapperName(modelName) {
|
|
|
7869
7872
|
return `Prisma__${modelName}Client`;
|
|
7870
7873
|
}
|
|
7871
7874
|
|
|
7875
|
+
// ../param-graph/src/param-graph.ts
|
|
7876
|
+
var EdgeFlag = {
|
|
7877
|
+
/**
|
|
7878
|
+
* Field may be parameterized as a scalar value.
|
|
7879
|
+
* Check ScalarMask to validate the value type.
|
|
7880
|
+
*/
|
|
7881
|
+
ParamScalar: 1,
|
|
7882
|
+
/**
|
|
7883
|
+
* Field accepts list-of-scalar values.
|
|
7884
|
+
* Parameterize the whole list if all elements match ScalarMask.
|
|
7885
|
+
*/
|
|
7886
|
+
ListScalar: 2,
|
|
7887
|
+
/**
|
|
7888
|
+
* Field accepts list-of-object values.
|
|
7889
|
+
* Recurse into each element using the child node.
|
|
7890
|
+
*/
|
|
7891
|
+
ListObject: 4,
|
|
7892
|
+
/**
|
|
7893
|
+
* Field accepts object values.
|
|
7894
|
+
* Recurse into child input node.
|
|
7895
|
+
*/
|
|
7896
|
+
Object: 8,
|
|
7897
|
+
/**
|
|
7898
|
+
* Field accepts null as a valid value.
|
|
7899
|
+
* Note: Null values are NEVER parameterized at runtime regardless of this flag.
|
|
7900
|
+
* This flag is informational only (reflects isNullable from DMMF).
|
|
7901
|
+
*/
|
|
7902
|
+
Nullable: 16
|
|
7903
|
+
};
|
|
7904
|
+
var ScalarMask = {
|
|
7905
|
+
String: 1,
|
|
7906
|
+
Number: 2,
|
|
7907
|
+
// Int, Float
|
|
7908
|
+
Boolean: 4,
|
|
7909
|
+
DateTime: 8,
|
|
7910
|
+
Decimal: 16,
|
|
7911
|
+
BigInt: 32,
|
|
7912
|
+
Bytes: 64,
|
|
7913
|
+
Json: 128
|
|
7914
|
+
};
|
|
7915
|
+
function scalarTypeToMask(typeName) {
|
|
7916
|
+
switch (typeName) {
|
|
7917
|
+
case "String":
|
|
7918
|
+
return ScalarMask.String;
|
|
7919
|
+
case "Int":
|
|
7920
|
+
case "Float":
|
|
7921
|
+
return ScalarMask.Number;
|
|
7922
|
+
case "Boolean":
|
|
7923
|
+
return ScalarMask.Boolean;
|
|
7924
|
+
case "DateTime":
|
|
7925
|
+
return ScalarMask.DateTime;
|
|
7926
|
+
case "Decimal":
|
|
7927
|
+
return ScalarMask.Decimal;
|
|
7928
|
+
case "BigInt":
|
|
7929
|
+
return ScalarMask.BigInt;
|
|
7930
|
+
case "Bytes":
|
|
7931
|
+
return ScalarMask.Bytes;
|
|
7932
|
+
case "Json":
|
|
7933
|
+
return ScalarMask.Json;
|
|
7934
|
+
default:
|
|
7935
|
+
return 0;
|
|
7936
|
+
}
|
|
7937
|
+
}
|
|
7938
|
+
|
|
7939
|
+
// ../param-graph-builder/src/build-param-graph.ts
|
|
7940
|
+
var ParamGraphBuilder = class {
|
|
7941
|
+
stringTable = [];
|
|
7942
|
+
stringToIndex = /* @__PURE__ */ new Map();
|
|
7943
|
+
enumNames = [];
|
|
7944
|
+
enumToIndex = /* @__PURE__ */ new Map();
|
|
7945
|
+
inputNodes = [];
|
|
7946
|
+
outputNodes = [];
|
|
7947
|
+
roots = {};
|
|
7948
|
+
// Cache for input type nodes to avoid rebuilding
|
|
7949
|
+
inputTypeNodeCache = /* @__PURE__ */ new Map();
|
|
7950
|
+
// Cache for union nodes keyed by sorted type names
|
|
7951
|
+
unionNodeCache = /* @__PURE__ */ new Map();
|
|
7952
|
+
// Cache for output type nodes
|
|
7953
|
+
outputTypeNodeCache = /* @__PURE__ */ new Map();
|
|
7954
|
+
/**
|
|
7955
|
+
* Interns a string into the string table, returning its index.
|
|
7956
|
+
*/
|
|
7957
|
+
internString(str) {
|
|
7958
|
+
let index = this.stringToIndex.get(str);
|
|
7959
|
+
if (index === void 0) {
|
|
7960
|
+
index = this.stringTable.length;
|
|
7961
|
+
this.stringTable.push(str);
|
|
7962
|
+
this.stringToIndex.set(str, index);
|
|
7963
|
+
}
|
|
7964
|
+
return index;
|
|
7965
|
+
}
|
|
7966
|
+
/**
|
|
7967
|
+
* Registers a user enum name, returning its index.
|
|
7968
|
+
*/
|
|
7969
|
+
registerEnum(enumName) {
|
|
7970
|
+
let index = this.enumToIndex.get(enumName);
|
|
7971
|
+
if (index === void 0) {
|
|
7972
|
+
index = this.enumNames.length;
|
|
7973
|
+
this.enumNames.push(enumName);
|
|
7974
|
+
this.enumToIndex.set(enumName, index);
|
|
7975
|
+
}
|
|
7976
|
+
return index;
|
|
7977
|
+
}
|
|
7978
|
+
/**
|
|
7979
|
+
* Allocates a new input node and returns its ID.
|
|
7980
|
+
*/
|
|
7981
|
+
allocateInputNode() {
|
|
7982
|
+
const id = this.inputNodes.length;
|
|
7983
|
+
this.inputNodes.push({});
|
|
7984
|
+
return id;
|
|
7985
|
+
}
|
|
7986
|
+
/**
|
|
7987
|
+
* Sets fields on an input node.
|
|
7988
|
+
*/
|
|
7989
|
+
setInputNodeFields(nodeId, fields) {
|
|
7990
|
+
if (Object.keys(fields).length > 0) {
|
|
7991
|
+
this.inputNodes[nodeId].f = fields;
|
|
7992
|
+
}
|
|
7993
|
+
}
|
|
7994
|
+
/**
|
|
7995
|
+
* Allocates a new output node and returns its ID.
|
|
7996
|
+
*/
|
|
7997
|
+
allocateOutputNode() {
|
|
7998
|
+
const id = this.outputNodes.length;
|
|
7999
|
+
this.outputNodes.push({});
|
|
8000
|
+
return id;
|
|
8001
|
+
}
|
|
8002
|
+
/**
|
|
8003
|
+
* Sets fields on an output node.
|
|
8004
|
+
*/
|
|
8005
|
+
setOutputNodeFields(nodeId, fields) {
|
|
8006
|
+
if (Object.keys(fields).length > 0) {
|
|
8007
|
+
this.outputNodes[nodeId].f = fields;
|
|
8008
|
+
}
|
|
8009
|
+
}
|
|
8010
|
+
/**
|
|
8011
|
+
* Records a root entry for an operation.
|
|
8012
|
+
*/
|
|
8013
|
+
setRoot(key, entry) {
|
|
8014
|
+
if (entry.a !== void 0 || entry.o !== void 0) {
|
|
8015
|
+
this.roots[key] = entry;
|
|
8016
|
+
}
|
|
8017
|
+
}
|
|
8018
|
+
/**
|
|
8019
|
+
* Gets or sets a cached input type node ID.
|
|
8020
|
+
*/
|
|
8021
|
+
getInputTypeNode(typeName) {
|
|
8022
|
+
return this.inputTypeNodeCache.get(typeName);
|
|
8023
|
+
}
|
|
8024
|
+
setInputTypeNode(typeName, nodeId) {
|
|
8025
|
+
this.inputTypeNodeCache.set(typeName, nodeId);
|
|
8026
|
+
}
|
|
8027
|
+
hasInputTypeNode(typeName) {
|
|
8028
|
+
return this.inputTypeNodeCache.has(typeName);
|
|
8029
|
+
}
|
|
8030
|
+
/**
|
|
8031
|
+
* Gets or sets a cached union node ID.
|
|
8032
|
+
*/
|
|
8033
|
+
getUnionNode(key) {
|
|
8034
|
+
return this.unionNodeCache.get(key);
|
|
8035
|
+
}
|
|
8036
|
+
setUnionNode(key, nodeId) {
|
|
8037
|
+
this.unionNodeCache.set(key, nodeId);
|
|
8038
|
+
}
|
|
8039
|
+
hasUnionNode(key) {
|
|
8040
|
+
return this.unionNodeCache.has(key);
|
|
8041
|
+
}
|
|
8042
|
+
/**
|
|
8043
|
+
* Gets or sets a cached output type node ID.
|
|
8044
|
+
*/
|
|
8045
|
+
getOutputTypeNode(typeName) {
|
|
8046
|
+
return this.outputTypeNodeCache.get(typeName);
|
|
8047
|
+
}
|
|
8048
|
+
setOutputTypeNode(typeName, nodeId) {
|
|
8049
|
+
this.outputTypeNodeCache.set(typeName, nodeId);
|
|
8050
|
+
}
|
|
8051
|
+
hasOutputTypeNode(typeName) {
|
|
8052
|
+
return this.outputTypeNodeCache.has(typeName);
|
|
8053
|
+
}
|
|
8054
|
+
/**
|
|
8055
|
+
* Builds the final ParamGraph.
|
|
8056
|
+
*/
|
|
8057
|
+
build() {
|
|
8058
|
+
return {
|
|
8059
|
+
s: this.stringTable,
|
|
8060
|
+
en: this.enumNames,
|
|
8061
|
+
i: this.inputNodes,
|
|
8062
|
+
o: this.outputNodes,
|
|
8063
|
+
r: this.roots
|
|
8064
|
+
};
|
|
8065
|
+
}
|
|
8066
|
+
};
|
|
8067
|
+
function buildParamGraph(dmmf) {
|
|
8068
|
+
const builder = new ParamGraphBuilder();
|
|
8069
|
+
const inputTypeMap = /* @__PURE__ */ new Map();
|
|
8070
|
+
const outputTypeMap = /* @__PURE__ */ new Map();
|
|
8071
|
+
const userEnumNames = /* @__PURE__ */ new Set();
|
|
8072
|
+
for (const e of dmmf.datamodel.enums) {
|
|
8073
|
+
userEnumNames.add(e.name);
|
|
8074
|
+
}
|
|
8075
|
+
for (const inputType of dmmf.schema.inputObjectTypes.prisma ?? []) {
|
|
8076
|
+
inputTypeMap.set(inputType.name, inputType);
|
|
8077
|
+
}
|
|
8078
|
+
for (const inputType of dmmf.schema.inputObjectTypes.model ?? []) {
|
|
8079
|
+
inputTypeMap.set(inputType.name, inputType);
|
|
8080
|
+
}
|
|
8081
|
+
for (const outputType of dmmf.schema.outputObjectTypes.prisma) {
|
|
8082
|
+
outputTypeMap.set(outputType.name, outputType);
|
|
8083
|
+
}
|
|
8084
|
+
for (const outputType of dmmf.schema.outputObjectTypes.model) {
|
|
8085
|
+
outputTypeMap.set(outputType.name, outputType);
|
|
8086
|
+
}
|
|
8087
|
+
function buildInputNodeFromArgs(args) {
|
|
8088
|
+
const fields = {};
|
|
8089
|
+
let hasAnyField = false;
|
|
8090
|
+
for (const arg of args) {
|
|
8091
|
+
const edge = buildInputEdge(arg);
|
|
8092
|
+
if (edge) {
|
|
8093
|
+
const stringIndex = builder.internString(arg.name);
|
|
8094
|
+
fields[stringIndex] = edge;
|
|
8095
|
+
hasAnyField = true;
|
|
8096
|
+
}
|
|
8097
|
+
}
|
|
8098
|
+
if (!hasAnyField) {
|
|
8099
|
+
return void 0;
|
|
8100
|
+
}
|
|
8101
|
+
const nodeId = builder.allocateInputNode();
|
|
8102
|
+
builder.setInputNodeFields(nodeId, fields);
|
|
8103
|
+
return nodeId;
|
|
8104
|
+
}
|
|
8105
|
+
function buildInputEdge(arg) {
|
|
8106
|
+
let flags = 0;
|
|
8107
|
+
let scalarMask = 0;
|
|
8108
|
+
let childNodeId;
|
|
8109
|
+
let enumNameId;
|
|
8110
|
+
const scalarTypes = [];
|
|
8111
|
+
const enumTypes = [];
|
|
8112
|
+
const inputObjectTypes = [];
|
|
8113
|
+
for (const inputType of arg.inputTypes) {
|
|
8114
|
+
switch (inputType.location) {
|
|
8115
|
+
case "scalar":
|
|
8116
|
+
scalarTypes.push(inputType);
|
|
8117
|
+
break;
|
|
8118
|
+
case "enumTypes":
|
|
8119
|
+
enumTypes.push(inputType);
|
|
8120
|
+
break;
|
|
8121
|
+
case "inputObjectTypes":
|
|
8122
|
+
inputObjectTypes.push(inputType);
|
|
8123
|
+
break;
|
|
8124
|
+
case "fieldRefTypes":
|
|
8125
|
+
break;
|
|
8126
|
+
}
|
|
8127
|
+
}
|
|
8128
|
+
for (const st of scalarTypes) {
|
|
8129
|
+
scalarMask |= scalarTypeToMask(st.type);
|
|
8130
|
+
}
|
|
8131
|
+
const hasStringScalar = (scalarMask & ScalarMask.String) !== 0;
|
|
8132
|
+
for (const et of enumTypes) {
|
|
8133
|
+
const isUserEnum = userEnumNames.has(et.type);
|
|
8134
|
+
const isPrismaEnum = et.namespace === "prisma";
|
|
8135
|
+
if (isUserEnum) {
|
|
8136
|
+
if (!hasStringScalar) {
|
|
8137
|
+
enumNameId = builder.registerEnum(et.type);
|
|
8138
|
+
}
|
|
8139
|
+
scalarMask |= ScalarMask.String;
|
|
8140
|
+
} else if (!isPrismaEnum) {
|
|
8141
|
+
scalarMask |= ScalarMask.String;
|
|
8142
|
+
}
|
|
8143
|
+
}
|
|
8144
|
+
const canParamScalar = arg.isParameterizable && scalarMask !== 0;
|
|
8145
|
+
if (canParamScalar) {
|
|
8146
|
+
const hasScalarList = scalarTypes.some((st) => st.isList) || enumTypes.some((et) => et.isList && (userEnumNames.has(et.type) || et.namespace !== "prisma"));
|
|
8147
|
+
if (hasScalarList) {
|
|
8148
|
+
flags |= EdgeFlag.ListScalar;
|
|
8149
|
+
} else {
|
|
8150
|
+
flags |= EdgeFlag.ParamScalar;
|
|
8151
|
+
}
|
|
8152
|
+
}
|
|
8153
|
+
if (inputObjectTypes.length > 0) {
|
|
8154
|
+
const hasObjectList = inputObjectTypes.some((iot) => iot.isList);
|
|
8155
|
+
if (hasObjectList) {
|
|
8156
|
+
flags |= EdgeFlag.ListObject;
|
|
8157
|
+
} else {
|
|
8158
|
+
flags |= EdgeFlag.Object;
|
|
8159
|
+
}
|
|
8160
|
+
if (inputObjectTypes.length === 1) {
|
|
8161
|
+
childNodeId = buildInputTypeNode(inputObjectTypes[0].type);
|
|
8162
|
+
} else {
|
|
8163
|
+
childNodeId = buildUnionNode(inputObjectTypes.map((iot) => iot.type));
|
|
8164
|
+
}
|
|
8165
|
+
}
|
|
8166
|
+
if (arg.isNullable) {
|
|
8167
|
+
flags |= EdgeFlag.Nullable;
|
|
8168
|
+
}
|
|
8169
|
+
if (flags === 0 && childNodeId === void 0) {
|
|
8170
|
+
return void 0;
|
|
8171
|
+
}
|
|
8172
|
+
const edge = { k: flags };
|
|
8173
|
+
if (childNodeId !== void 0) {
|
|
8174
|
+
edge.c = childNodeId;
|
|
8175
|
+
}
|
|
8176
|
+
if (scalarMask !== 0 && canParamScalar) {
|
|
8177
|
+
edge.m = scalarMask;
|
|
8178
|
+
}
|
|
8179
|
+
if (enumNameId !== void 0) {
|
|
8180
|
+
edge.e = enumNameId;
|
|
8181
|
+
}
|
|
8182
|
+
return edge;
|
|
8183
|
+
}
|
|
8184
|
+
function buildInputTypeNode(typeName) {
|
|
8185
|
+
if (builder.hasInputTypeNode(typeName)) {
|
|
8186
|
+
return builder.getInputTypeNode(typeName);
|
|
8187
|
+
}
|
|
8188
|
+
const inputType = inputTypeMap.get(typeName);
|
|
8189
|
+
if (!inputType) {
|
|
8190
|
+
builder.setInputTypeNode(typeName, void 0);
|
|
8191
|
+
return void 0;
|
|
8192
|
+
}
|
|
8193
|
+
const nodeId = builder.allocateInputNode();
|
|
8194
|
+
builder.setInputTypeNode(typeName, nodeId);
|
|
8195
|
+
const fields = {};
|
|
8196
|
+
let hasAnyField = false;
|
|
8197
|
+
for (const field of inputType.fields) {
|
|
8198
|
+
const edge = buildInputEdge(field);
|
|
8199
|
+
if (edge) {
|
|
8200
|
+
const stringIndex = builder.internString(field.name);
|
|
8201
|
+
fields[stringIndex] = edge;
|
|
8202
|
+
hasAnyField = true;
|
|
8203
|
+
}
|
|
8204
|
+
}
|
|
8205
|
+
if (hasAnyField) {
|
|
8206
|
+
builder.setInputNodeFields(nodeId, fields);
|
|
8207
|
+
return nodeId;
|
|
8208
|
+
}
|
|
8209
|
+
return nodeId;
|
|
8210
|
+
}
|
|
8211
|
+
function buildUnionNode(typeNames) {
|
|
8212
|
+
const sortedNames = [...typeNames].sort();
|
|
8213
|
+
const cacheKey = sortedNames.join("|");
|
|
8214
|
+
if (builder.hasUnionNode(cacheKey)) {
|
|
8215
|
+
return builder.getUnionNode(cacheKey);
|
|
8216
|
+
}
|
|
8217
|
+
const nodeId = builder.allocateInputNode();
|
|
8218
|
+
builder.setUnionNode(cacheKey, nodeId);
|
|
8219
|
+
const fieldsByName = /* @__PURE__ */ new Map();
|
|
8220
|
+
for (const typeName of typeNames) {
|
|
8221
|
+
const inputType = inputTypeMap.get(typeName);
|
|
8222
|
+
if (!inputType) continue;
|
|
8223
|
+
for (const field of inputType.fields) {
|
|
8224
|
+
let fieldsForName = fieldsByName.get(field.name);
|
|
8225
|
+
if (!fieldsForName) {
|
|
8226
|
+
fieldsForName = [];
|
|
8227
|
+
fieldsByName.set(field.name, fieldsForName);
|
|
8228
|
+
}
|
|
8229
|
+
fieldsForName.push(field);
|
|
8230
|
+
}
|
|
8231
|
+
}
|
|
8232
|
+
const mergedFields = {};
|
|
8233
|
+
let hasAnyField = false;
|
|
8234
|
+
for (const [fieldName, variantFields] of fieldsByName) {
|
|
8235
|
+
const mergedEdge = mergeFieldVariants(variantFields, typeNames.length);
|
|
8236
|
+
if (mergedEdge) {
|
|
8237
|
+
const stringIndex = builder.internString(fieldName);
|
|
8238
|
+
mergedFields[stringIndex] = mergedEdge;
|
|
8239
|
+
hasAnyField = true;
|
|
8240
|
+
}
|
|
8241
|
+
}
|
|
8242
|
+
if (hasAnyField) {
|
|
8243
|
+
builder.setInputNodeFields(nodeId, mergedFields);
|
|
8244
|
+
}
|
|
8245
|
+
return nodeId;
|
|
8246
|
+
}
|
|
8247
|
+
function mergeFieldVariants(variants, _totalVariants) {
|
|
8248
|
+
const parameterizableCount = variants.filter((v) => v.isParameterizable).length;
|
|
8249
|
+
const allAgreeOnParam = parameterizableCount === 0 || parameterizableCount === variants.length;
|
|
8250
|
+
if (!allAgreeOnParam) {
|
|
8251
|
+
}
|
|
8252
|
+
let combinedMask = 0;
|
|
8253
|
+
const masks = [];
|
|
8254
|
+
for (const variant of variants) {
|
|
8255
|
+
let variantMask = 0;
|
|
8256
|
+
for (const inputType of variant.inputTypes) {
|
|
8257
|
+
if (inputType.location === "scalar") {
|
|
8258
|
+
variantMask |= scalarTypeToMask(inputType.type);
|
|
8259
|
+
}
|
|
8260
|
+
}
|
|
8261
|
+
masks.push(variantMask);
|
|
8262
|
+
combinedMask |= variantMask;
|
|
8263
|
+
}
|
|
8264
|
+
const allAgreeOnScalars = masks.every((m) => m === masks[0]);
|
|
8265
|
+
const allObjectTypes = /* @__PURE__ */ new Set();
|
|
8266
|
+
let hasObjectList = false;
|
|
8267
|
+
let hasObject = false;
|
|
8268
|
+
for (const variant of variants) {
|
|
8269
|
+
for (const inputType of variant.inputTypes) {
|
|
8270
|
+
if (inputType.location === "inputObjectTypes") {
|
|
8271
|
+
allObjectTypes.add(inputType.type);
|
|
8272
|
+
if (inputType.isList) {
|
|
8273
|
+
hasObjectList = true;
|
|
8274
|
+
} else {
|
|
8275
|
+
hasObject = true;
|
|
8276
|
+
}
|
|
8277
|
+
}
|
|
8278
|
+
}
|
|
8279
|
+
}
|
|
8280
|
+
let flags = 0;
|
|
8281
|
+
let childNodeId;
|
|
8282
|
+
const canParamScalar = allAgreeOnParam && allAgreeOnScalars && variants.every((v) => v.isParameterizable) && combinedMask !== 0;
|
|
8283
|
+
if (canParamScalar) {
|
|
8284
|
+
const hasScalarList = variants.some((v) => v.inputTypes.some((it) => it.location === "scalar" && it.isList));
|
|
8285
|
+
if (hasScalarList) {
|
|
8286
|
+
flags |= EdgeFlag.ListScalar;
|
|
8287
|
+
} else {
|
|
8288
|
+
flags |= EdgeFlag.ParamScalar;
|
|
8289
|
+
}
|
|
8290
|
+
}
|
|
8291
|
+
if (allObjectTypes.size > 0) {
|
|
8292
|
+
if (hasObjectList) {
|
|
8293
|
+
flags |= EdgeFlag.ListObject;
|
|
8294
|
+
} else if (hasObject) {
|
|
8295
|
+
flags |= EdgeFlag.Object;
|
|
8296
|
+
}
|
|
8297
|
+
const objectTypeArray = [...allObjectTypes];
|
|
8298
|
+
if (objectTypeArray.length === 1) {
|
|
8299
|
+
childNodeId = buildInputTypeNode(objectTypeArray[0]);
|
|
8300
|
+
} else {
|
|
8301
|
+
childNodeId = buildUnionNode(objectTypeArray);
|
|
8302
|
+
}
|
|
8303
|
+
}
|
|
8304
|
+
if (variants.some((v) => v.isNullable)) {
|
|
8305
|
+
flags |= EdgeFlag.Nullable;
|
|
8306
|
+
}
|
|
8307
|
+
if (flags === 0 && childNodeId === void 0) {
|
|
8308
|
+
return void 0;
|
|
8309
|
+
}
|
|
8310
|
+
const edge = { k: flags };
|
|
8311
|
+
if (childNodeId !== void 0) {
|
|
8312
|
+
edge.c = childNodeId;
|
|
8313
|
+
}
|
|
8314
|
+
if (canParamScalar && combinedMask !== 0) {
|
|
8315
|
+
edge.m = combinedMask;
|
|
8316
|
+
}
|
|
8317
|
+
return edge;
|
|
8318
|
+
}
|
|
8319
|
+
function buildOutputTypeNode(typeName) {
|
|
8320
|
+
if (builder.hasOutputTypeNode(typeName)) {
|
|
8321
|
+
return builder.getOutputTypeNode(typeName);
|
|
8322
|
+
}
|
|
8323
|
+
const outputType = outputTypeMap.get(typeName);
|
|
8324
|
+
if (!outputType) {
|
|
8325
|
+
builder.setOutputTypeNode(typeName, void 0);
|
|
8326
|
+
return void 0;
|
|
8327
|
+
}
|
|
8328
|
+
const nodeId = builder.allocateOutputNode();
|
|
8329
|
+
builder.setOutputTypeNode(typeName, nodeId);
|
|
8330
|
+
const fields = {};
|
|
8331
|
+
let hasAnyField = false;
|
|
8332
|
+
for (const field of outputType.fields) {
|
|
8333
|
+
const edge = buildOutputEdge(field);
|
|
8334
|
+
if (edge) {
|
|
8335
|
+
const stringIndex = builder.internString(field.name);
|
|
8336
|
+
fields[stringIndex] = edge;
|
|
8337
|
+
hasAnyField = true;
|
|
8338
|
+
}
|
|
8339
|
+
}
|
|
8340
|
+
if (hasAnyField) {
|
|
8341
|
+
builder.setOutputNodeFields(nodeId, fields);
|
|
8342
|
+
return nodeId;
|
|
8343
|
+
}
|
|
8344
|
+
return nodeId;
|
|
8345
|
+
}
|
|
8346
|
+
function buildOutputEdge(field) {
|
|
8347
|
+
let argsNodeId;
|
|
8348
|
+
let childOutputNodeId;
|
|
8349
|
+
if (field.args.length > 0) {
|
|
8350
|
+
argsNodeId = buildInputNodeFromArgs(field.args);
|
|
8351
|
+
}
|
|
8352
|
+
if (field.outputType.location === "outputObjectTypes") {
|
|
8353
|
+
childOutputNodeId = buildOutputTypeNode(field.outputType.type);
|
|
8354
|
+
}
|
|
8355
|
+
if (argsNodeId === void 0 && childOutputNodeId === void 0) {
|
|
8356
|
+
return void 0;
|
|
8357
|
+
}
|
|
8358
|
+
const edge = {};
|
|
8359
|
+
if (argsNodeId !== void 0) {
|
|
8360
|
+
edge.a = argsNodeId;
|
|
8361
|
+
}
|
|
8362
|
+
if (childOutputNodeId !== void 0) {
|
|
8363
|
+
edge.o = childOutputNodeId;
|
|
8364
|
+
}
|
|
8365
|
+
return edge;
|
|
8366
|
+
}
|
|
8367
|
+
for (const mapping of dmmf.mappings.modelOperations) {
|
|
8368
|
+
const modelName = mapping.model;
|
|
8369
|
+
const actions = Object.keys(ModelAction);
|
|
8370
|
+
for (const action2 of actions) {
|
|
8371
|
+
const fieldName = mapping[action2];
|
|
8372
|
+
if (!fieldName) continue;
|
|
8373
|
+
let rootField;
|
|
8374
|
+
const queryType = outputTypeMap.get("Query");
|
|
8375
|
+
if (queryType) {
|
|
8376
|
+
rootField = queryType.fields.find((f) => f.name === fieldName);
|
|
8377
|
+
}
|
|
8378
|
+
if (!rootField) {
|
|
8379
|
+
const mutationType = outputTypeMap.get("Mutation");
|
|
8380
|
+
if (mutationType) {
|
|
8381
|
+
rootField = mutationType.fields.find((f) => f.name === fieldName);
|
|
8382
|
+
}
|
|
8383
|
+
}
|
|
8384
|
+
if (!rootField) continue;
|
|
8385
|
+
const argsNodeId = buildInputNodeFromArgs(rootField.args);
|
|
8386
|
+
let outputNodeId;
|
|
8387
|
+
if (rootField.outputType.location === "outputObjectTypes") {
|
|
8388
|
+
outputNodeId = buildOutputTypeNode(rootField.outputType.type);
|
|
8389
|
+
}
|
|
8390
|
+
const dmmfActionToJsonAction = {
|
|
8391
|
+
create: "createOne",
|
|
8392
|
+
update: "updateOne",
|
|
8393
|
+
delete: "deleteOne",
|
|
8394
|
+
upsert: "upsertOne"
|
|
8395
|
+
};
|
|
8396
|
+
const jsonAction = dmmfActionToJsonAction[action2] ?? action2;
|
|
8397
|
+
const rootKey = `${modelName}.${jsonAction}`;
|
|
8398
|
+
builder.setRoot(rootKey, { a: argsNodeId, o: outputNodeId });
|
|
8399
|
+
}
|
|
8400
|
+
}
|
|
8401
|
+
return builder.build();
|
|
8402
|
+
}
|
|
8403
|
+
|
|
7872
8404
|
// ../client-generator-js/src/TSClient/TSClient.ts
|
|
7873
8405
|
var import_indent_string7 = __toESM(require_indent_string());
|
|
7874
8406
|
|
|
@@ -9326,6 +9858,11 @@ var TSClient = class {
|
|
|
9326
9858
|
}
|
|
9327
9859
|
dmmf;
|
|
9328
9860
|
genericsInfo;
|
|
9861
|
+
buildParamGraphConfig() {
|
|
9862
|
+
const paramGraph = buildParamGraph(this.options.dmmf);
|
|
9863
|
+
const paramGraphJson = JSON.stringify(JSON.stringify(paramGraph));
|
|
9864
|
+
return `config.parameterizationSchema = JSON.parse(${paramGraphJson})`;
|
|
9865
|
+
}
|
|
9329
9866
|
toJS() {
|
|
9330
9867
|
const { edge, wasm, generator, datamodel: inlineSchema, runtimeName, reusedJs, compilerBuild } = this.options;
|
|
9331
9868
|
if (reusedJs) {
|
|
@@ -9359,6 +9896,7 @@ ${new Enum(
|
|
|
9359
9896
|
*/
|
|
9360
9897
|
const config = ${JSON.stringify(config, null, 2)}
|
|
9361
9898
|
${buildRuntimeDataModel(this.dmmf.datamodel, runtimeName)}
|
|
9899
|
+
${this.buildParamGraphConfig()}
|
|
9362
9900
|
${buildQueryCompilerWasmModule(wasm, runtimeName, compilerBuild)}
|
|
9363
9901
|
${buildDebugInitialization(edge)}
|
|
9364
9902
|
const PrismaClient = getPrismaClient(config)
|
|
@@ -10325,7 +10863,7 @@ var import_node_path4 = __toESM(require("node:path"));
|
|
|
10325
10863
|
var import_engines_version = __toESM(require_engines_version());
|
|
10326
10864
|
|
|
10327
10865
|
// ../client-generator-js/package.json
|
|
10328
|
-
var version = "7.3.0-integration-
|
|
10866
|
+
var version = "7.3.0-integration-parameterization.4";
|
|
10329
10867
|
|
|
10330
10868
|
// ../client-generator-js/src/resolvePrismaClient.ts
|
|
10331
10869
|
var import_promises5 = __toESM(require("node:fs/promises"));
|
|
@@ -12690,7 +13228,7 @@ var supportsColor_1 = {
|
|
|
12690
13228
|
stderr: translateLevel(supportsColor$1(true, tty.isatty(2)))
|
|
12691
13229
|
};
|
|
12692
13230
|
var supportsColor = supportsColor_1;
|
|
12693
|
-
var
|
|
13231
|
+
var hasFlag2 = hasFlag$2;
|
|
12694
13232
|
function parseVersion(versionString) {
|
|
12695
13233
|
if (/^\d{3,4}$/.test(versionString)) {
|
|
12696
13234
|
const m = /(\d{1,2})(\d{2})/.exec(versionString);
|
|
@@ -12712,10 +13250,10 @@ function supportsHyperlink(stream) {
|
|
|
12712
13250
|
if ("FORCE_HYPERLINK" in env2) {
|
|
12713
13251
|
return !(env2.FORCE_HYPERLINK.length > 0 && parseInt(env2.FORCE_HYPERLINK, 10) === 0);
|
|
12714
13252
|
}
|
|
12715
|
-
if (
|
|
13253
|
+
if (hasFlag2("no-hyperlink") || hasFlag2("no-hyperlinks") || hasFlag2("hyperlink=false") || hasFlag2("hyperlink=never")) {
|
|
12716
13254
|
return false;
|
|
12717
13255
|
}
|
|
12718
|
-
if (
|
|
13256
|
+
if (hasFlag2("hyperlink=true") || hasFlag2("hyperlink=always")) {
|
|
12719
13257
|
return true;
|
|
12720
13258
|
}
|
|
12721
13259
|
if (!supportsColor.supportsColor(stream)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client",
|
|
3
|
-
"version": "7.3.0-integration-
|
|
3
|
+
"version": "7.3.0-integration-parameterization.4",
|
|
4
4
|
"description": "Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ORM",
|
|
@@ -218,39 +218,41 @@
|
|
|
218
218
|
"typescript": "5.4.5",
|
|
219
219
|
"undici": "7.4.0",
|
|
220
220
|
"zx": "8.4.1",
|
|
221
|
-
"@prisma/adapter-
|
|
222
|
-
"@prisma/adapter-libsql": "7.3.0-integration-
|
|
223
|
-
"@prisma/adapter-
|
|
224
|
-
"@prisma/adapter-
|
|
225
|
-
"@prisma/adapter-mssql": "7.3.0-integration-
|
|
226
|
-
"@prisma/adapter-neon": "7.3.0-integration-
|
|
227
|
-
"@prisma/adapter-
|
|
228
|
-
"@prisma/
|
|
229
|
-
"@prisma/
|
|
230
|
-
"@prisma/client-engine-runtime": "7.3.0-integration-
|
|
231
|
-
"@prisma/client-generator-js": "7.3.0-integration-
|
|
232
|
-
"@prisma/client-generator-ts": "7.3.0-integration-
|
|
233
|
-
"@prisma/
|
|
234
|
-
"@prisma/
|
|
235
|
-
"@prisma/dmmf": "7.3.0-integration-
|
|
236
|
-
"@prisma/
|
|
237
|
-
"@prisma/
|
|
238
|
-
"@prisma/
|
|
239
|
-
"@prisma/
|
|
240
|
-
"@prisma/generator
|
|
241
|
-
"@prisma/
|
|
242
|
-
"@prisma/
|
|
243
|
-
"@prisma/instrumentation-contract": "7.3.0-integration-
|
|
244
|
-
"@prisma/
|
|
245
|
-
"@prisma/
|
|
246
|
-
"@prisma/migrate": "7.3.0-integration-
|
|
247
|
-
"@prisma/
|
|
248
|
-
"@prisma/query-plan-executor": "7.3.0-integration-
|
|
249
|
-
"@prisma/
|
|
250
|
-
"@prisma/
|
|
221
|
+
"@prisma/adapter-better-sqlite3": "7.3.0-integration-parameterization.4",
|
|
222
|
+
"@prisma/adapter-libsql": "7.3.0-integration-parameterization.4",
|
|
223
|
+
"@prisma/adapter-d1": "7.3.0-integration-parameterization.4",
|
|
224
|
+
"@prisma/adapter-mariadb": "7.3.0-integration-parameterization.4",
|
|
225
|
+
"@prisma/adapter-mssql": "7.3.0-integration-parameterization.4",
|
|
226
|
+
"@prisma/adapter-neon": "7.3.0-integration-parameterization.4",
|
|
227
|
+
"@prisma/adapter-pg": "7.3.0-integration-parameterization.4",
|
|
228
|
+
"@prisma/client-common": "7.3.0-integration-parameterization.4",
|
|
229
|
+
"@prisma/adapter-planetscale": "7.3.0-integration-parameterization.4",
|
|
230
|
+
"@prisma/client-engine-runtime": "7.3.0-integration-parameterization.4",
|
|
231
|
+
"@prisma/client-generator-js": "7.3.0-integration-parameterization.4",
|
|
232
|
+
"@prisma/client-generator-ts": "7.3.0-integration-parameterization.4",
|
|
233
|
+
"@prisma/debug": "7.3.0-integration-parameterization.4",
|
|
234
|
+
"@prisma/config": "7.3.0-integration-parameterization.4",
|
|
235
|
+
"@prisma/dmmf": "7.3.0-integration-parameterization.4",
|
|
236
|
+
"@prisma/driver-adapter-utils": "7.3.0-integration-parameterization.4",
|
|
237
|
+
"@prisma/engines": "7.3.0-integration-parameterization.4",
|
|
238
|
+
"@prisma/fetch-engine": "7.3.0-integration-parameterization.4",
|
|
239
|
+
"@prisma/get-platform": "7.3.0-integration-parameterization.4",
|
|
240
|
+
"@prisma/generator": "7.3.0-integration-parameterization.4",
|
|
241
|
+
"@prisma/generator-helper": "7.3.0-integration-parameterization.4",
|
|
242
|
+
"@prisma/internals": "7.3.0-integration-parameterization.4",
|
|
243
|
+
"@prisma/instrumentation-contract": "7.3.0-integration-parameterization.4",
|
|
244
|
+
"@prisma/json-protocol": "7.3.0-integration-parameterization.4",
|
|
245
|
+
"@prisma/instrumentation": "7.3.0-integration-parameterization.4",
|
|
246
|
+
"@prisma/migrate": "7.3.0-integration-parameterization.4",
|
|
247
|
+
"@prisma/param-graph": "7.3.0-integration-parameterization.4",
|
|
248
|
+
"@prisma/query-plan-executor": "7.3.0-integration-parameterization.4",
|
|
249
|
+
"@prisma/param-graph-builder": "7.3.0-integration-parameterization.4",
|
|
250
|
+
"@prisma/sqlcommenter-trace-context": "7.3.0-integration-parameterization.4",
|
|
251
|
+
"@prisma/ts-builders": "7.3.0-integration-parameterization.4",
|
|
252
|
+
"@prisma/sqlcommenter": "7.3.0-integration-parameterization.4"
|
|
251
253
|
},
|
|
252
254
|
"dependencies": {
|
|
253
|
-
"@prisma/client-runtime-utils": "7.3.0-integration-
|
|
255
|
+
"@prisma/client-runtime-utils": "7.3.0-integration-parameterization.4"
|
|
254
256
|
},
|
|
255
257
|
"peerDependencies": {
|
|
256
258
|
"prisma": "*",
|