@prisma/client-engine-runtime 6.9.0-dev.5 → 6.9.0-dev.51

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,3 +1,6 @@
1
1
  import { ResultNode } from '../QueryPlan';
2
2
  import { Value } from './scope';
3
- export declare function applyDataMap(data: Value, structure: ResultNode): Value;
3
+ export declare class DataMapperError extends Error {
4
+ name: string;
5
+ }
6
+ export declare function applyDataMap(data: Value, structure: ResultNode, enums: Record<string, Record<string, string>>): Value;
@@ -16,10 +16,11 @@ export type QueryInterpreterOptions = {
16
16
  onQuery?: (event: QueryEvent) => void;
17
17
  tracingHelper: TracingHelper;
18
18
  serializer: (results: SqlResultSet) => Value;
19
+ rawSerializer?: (results: SqlResultSet) => Value;
19
20
  };
20
21
  export declare class QueryInterpreter {
21
22
  #private;
22
- constructor({ transactionManager, placeholderValues, onQuery, tracingHelper, serializer }: QueryInterpreterOptions);
23
+ constructor({ transactionManager, placeholderValues, onQuery, tracingHelper, serializer, rawSerializer, }: QueryInterpreterOptions);
23
24
  static forSql(options: {
24
25
  transactionManager: QueryInterpreterTransactionManager;
25
26
  placeholderValues: Record<string, unknown>;
@@ -1,3 +1,4 @@
1
+ import { Provider } from '@prisma/driver-adapter-utils';
1
2
  export declare class GeneratorRegistry {
2
3
  #private;
3
4
  constructor();
@@ -6,7 +7,7 @@ export declare class GeneratorRegistry {
6
7
  * method being called, meaning that the built-in time-based generators will always return
7
8
  * the same value on repeated calls as long as the same snapshot is used.
8
9
  */
9
- snapshot(): Readonly<GeneratorRegistrySnapshot>;
10
+ snapshot(provider?: Provider): Readonly<GeneratorRegistrySnapshot>;
10
11
  /**
11
12
  * Registers a new generator with the given name.
12
13
  */
@@ -1,5 +1,6 @@
1
1
  import { SqlQuery } from '@prisma/driver-adapter-utils';
2
- import type { QueryPlanDbQuery } from '../QueryPlan';
2
+ import type { PrismaValue, QueryPlanDbQuery } from '../QueryPlan';
3
3
  import { GeneratorRegistrySnapshot } from './generators';
4
4
  import { ScopeBindings } from './scope';
5
5
  export declare function renderQuery(dbQuery: QueryPlanDbQuery, scope: ScopeBindings, generators: GeneratorRegistrySnapshot): SqlQuery;
6
+ export declare function evaluateParam(param: PrismaValue, scope: ScopeBindings, generators: GeneratorRegistrySnapshot): unknown;
@@ -1,2 +1,3 @@
1
- import type { SqlResultSet } from '@prisma/driver-adapter-utils';
1
+ import { type SqlResultSet } from '@prisma/driver-adapter-utils';
2
2
  export declare function serializeSql(resultSet: SqlResultSet): Record<string, unknown>[];
3
+ export declare function serializeRawSql(resultSet: SqlResultSet): Record<string, unknown>;
package/dist/tracing.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import type { Context, Span, SpanOptions } from '@opentelemetry/api';
2
- import type { Provider } from '@prisma/driver-adapter-utils';
1
+ import { type Context, type Span, type SpanOptions } from '@opentelemetry/api';
2
+ import type { Provider, SqlQuery, SqlQueryable } from '@prisma/driver-adapter-utils';
3
+ import { QueryEvent } from './events';
3
4
  export type SpanCallback<R> = (span?: Span, context?: Context) => R;
4
5
  export type ExtendedSpanOptions = SpanOptions & {
5
6
  name: string;
@@ -9,3 +10,10 @@ export interface TracingHelper {
9
10
  }
10
11
  export declare const noopTracingHelper: TracingHelper;
11
12
  export declare function providerToOtelSystem(provider: Provider): string;
13
+ export declare function withQuerySpanAndEvent<T>({ query, queryable, tracingHelper, onQuery, execute, }: {
14
+ query: SqlQuery;
15
+ queryable: SqlQueryable;
16
+ tracingHelper: TracingHelper;
17
+ onQuery?: (event: QueryEvent) => void;
18
+ execute: () => Promise<T>;
19
+ }): Promise<T>;
@@ -1,4 +1,5 @@
1
1
  import { SqlDriverAdapter, Transaction } from '@prisma/driver-adapter-utils';
2
+ import { QueryEvent } from '../events';
2
3
  import { TracingHelper } from '../tracing';
3
4
  import { Options, TransactionInfo } from './Transaction';
4
5
  export declare class TransactionManager {
@@ -8,10 +9,11 @@ export declare class TransactionManager {
8
9
  private readonly driverAdapter;
9
10
  private readonly transactionOptions;
10
11
  private readonly tracingHelper;
11
- constructor({ driverAdapter, transactionOptions, tracingHelper, }: {
12
+ constructor({ driverAdapter, transactionOptions, tracingHelper, onQuery, }: {
12
13
  driverAdapter: SqlDriverAdapter;
13
14
  transactionOptions: Options;
14
15
  tracingHelper: TracingHelper;
16
+ onQuery?: (event: QueryEvent) => void;
15
17
  });
16
18
  startTransaction(options?: Options): Promise<TransactionInfo>;
17
19
  commitTransaction(transactionId: string): Promise<void>;
@@ -1,7 +1,7 @@
1
- export declare class TransactionManagerError extends Error {
2
- meta?: Record<string, unknown> | undefined;
3
- code: string;
4
- constructor(message: string, meta?: Record<string, unknown> | undefined);
1
+ import { UserFacingError } from '../UserFacingError';
2
+ export declare class TransactionManagerError extends UserFacingError {
3
+ name: string;
4
+ constructor(message: string, meta?: Record<string, unknown>);
5
5
  }
6
6
  export declare class TransactionNotFoundError extends TransactionManagerError {
7
7
  constructor();
package/dist/utils.d.ts CHANGED
@@ -1 +1,16 @@
1
1
  export declare function assertNever(_: never, message: string): never;
2
+ /**
3
+ * Checks if two objects are deeply equal, recursively checking all properties for strict equality.
4
+ */
5
+ export declare function isDeepStrictEqual(a: unknown, b: unknown): boolean;
6
+ /**
7
+ * Checks if two objects representing the names and values of key columns match. A match is
8
+ * defined by one of the sets of keys being a subset of the other. This function also
9
+ * converts arguments to the types used by driver adapters if necessary.
10
+ */
11
+ export declare function doKeysMatch(lhs: {}, rhs: {}): boolean;
12
+ /**
13
+ * `JSON.stringify` wrapper with custom replacer function that handles nested
14
+ * BigInt and Uint8Array values.
15
+ */
16
+ export declare function safeJsonStringify(obj: unknown): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "6.9.0-dev.5",
3
+ "version": "6.9.0-dev.51",
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/driver-adapter-utils": "6.9.0-dev.5",
35
- "@prisma/debug": "6.9.0-dev.5"
34
+ "@prisma/debug": "6.9.0-dev.51",
35
+ "@prisma/driver-adapter-utils": "6.9.0-dev.51"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "29.5.14",