@prisma/client-engine-runtime 6.14.0-dev.4 → 6.14.0-dev.40

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.
@@ -1,4 +1,4 @@
1
- import { ResultNode } from '../QueryPlan';
1
+ import { ResultNode } from '../query-plan';
2
2
  import { Value } from './scope';
3
3
  export declare class DataMapperError extends Error {
4
4
  name: string;
@@ -0,0 +1,3 @@
1
+ import { InMemoryOps } from '../query-plan';
2
+ export declare function processRecords(value: unknown, ops: InMemoryOps): unknown;
3
+ export declare function getRecordKey(record: {}, fields: string[]): string;
@@ -1,9 +1,9 @@
1
- import { SqlQueryable, SqlResultSet } from '@prisma/driver-adapter-utils';
1
+ import { ConnectionInfo, SqlQueryable, SqlResultSet } from '@prisma/driver-adapter-utils';
2
2
  import { QueryEvent } from '../events';
3
- import { QueryPlanNode } from '../QueryPlan';
3
+ import { QueryPlanNode } from '../query-plan';
4
4
  import { type SchemaProvider } from '../schema';
5
5
  import { type TracingHelper } from '../tracing';
6
- import { type TransactionManager } from '../transactionManager/TransactionManager';
6
+ import { type TransactionManager } from '../transaction-manager/transaction-manager';
7
7
  import { Value } from './scope';
8
8
  export type QueryInterpreterTransactionManager = {
9
9
  enabled: true;
@@ -19,16 +19,18 @@ export type QueryInterpreterOptions = {
19
19
  serializer: (results: SqlResultSet) => Value;
20
20
  rawSerializer?: (results: SqlResultSet) => Value;
21
21
  provider?: SchemaProvider;
22
+ connectionInfo?: ConnectionInfo;
22
23
  };
23
24
  export declare class QueryInterpreter {
24
25
  #private;
25
- constructor({ transactionManager, placeholderValues, onQuery, tracingHelper, serializer, rawSerializer, provider, }: QueryInterpreterOptions);
26
+ constructor({ transactionManager, placeholderValues, onQuery, tracingHelper, serializer, rawSerializer, provider, connectionInfo, }: QueryInterpreterOptions);
26
27
  static forSql(options: {
27
28
  transactionManager: QueryInterpreterTransactionManager;
28
29
  placeholderValues: Record<string, unknown>;
29
30
  onQuery?: (event: QueryEvent) => void;
30
31
  tracingHelper: TracingHelper;
31
32
  provider?: SchemaProvider;
33
+ connectionInfo?: ConnectionInfo;
32
34
  }): QueryInterpreter;
33
35
  run(queryPlan: QueryPlanNode, queryable: SqlQueryable): Promise<unknown>;
34
36
  private interpretNode;
@@ -1,6 +1,6 @@
1
1
  import { SqlQuery } from '@prisma/driver-adapter-utils';
2
- import type { PrismaValue, QueryPlanDbQuery } from '../QueryPlan';
2
+ import type { PrismaValue, QueryPlanDbQuery } from '../query-plan';
3
3
  import { GeneratorRegistrySnapshot } from './generators';
4
4
  import { ScopeBindings } from './scope';
5
- export declare function renderQuery(dbQuery: QueryPlanDbQuery, scope: ScopeBindings, generators: GeneratorRegistrySnapshot): SqlQuery;
5
+ export declare function renderQuery(dbQuery: QueryPlanDbQuery, scope: ScopeBindings, generators: GeneratorRegistrySnapshot, maxChunkSize?: number): SqlQuery[];
6
6
  export declare function evaluateParam(param: PrismaValue, scope: ScopeBindings, generators: GeneratorRegistrySnapshot): unknown;
@@ -1,3 +1,3 @@
1
- import { DataRule, ValidationError } from '../QueryPlan';
1
+ import { DataRule, ValidationError } from '../query-plan';
2
2
  export declare function performValidation(data: unknown, rules: DataRule[], error: ValidationError): void;
3
3
  export declare function doesSatisfyRule(data: unknown, rule: DataRule): boolean;
@@ -1,3 +1,4 @@
1
+ import { Decimal } from 'decimal.js';
1
2
  export type DateTaggedValue = {
2
3
  $type: 'DateTime';
3
4
  value: string;
@@ -30,4 +31,8 @@ export type JsonTaggedValue = {
30
31
  };
31
32
  export type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue;
32
33
  export type JsonOutputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | JsonTaggedValue;
34
+ export type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | {
35
+ [key: string]: JsOutputValue;
36
+ };
33
37
  export declare function normalizeJsonProtocolValues(result: unknown): unknown;
38
+ export declare function deserializeJsonResponse(result: unknown): unknown;
@@ -46,6 +46,8 @@ export type PrismaValueType = {
46
46
  } | {
47
47
  type: 'Array';
48
48
  inner: PrismaValueType;
49
+ } | {
50
+ type: 'Json';
49
51
  } | {
50
52
  type: 'Object';
51
53
  } | {
@@ -60,6 +62,7 @@ export type ResultNode = {
60
62
  type: 'Object';
61
63
  fields: Record<string, ResultNode>;
62
64
  serializedName: string | null;
65
+ skipNulls: boolean;
63
66
  } | {
64
67
  type: 'Value';
65
68
  dbName: string;
@@ -78,6 +81,7 @@ export type QueryPlanDbQuery = {
78
81
  fragments: Fragment[];
79
82
  placeholderFormat: PlaceholderFormat;
80
83
  params: PrismaValue[];
84
+ chunkable: boolean;
81
85
  };
82
86
  export type Fragment = {
83
87
  type: 'stringChunk';
@@ -190,18 +194,6 @@ export type QueryPlanNode = {
190
194
  from: QueryPlanNode;
191
195
  to: QueryPlanNode;
192
196
  };
193
- } | {
194
- type: 'distinctBy';
195
- args: {
196
- expr: QueryPlanNode;
197
- fields: string[];
198
- };
199
- } | {
200
- type: 'paginate';
201
- args: {
202
- expr: QueryPlanNode;
203
- pagination: Pagination;
204
- };
205
197
  } | {
206
198
  type: 'initializeRecord';
207
199
  args: {
@@ -214,6 +206,12 @@ export type QueryPlanNode = {
214
206
  expr: QueryPlanNode;
215
207
  fields: Record<string, FieldOperation>;
216
208
  };
209
+ } | {
210
+ type: 'process';
211
+ args: {
212
+ expr: QueryPlanNode;
213
+ operations: InMemoryOps;
214
+ };
217
215
  };
218
216
  export type FieldInitializer = {
219
217
  type: 'value';
@@ -241,7 +239,13 @@ export type Pagination = {
241
239
  cursor: Record<string, PrismaValue> | null;
242
240
  take: number | null;
243
241
  skip: number | null;
242
+ };
243
+ export type InMemoryOps = {
244
+ pagination: Pagination | null;
245
+ distinct: string[] | null;
246
+ reverse: boolean;
244
247
  linkingFields: string[] | null;
248
+ nested: Record<string, InMemoryOps>;
245
249
  };
246
250
  export type DataRule = {
247
251
  type: 'rowCountEq';
@@ -0,0 +1,6 @@
1
+ export type RawResponse = {
2
+ columns: string[];
3
+ types: string[];
4
+ rows: unknown[][];
5
+ };
6
+ export declare function normalizeRawJsonProtocolResponse(response: RawResponse): RawResponse;
@@ -1,4 +1,4 @@
1
- import { UserFacingError } from '../UserFacingError';
1
+ import { UserFacingError } from '../user-facing-error';
2
2
  export declare class TransactionManagerError extends UserFacingError {
3
3
  name: string;
4
4
  constructor(message: string, meta?: Record<string, unknown>);
@@ -2,7 +2,7 @@ import { SqlDriverAdapter, Transaction } from '@prisma/driver-adapter-utils';
2
2
  import { QueryEvent } from '../events';
3
3
  import type { SchemaProvider } from '../schema';
4
4
  import { TracingHelper } from '../tracing';
5
- import { Options, TransactionInfo } from './Transaction';
5
+ import { Options, TransactionInfo } from './transaction';
6
6
  export declare class TransactionManager {
7
7
  #private;
8
8
  private transactions;
@@ -14,3 +14,4 @@ export declare class UserFacingError extends Error {
14
14
  };
15
15
  }
16
16
  export declare function rethrowAsUserFacing(error: any): never;
17
+ export declare function rethrowAsUserFacingRawError(error: any): never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "6.14.0-dev.4",
3
+ "version": "6.14.0-dev.40",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,8 +31,8 @@
31
31
  "nanoid": "5.1.5",
32
32
  "ulid": "3.0.0",
33
33
  "uuid": "11.1.0",
34
- "@prisma/debug": "6.14.0-dev.4",
35
- "@prisma/driver-adapter-utils": "6.14.0-dev.4"
34
+ "@prisma/debug": "6.14.0-dev.40",
35
+ "@prisma/driver-adapter-utils": "6.14.0-dev.40"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "29.5.14",