@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.
@@ -797,6 +797,15 @@ declare interface EngineConfig {
797
797
  * Each plugin receives query context and returns key-value pairs.
798
798
  */
799
799
  sqlCommenters?: SqlCommenterPlugin[];
800
+ /**
801
+ * Parameterization schema (ParamGraph) for schema-aware query parameterization.
802
+ * Enables precise parameterization based on DMMF metadata.
803
+ */
804
+ parameterizationSchema: ParamGraph;
805
+ /**
806
+ * Runtime data model for enum lookups during parameterization.
807
+ */
808
+ runtimeDataModel: RuntimeDataModel;
800
809
  }
801
810
 
802
811
  declare type EngineEvent<E extends EngineEventType> = E extends QueryEventType ? QueryEvent : LogEvent;
@@ -1296,6 +1305,11 @@ export declare type GetPrismaClientConfig = {
1296
1305
  * Optional wasm loading configuration
1297
1306
  */
1298
1307
  compilerWasm?: CompilerWasmLoadingConfig;
1308
+ /**
1309
+ * Parameterization schema for schema-aware query parameterization.
1310
+ * Enables precise parameterization based on DMMF metadata.
1311
+ */
1312
+ parameterizationSchema: ParamGraph;
1299
1313
  };
1300
1314
 
1301
1315
  export declare type GetResult<Payload extends OperationPayload, Args, OperationName extends Operation = 'findUniqueOrThrow', GlobalOmitOptions = {}> = {
@@ -1398,6 +1412,35 @@ declare type InMemoryOps = {
1398
1412
  nested: Record<string, InMemoryOps>;
1399
1413
  };
1400
1414
 
1415
+ /**
1416
+ * Edge descriptor for input fields.
1417
+ * Encodes what kinds of values the field accepts and how to handle them.
1418
+ */
1419
+ declare type InputEdge = {
1420
+ /**
1421
+ * Bit flags describing field capabilities.
1422
+ * See EdgeFlag enum below.
1423
+ */
1424
+ k: number;
1425
+ /**
1426
+ * Child input node id (for object values or list of objects).
1427
+ * Present when the field accepts input object types.
1428
+ */
1429
+ c?: NodeId;
1430
+ /**
1431
+ * Scalar type mask for allowed scalar categories.
1432
+ * Present when field accepts scalar values.
1433
+ * See ScalarMask enum below.
1434
+ */
1435
+ m?: number;
1436
+ /**
1437
+ * Enum name id (index into `en` array).
1438
+ * Present when field accepts a user enum without a plain String scalar.
1439
+ * Used for runtime membership validation.
1440
+ */
1441
+ e?: number;
1442
+ };
1443
+
1401
1444
  /**
1402
1445
  * Matches a JSON array.
1403
1446
  * Unlike \`JsonArray\`, readonly arrays are assignable to this type.
@@ -1430,6 +1473,19 @@ export declare type InputJsonValue = string | number | boolean | InputJsonObject
1430
1473
  toJSON(): unknown;
1431
1474
  };
1432
1475
 
1476
+ /**
1477
+ * Input node: describes parameterizable fields in an input object.
1478
+ * Only fields that are parameterizable or lead to parameterizable
1479
+ * descendants are present.
1480
+ */
1481
+ declare type InputNode = {
1482
+ /**
1483
+ * Map from string-table index to edge descriptor.
1484
+ * Omitted if the node has no fields (shouldn't happen in practice).
1485
+ */
1486
+ f?: Record<number, InputEdge>;
1487
+ };
1488
+
1433
1489
  declare type InputType = ReadonlyDeep_2<{
1434
1490
  name: string;
1435
1491
  constraints: {
@@ -1845,6 +1901,11 @@ export declare type Narrowable = string | number | bigint | boolean | [];
1845
1901
 
1846
1902
  export declare type NeverToUnknown<T> = [T] extends [never] ? unknown : T;
1847
1903
 
1904
+ /**
1905
+ * Node ID is an index into `i` or `o` array.
1906
+ */
1907
+ declare type NodeId = number;
1908
+
1848
1909
  export { NullTypes }
1849
1910
 
1850
1911
  export { ObjectEnumValue }
@@ -1914,6 +1975,27 @@ declare type OtherOperationMappings = ReadonlyDeep_2<{
1914
1975
  write: string[];
1915
1976
  }>;
1916
1977
 
1978
+ /**
1979
+ * Edge descriptor for output fields.
1980
+ */
1981
+ declare type OutputEdge = {
1982
+ /** Args node for this field (if it accepts arguments) */
1983
+ a?: NodeId;
1984
+ /** Next output node for nested selection traversal */
1985
+ o?: NodeId;
1986
+ };
1987
+
1988
+ /**
1989
+ * Output node: describes fields in a selection set that have args
1990
+ * or nested selections that may contain parameterizable args.
1991
+ */
1992
+ declare type OutputNode = {
1993
+ /**
1994
+ * Map from string-table index to edge descriptor.
1995
+ */
1996
+ f?: Record<number, OutputEdge>;
1997
+ };
1998
+
1917
1999
  declare type OutputType = ReadonlyDeep_2<{
1918
2000
  name: string;
1919
2001
  fields: SchemaField[];
@@ -1933,6 +2015,47 @@ export declare type Param<out $Type, $Value extends string> = {
1933
2015
  readonly name: $Value;
1934
2016
  };
1935
2017
 
2018
+ /**
2019
+ * ParamGraph: Compact schema for runtime parameterization.
2020
+ *
2021
+ * This data structure is generated from DMMF at client generation time
2022
+ * and embedded in the generated client. It enables schema-aware
2023
+ * parameterization where values are only parameterized when both schema
2024
+ * rules and runtime value types agree.
2025
+ */
2026
+ /**
2027
+ * Compact schema embedded in the generated client.
2028
+ */
2029
+ declare type ParamGraph = {
2030
+ /**
2031
+ * String table to avoid repeating field names.
2032
+ * Field names are referenced by index throughout the graph.
2033
+ */
2034
+ s: string[];
2035
+ /**
2036
+ * User enum names for runtime membership checks.
2037
+ * Values are looked up via `runtimeDataModel.enums[enumName].values`.
2038
+ */
2039
+ en: string[];
2040
+ /**
2041
+ * Input nodes used for argument objects and input types.
2042
+ * Each node describes which fields are parameterizable or lead to
2043
+ * parameterizable descendants.
2044
+ */
2045
+ i: InputNode[];
2046
+ /**
2047
+ * Output nodes used for selection traversal.
2048
+ * Each node describes which fields have arguments or lead to
2049
+ * nested selections with arguments.
2050
+ */
2051
+ o: OutputNode[];
2052
+ /**
2053
+ * Root mapping: "Model.action" or "action" (for non-model ops).
2054
+ * Points to the args node (input) and root output node.
2055
+ */
2056
+ r: Record<string, RootEntry>;
2057
+ };
2058
+
1936
2059
  export declare type PatchFlat<O1, O2> = O1 & Omit_2<O2, keyof O1>;
1937
2060
 
1938
2061
  export declare type Path<O, P, Default = never> = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path<O[K], R> : Default : O : never;
@@ -2538,6 +2661,16 @@ declare type ResultNode = {
2538
2661
 
2539
2662
  export declare type Return<T> = T extends (...args: any[]) => infer R ? R : T;
2540
2663
 
2664
+ /**
2665
+ * Entry point for a root operation.
2666
+ */
2667
+ declare type RootEntry = {
2668
+ /** Args node id (into `i` array) */
2669
+ a?: NodeId;
2670
+ /** Output node id (into `o` array) */
2671
+ o?: NodeId;
2672
+ };
2673
+
2541
2674
  export declare type RuntimeDataModel = {
2542
2675
  readonly models: Record<string, RuntimeModel>;
2543
2676
  readonly enums: Record<string, RuntimeEnum>;
@@ -2576,6 +2709,7 @@ declare type SchemaArg = ReadonlyDeep_2<{
2576
2709
  isNullable: boolean;
2577
2710
  isRequired: boolean;
2578
2711
  inputTypes: InputTypeRef[];
2712
+ isParameterizable: boolean;
2579
2713
  requiresOtherFields?: string[];
2580
2714
  deprecation?: Deprecation;
2581
2715
  }>;
@@ -797,6 +797,15 @@ declare interface EngineConfig {
797
797
  * Each plugin receives query context and returns key-value pairs.
798
798
  */
799
799
  sqlCommenters?: SqlCommenterPlugin[];
800
+ /**
801
+ * Parameterization schema (ParamGraph) for schema-aware query parameterization.
802
+ * Enables precise parameterization based on DMMF metadata.
803
+ */
804
+ parameterizationSchema: ParamGraph;
805
+ /**
806
+ * Runtime data model for enum lookups during parameterization.
807
+ */
808
+ runtimeDataModel: RuntimeDataModel;
800
809
  }
801
810
 
802
811
  declare type EngineEvent<E extends EngineEventType> = E extends QueryEventType ? QueryEvent : LogEvent;
@@ -1296,6 +1305,11 @@ export declare type GetPrismaClientConfig = {
1296
1305
  * Optional wasm loading configuration
1297
1306
  */
1298
1307
  compilerWasm?: CompilerWasmLoadingConfig;
1308
+ /**
1309
+ * Parameterization schema for schema-aware query parameterization.
1310
+ * Enables precise parameterization based on DMMF metadata.
1311
+ */
1312
+ parameterizationSchema: ParamGraph;
1299
1313
  };
1300
1314
 
1301
1315
  export declare type GetResult<Payload extends OperationPayload, Args, OperationName extends Operation = 'findUniqueOrThrow', GlobalOmitOptions = {}> = {
@@ -1398,6 +1412,35 @@ declare type InMemoryOps = {
1398
1412
  nested: Record<string, InMemoryOps>;
1399
1413
  };
1400
1414
 
1415
+ /**
1416
+ * Edge descriptor for input fields.
1417
+ * Encodes what kinds of values the field accepts and how to handle them.
1418
+ */
1419
+ declare type InputEdge = {
1420
+ /**
1421
+ * Bit flags describing field capabilities.
1422
+ * See EdgeFlag enum below.
1423
+ */
1424
+ k: number;
1425
+ /**
1426
+ * Child input node id (for object values or list of objects).
1427
+ * Present when the field accepts input object types.
1428
+ */
1429
+ c?: NodeId;
1430
+ /**
1431
+ * Scalar type mask for allowed scalar categories.
1432
+ * Present when field accepts scalar values.
1433
+ * See ScalarMask enum below.
1434
+ */
1435
+ m?: number;
1436
+ /**
1437
+ * Enum name id (index into `en` array).
1438
+ * Present when field accepts a user enum without a plain String scalar.
1439
+ * Used for runtime membership validation.
1440
+ */
1441
+ e?: number;
1442
+ };
1443
+
1401
1444
  /**
1402
1445
  * Matches a JSON array.
1403
1446
  * Unlike \`JsonArray\`, readonly arrays are assignable to this type.
@@ -1430,6 +1473,19 @@ export declare type InputJsonValue = string | number | boolean | InputJsonObject
1430
1473
  toJSON(): unknown;
1431
1474
  };
1432
1475
 
1476
+ /**
1477
+ * Input node: describes parameterizable fields in an input object.
1478
+ * Only fields that are parameterizable or lead to parameterizable
1479
+ * descendants are present.
1480
+ */
1481
+ declare type InputNode = {
1482
+ /**
1483
+ * Map from string-table index to edge descriptor.
1484
+ * Omitted if the node has no fields (shouldn't happen in practice).
1485
+ */
1486
+ f?: Record<number, InputEdge>;
1487
+ };
1488
+
1433
1489
  declare type InputType = ReadonlyDeep_2<{
1434
1490
  name: string;
1435
1491
  constraints: {
@@ -1845,6 +1901,11 @@ export declare type Narrowable = string | number | bigint | boolean | [];
1845
1901
 
1846
1902
  export declare type NeverToUnknown<T> = [T] extends [never] ? unknown : T;
1847
1903
 
1904
+ /**
1905
+ * Node ID is an index into `i` or `o` array.
1906
+ */
1907
+ declare type NodeId = number;
1908
+
1848
1909
  export { NullTypes }
1849
1910
 
1850
1911
  export { ObjectEnumValue }
@@ -1914,6 +1975,27 @@ declare type OtherOperationMappings = ReadonlyDeep_2<{
1914
1975
  write: string[];
1915
1976
  }>;
1916
1977
 
1978
+ /**
1979
+ * Edge descriptor for output fields.
1980
+ */
1981
+ declare type OutputEdge = {
1982
+ /** Args node for this field (if it accepts arguments) */
1983
+ a?: NodeId;
1984
+ /** Next output node for nested selection traversal */
1985
+ o?: NodeId;
1986
+ };
1987
+
1988
+ /**
1989
+ * Output node: describes fields in a selection set that have args
1990
+ * or nested selections that may contain parameterizable args.
1991
+ */
1992
+ declare type OutputNode = {
1993
+ /**
1994
+ * Map from string-table index to edge descriptor.
1995
+ */
1996
+ f?: Record<number, OutputEdge>;
1997
+ };
1998
+
1917
1999
  declare type OutputType = ReadonlyDeep_2<{
1918
2000
  name: string;
1919
2001
  fields: SchemaField[];
@@ -1933,6 +2015,47 @@ export declare type Param<out $Type, $Value extends string> = {
1933
2015
  readonly name: $Value;
1934
2016
  };
1935
2017
 
2018
+ /**
2019
+ * ParamGraph: Compact schema for runtime parameterization.
2020
+ *
2021
+ * This data structure is generated from DMMF at client generation time
2022
+ * and embedded in the generated client. It enables schema-aware
2023
+ * parameterization where values are only parameterized when both schema
2024
+ * rules and runtime value types agree.
2025
+ */
2026
+ /**
2027
+ * Compact schema embedded in the generated client.
2028
+ */
2029
+ declare type ParamGraph = {
2030
+ /**
2031
+ * String table to avoid repeating field names.
2032
+ * Field names are referenced by index throughout the graph.
2033
+ */
2034
+ s: string[];
2035
+ /**
2036
+ * User enum names for runtime membership checks.
2037
+ * Values are looked up via `runtimeDataModel.enums[enumName].values`.
2038
+ */
2039
+ en: string[];
2040
+ /**
2041
+ * Input nodes used for argument objects and input types.
2042
+ * Each node describes which fields are parameterizable or lead to
2043
+ * parameterizable descendants.
2044
+ */
2045
+ i: InputNode[];
2046
+ /**
2047
+ * Output nodes used for selection traversal.
2048
+ * Each node describes which fields have arguments or lead to
2049
+ * nested selections with arguments.
2050
+ */
2051
+ o: OutputNode[];
2052
+ /**
2053
+ * Root mapping: "Model.action" or "action" (for non-model ops).
2054
+ * Points to the args node (input) and root output node.
2055
+ */
2056
+ r: Record<string, RootEntry>;
2057
+ };
2058
+
1936
2059
  export declare type PatchFlat<O1, O2> = O1 & Omit_2<O2, keyof O1>;
1937
2060
 
1938
2061
  export declare type Path<O, P, Default = never> = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path<O[K], R> : Default : O : never;
@@ -2538,6 +2661,16 @@ declare type ResultNode = {
2538
2661
 
2539
2662
  export declare type Return<T> = T extends (...args: any[]) => infer R ? R : T;
2540
2663
 
2664
+ /**
2665
+ * Entry point for a root operation.
2666
+ */
2667
+ declare type RootEntry = {
2668
+ /** Args node id (into `i` array) */
2669
+ a?: NodeId;
2670
+ /** Output node id (into `o` array) */
2671
+ o?: NodeId;
2672
+ };
2673
+
2541
2674
  export declare type RuntimeDataModel = {
2542
2675
  readonly models: Record<string, RuntimeModel>;
2543
2676
  readonly enums: Record<string, RuntimeEnum>;
@@ -2576,6 +2709,7 @@ declare type SchemaArg = ReadonlyDeep_2<{
2576
2709
  isNullable: boolean;
2577
2710
  isRequired: boolean;
2578
2711
  inputTypes: InputTypeRef[];
2712
+ isParameterizable: boolean;
2579
2713
  requiresOtherFields?: string[];
2580
2714
  deprecation?: Deprecation;
2581
2715
  }>;