@prisma-next/sql-runtime 0.3.0-dev.3 → 0.3.0-dev.30
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/README.md +1 -2
- package/dist/{accelerate-EEKAFGN3-SHR4XFVV.js → accelerate-EEKAFGN3-P6A6XJWJ.js} +28 -28
- package/dist/{accelerate-EEKAFGN3-SHR4XFVV.js.map → accelerate-EEKAFGN3-P6A6XJWJ.js.map} +1 -1
- package/dist/{chunk-C6I3V3DM.js → chunk-APA6GHYY.js} +84 -2
- package/dist/chunk-APA6GHYY.js.map +1 -0
- package/dist/{dist-LCVVJCGI.js → dist-AQ3LWXOX.js} +13 -13
- package/dist/{dist-LCVVJCGI.js.map → dist-AQ3LWXOX.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/src/codecs/decoding.d.ts +4 -0
- package/dist/src/codecs/decoding.d.ts.map +1 -0
- package/dist/src/codecs/encoding.d.ts +5 -0
- package/dist/src/codecs/encoding.d.ts.map +1 -0
- package/dist/src/codecs/validation.d.ts +6 -0
- package/dist/src/codecs/validation.d.ts.map +1 -0
- package/dist/src/exports/index.d.ts +11 -0
- package/dist/src/exports/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lower-sql-plan.d.ts +15 -0
- package/dist/src/lower-sql-plan.d.ts.map +1 -0
- package/dist/src/sql-context.d.ts +130 -0
- package/dist/src/sql-context.d.ts.map +1 -0
- package/dist/src/sql-family-adapter.d.ts +10 -0
- package/dist/src/sql-family-adapter.d.ts.map +1 -0
- package/dist/src/sql-marker.d.ts +22 -0
- package/dist/src/sql-marker.d.ts.map +1 -0
- package/dist/src/sql-runtime.d.ts +25 -0
- package/dist/src/sql-runtime.d.ts.map +1 -0
- package/dist/test/utils.d.ts +20 -24
- package/dist/test/utils.d.ts.map +1 -0
- package/dist/test/utils.js +26 -26
- package/dist/test/utils.js.map +1 -1
- package/package.json +25 -22
- package/src/codecs/decoding.ts +140 -0
- package/src/codecs/encoding.ts +76 -0
- package/src/codecs/validation.ts +67 -0
- package/src/exports/index.ts +40 -0
- package/src/index.ts +1 -0
- package/src/lower-sql-plan.ts +32 -0
- package/src/sql-context.ts +402 -0
- package/src/sql-family-adapter.ts +43 -0
- package/src/sql-marker.ts +105 -0
- package/src/sql-runtime.ts +166 -0
- package/test/async-iterable-result.test.ts +136 -0
- package/test/context.types.test-d.ts +70 -0
- package/test/parameterized-types.test.ts +553 -0
- package/test/sql-context.test.ts +217 -0
- package/test/sql-family-adapter.test.ts +86 -0
- package/test/sql-runtime.test.ts +155 -0
- package/test/utils.ts +266 -0
- package/dist/chunk-C6I3V3DM.js.map +0 -1
- package/dist/index.d.ts +0 -29
- package/dist/sql-runtime-DgEbg2OP.d.ts +0 -109
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { RuntimeAdapterDescriptor, RuntimeAdapterInstance, RuntimeExtensionDescriptor, RuntimeExtensionInstance, RuntimeTargetDescriptor } from '@prisma-next/core-execution-plane/types';
|
|
2
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
3
|
+
import type { SqlOperationSignature } from '@prisma-next/sql-operations';
|
|
4
|
+
import type { Adapter, CodecRegistry, LoweredStatement, QueryAst } from '@prisma-next/sql-relational-core/ast';
|
|
5
|
+
import type { QueryLaneContext, TypeHelperRegistry } from '@prisma-next/sql-relational-core/query-lane-context';
|
|
6
|
+
import type { Type } from 'arktype';
|
|
7
|
+
/**
|
|
8
|
+
* Runtime parameterized codec descriptor.
|
|
9
|
+
* Provides validation schema and optional init hook for codecs that support type parameters.
|
|
10
|
+
* Used at runtime to validate typeParams and create type helpers.
|
|
11
|
+
*/
|
|
12
|
+
export interface RuntimeParameterizedCodecDescriptor<TParams = Record<string, unknown>, THelper = unknown> {
|
|
13
|
+
/** The codec ID this descriptor applies to (e.g., 'pg/vector@1') */
|
|
14
|
+
readonly codecId: string;
|
|
15
|
+
/**
|
|
16
|
+
* Arktype schema for validating typeParams.
|
|
17
|
+
* The schema is used to validate both storage.types entries and inline column typeParams.
|
|
18
|
+
*/
|
|
19
|
+
readonly paramsSchema: Type<TParams>;
|
|
20
|
+
/**
|
|
21
|
+
* Optional init hook called during runtime context creation.
|
|
22
|
+
* Receives validated params and returns a helper object to be stored in context.types.
|
|
23
|
+
* If not provided, the validated params are stored directly.
|
|
24
|
+
*/
|
|
25
|
+
readonly init?: (params: TParams) => THelper;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* SQL runtime extension instance.
|
|
29
|
+
* Extends the framework RuntimeExtensionInstance with SQL-specific hooks
|
|
30
|
+
* for contributing codecs and operations to the runtime context.
|
|
31
|
+
*
|
|
32
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
33
|
+
*/
|
|
34
|
+
export interface SqlRuntimeExtensionInstance<TTargetId extends string> extends RuntimeExtensionInstance<'sql', TTargetId> {
|
|
35
|
+
/** Returns codecs to register in the runtime context. */
|
|
36
|
+
codecs?(): CodecRegistry;
|
|
37
|
+
/** Returns operations to register in the runtime context. */
|
|
38
|
+
operations?(): ReadonlyArray<SqlOperationSignature>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns parameterized codec descriptors for type validation and helper creation.
|
|
41
|
+
* Uses unknown for type parameters to allow any concrete descriptor types.
|
|
42
|
+
*/
|
|
43
|
+
parameterizedCodecs?(): ReadonlyArray<RuntimeParameterizedCodecDescriptor<any, any>>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* SQL runtime extension descriptor.
|
|
47
|
+
* Extends the framework RuntimeExtensionDescriptor with SQL-specific instance type.
|
|
48
|
+
*
|
|
49
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
50
|
+
*/
|
|
51
|
+
export interface SqlRuntimeExtensionDescriptor<TTargetId extends string> extends RuntimeExtensionDescriptor<'sql', TTargetId, SqlRuntimeExtensionInstance<TTargetId>> {
|
|
52
|
+
create(): SqlRuntimeExtensionInstance<TTargetId>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* SQL runtime adapter instance interface.
|
|
56
|
+
* Combines RuntimeAdapterInstance identity with SQL Adapter behavior.
|
|
57
|
+
* The instance IS an Adapter (via intersection), not HAS an adapter property.
|
|
58
|
+
*
|
|
59
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
60
|
+
*/
|
|
61
|
+
export type SqlRuntimeAdapterInstance<TTargetId extends string = string> = RuntimeAdapterInstance<'sql', TTargetId> & Adapter<QueryAst, SqlContract<SqlStorage>, LoweredStatement>;
|
|
62
|
+
export type { TypeHelperRegistry };
|
|
63
|
+
export interface RuntimeContext<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>> extends QueryLaneContext<TContract> {
|
|
64
|
+
readonly adapter: Adapter<QueryAst, TContract, LoweredStatement> | Adapter<QueryAst, SqlContract<SqlStorage>, LoweredStatement>;
|
|
65
|
+
/**
|
|
66
|
+
* Initialized type helpers from storage.types.
|
|
67
|
+
* Each entry corresponds to a named type instance in the contract's storage.types.
|
|
68
|
+
* The value is the result of calling the codec's init hook (if provided)
|
|
69
|
+
* or the validated typeParams (if no init hook).
|
|
70
|
+
*/
|
|
71
|
+
readonly types?: TypeHelperRegistry;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Descriptor-first options for creating a SQL runtime context.
|
|
75
|
+
* Takes the same framework composition as control-plane: target, adapter, extensionPacks.
|
|
76
|
+
*
|
|
77
|
+
* @template TContract - The SQL contract type
|
|
78
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
79
|
+
*/
|
|
80
|
+
export interface CreateRuntimeContextOptions<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, TTargetId extends string = string> {
|
|
81
|
+
readonly contract: TContract;
|
|
82
|
+
readonly target: RuntimeTargetDescriptor<'sql', TTargetId>;
|
|
83
|
+
readonly adapter: RuntimeAdapterDescriptor<'sql', TTargetId, SqlRuntimeAdapterInstance<TTargetId>>;
|
|
84
|
+
readonly extensionPacks?: ReadonlyArray<SqlRuntimeExtensionDescriptor<TTargetId>>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Structured error thrown by the SQL runtime.
|
|
88
|
+
*
|
|
89
|
+
* Aligns with the repository's error envelope convention:
|
|
90
|
+
* - `code`: Stable error code for programmatic handling (e.g., `RUNTIME.TYPE_PARAMS_INVALID`)
|
|
91
|
+
* - `category`: Error source category (`RUNTIME`)
|
|
92
|
+
* - `severity`: Error severity level (`error`)
|
|
93
|
+
* - `details`: Optional structured details for debugging
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* try {
|
|
98
|
+
* createRuntimeContext({ ... });
|
|
99
|
+
* } catch (e) {
|
|
100
|
+
* if ((e as RuntimeError).code === 'RUNTIME.TYPE_PARAMS_INVALID') {
|
|
101
|
+
* console.error('Invalid type parameters:', (e as RuntimeError).details);
|
|
102
|
+
* }
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export interface RuntimeError extends Error {
|
|
107
|
+
/** Stable error code for programmatic handling (e.g., `RUNTIME.TYPE_PARAMS_INVALID`) */
|
|
108
|
+
readonly code: string;
|
|
109
|
+
/** Error source category */
|
|
110
|
+
readonly category: 'RUNTIME';
|
|
111
|
+
/** Error severity level */
|
|
112
|
+
readonly severity: 'error';
|
|
113
|
+
/** Optional structured details for debugging */
|
|
114
|
+
readonly details?: Record<string, unknown>;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Creates a SQL runtime context from descriptor-first composition.
|
|
118
|
+
*
|
|
119
|
+
* The context includes:
|
|
120
|
+
* - The validated contract
|
|
121
|
+
* - The adapter instance (created from descriptor)
|
|
122
|
+
* - Codec registry (populated from adapter + extension instances)
|
|
123
|
+
* - Operation registry (populated from extension instances)
|
|
124
|
+
* - Types registry (initialized helpers from storage.types)
|
|
125
|
+
*
|
|
126
|
+
* @param options - Descriptor-first composition options
|
|
127
|
+
* @returns RuntimeContext with registries wired from all components
|
|
128
|
+
*/
|
|
129
|
+
export declare function createRuntimeContext<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, TTargetId extends string = string>(options: CreateRuntimeContextOptions<TContract, TTargetId>): RuntimeContext<TContract>;
|
|
130
|
+
//# sourceMappingURL=sql-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-context.d.ts","sourceRoot":"","sources":["../../src/sql-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAuB,MAAM,iCAAiC,CAAC;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAOpC;;;;GAIG;AACH,MAAM,WAAW,mCAAmC,CAClD,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,OAAO,GAAG,OAAO;IAEjB,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAErC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;CAC9C;AAMD;;;;;;GAMG;AACH,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AU,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,EACnE,SAAS,SAAS,MAAM,GAAG,MAAM;IAEjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC3D,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CACxC,KAAK,EACL,SAAS,EACT,yBAAyB,CAAC,SAAS,CAAC,CACrC,CAAC;IACF,QAAQ,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC,CAAC;CACnF;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,wFAAwF;IACxF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,2BAA2B;IAC3B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAkJD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,EACnE,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,OAAO,EAAE,2BAA2B,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAyDvF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ExecutionPlan } from '@prisma-next/contract/types';
|
|
2
|
+
import type { MarkerReader, RuntimeFamilyAdapter } from '@prisma-next/runtime-executor';
|
|
3
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
4
|
+
export declare class SqlFamilyAdapter<TContract extends SqlContract<SqlStorage>> implements RuntimeFamilyAdapter<TContract> {
|
|
5
|
+
readonly contract: TContract;
|
|
6
|
+
readonly markerReader: MarkerReader;
|
|
7
|
+
constructor(contract: TContract);
|
|
8
|
+
validatePlan(plan: ExecutionPlan, contract: TContract): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=sql-family-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-family-adapter.d.ts","sourceRoot":"","sources":["../../src/sql-family-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAS/E,qBAAa,gBAAgB,CAAC,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,CACrE,YAAW,oBAAoB,CAAC,SAAS,CAAC;IAE1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBAExB,QAAQ,EAAE,SAAS;IAK/B,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,GAAG,IAAI;CAe7D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MarkerStatement } from '@prisma-next/runtime-executor';
|
|
2
|
+
export interface SqlStatement {
|
|
3
|
+
readonly sql: string;
|
|
4
|
+
readonly params: readonly unknown[];
|
|
5
|
+
}
|
|
6
|
+
export interface WriteMarkerInput {
|
|
7
|
+
readonly coreHash: string;
|
|
8
|
+
readonly profileHash: string;
|
|
9
|
+
readonly contractJson?: unknown;
|
|
10
|
+
readonly canonicalVersion?: number;
|
|
11
|
+
readonly appTag?: string;
|
|
12
|
+
readonly meta?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export declare const ensureSchemaStatement: SqlStatement;
|
|
15
|
+
export declare const ensureTableStatement: SqlStatement;
|
|
16
|
+
export declare function readContractMarker(): MarkerStatement;
|
|
17
|
+
export interface WriteContractMarkerStatements {
|
|
18
|
+
readonly insert: SqlStatement;
|
|
19
|
+
readonly update: SqlStatement;
|
|
20
|
+
}
|
|
21
|
+
export declare function writeContractMarker(input: WriteMarkerInput): WriteContractMarkerStatements;
|
|
22
|
+
//# sourceMappingURL=sql-marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-marker.d.ts","sourceRoot":"","sources":["../../src/sql-marker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,qBAAqB,EAAE,YAGnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,YAYlC,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,eAAe,CAcpD;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,6BAA6B,CAgD1F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ExecutionPlan } from '@prisma-next/contract/types';
|
|
2
|
+
import type { OperationRegistry } from '@prisma-next/operations';
|
|
3
|
+
import type { Log, Plugin, RuntimeTelemetryEvent, RuntimeVerifyOptions, TelemetryOutcome } from '@prisma-next/runtime-executor';
|
|
4
|
+
import { AsyncIterableResult } from '@prisma-next/runtime-executor';
|
|
5
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
6
|
+
import type { Adapter, LoweredStatement, SelectAst, SqlDriver } from '@prisma-next/sql-relational-core/ast';
|
|
7
|
+
import type { SqlQueryPlan } from '@prisma-next/sql-relational-core/plan';
|
|
8
|
+
import type { RuntimeContext } from './sql-context';
|
|
9
|
+
export interface RuntimeOptions<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>> {
|
|
10
|
+
readonly driver: SqlDriver;
|
|
11
|
+
readonly verify: RuntimeVerifyOptions;
|
|
12
|
+
readonly context: RuntimeContext<TContract>;
|
|
13
|
+
readonly plugins?: readonly Plugin<TContract, Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>, SqlDriver>[];
|
|
14
|
+
readonly mode?: 'strict' | 'permissive';
|
|
15
|
+
readonly log?: Log;
|
|
16
|
+
}
|
|
17
|
+
export interface Runtime {
|
|
18
|
+
execute<Row = Record<string, unknown>>(plan: ExecutionPlan<Row> | SqlQueryPlan<Row>): AsyncIterableResult<Row>;
|
|
19
|
+
telemetry(): RuntimeTelemetryEvent | null;
|
|
20
|
+
close(): Promise<void>;
|
|
21
|
+
operations(): OperationRegistry;
|
|
22
|
+
}
|
|
23
|
+
export type { RuntimeTelemetryEvent, RuntimeVerifyOptions, TelemetryOutcome };
|
|
24
|
+
export declare function createRuntime<TContract extends SqlContract<SqlStorage>>(options: RuntimeOptions<TContract>): Runtime;
|
|
25
|
+
//# sourceMappingURL=sql-runtime.d.ts.map
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,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,GAC3C,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAC5B,SAAS,IAAI,qBAAqB,GAAG,IAAI,CAAC;IAC1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,UAAU,IAAI,iBAAiB,CAAC;CACjC;AAED,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC;AA6G9E,wBAAgB,aAAa,CAAC,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,EACrE,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,GACjC,OAAO,CAET"}
|
package/dist/test/utils.d.ts
CHANGED
|
@@ -1,41 +1,36 @@
|
|
|
1
|
-
import { ExecutionPlan, ResultType } from '@prisma-next/contract/types';
|
|
2
|
-
import { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
3
|
-
import { Adapter,
|
|
4
|
-
import { SqlQueryPlan } from '@prisma-next/sql-relational-core/plan';
|
|
5
|
-
import { Client } from 'pg';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import '
|
|
9
|
-
import '@prisma-next/operations';
|
|
10
|
-
import '@prisma-next/core-execution-plane/types';
|
|
11
|
-
import '@prisma-next/sql-operations';
|
|
12
|
-
import '@prisma-next/sql-relational-core/query-lane-context';
|
|
13
|
-
|
|
1
|
+
import type { ExecutionPlan, ResultType } from '@prisma-next/contract/types';
|
|
2
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
3
|
+
import type { Adapter, LoweredStatement, SelectAst } from '@prisma-next/sql-relational-core/ast';
|
|
4
|
+
import type { SqlQueryPlan } from '@prisma-next/sql-relational-core/plan';
|
|
5
|
+
import type { Client } from 'pg';
|
|
6
|
+
import type { SqlStatement } from '../src/exports';
|
|
7
|
+
import { type createRuntime } from '../src/exports';
|
|
8
|
+
import type { RuntimeContext, SqlRuntimeExtensionDescriptor } from '../src/sql-context';
|
|
14
9
|
/**
|
|
15
10
|
* Executes a plan and collects all results into an array.
|
|
16
11
|
* This helper DRYs up the common pattern of executing plans in tests.
|
|
17
12
|
* The return type is inferred from the plan's type parameter.
|
|
18
13
|
*/
|
|
19
|
-
declare function executePlanAndCollect<P extends ExecutionPlan<ResultType<P>> | SqlQueryPlan<ResultType<P>>>(runtime: ReturnType<typeof createRuntime>, plan: P): Promise<ResultType<P>[]>;
|
|
14
|
+
export declare function executePlanAndCollect<P extends ExecutionPlan<ResultType<P>> | SqlQueryPlan<ResultType<P>>>(runtime: ReturnType<typeof createRuntime>, plan: P): Promise<ResultType<P>[]>;
|
|
20
15
|
/**
|
|
21
16
|
* Drains a plan execution, consuming all results without collecting them.
|
|
22
17
|
* Useful for testing side effects without memory overhead.
|
|
23
18
|
*/
|
|
24
|
-
declare function drainPlanExecution(runtime: ReturnType<typeof createRuntime>, plan: ExecutionPlan | SqlQueryPlan<unknown>): Promise<void>;
|
|
19
|
+
export declare function drainPlanExecution(runtime: ReturnType<typeof createRuntime>, plan: ExecutionPlan | SqlQueryPlan<unknown>): Promise<void>;
|
|
25
20
|
/**
|
|
26
21
|
* Executes a SQL statement on a database client.
|
|
27
22
|
*/
|
|
28
|
-
declare function executeStatement(client: Client, statement: SqlStatement): Promise<void>;
|
|
23
|
+
export declare function executeStatement(client: Client, statement: SqlStatement): Promise<void>;
|
|
29
24
|
/**
|
|
30
25
|
* Sets up database schema and data, then writes the contract marker.
|
|
31
26
|
* This helper DRYs up the common pattern of database setup in tests.
|
|
32
27
|
*/
|
|
33
|
-
declare function setupTestDatabase(client: Client, contract: SqlContract<SqlStorage>, setupFn: (client: Client) => Promise<void>): Promise<void>;
|
|
28
|
+
export declare function setupTestDatabase(client: Client, contract: SqlContract<SqlStorage>, setupFn: (client: Client) => Promise<void>): Promise<void>;
|
|
34
29
|
/**
|
|
35
30
|
* Writes a contract marker to the database.
|
|
36
31
|
* This helper DRYs up the common pattern of writing contract markers in tests.
|
|
37
32
|
*/
|
|
38
|
-
declare function writeTestContractMarker(client: Client, contract: SqlContract<SqlStorage>): Promise<void>;
|
|
33
|
+
export declare function writeTestContractMarker(client: Client, contract: SqlContract<SqlStorage>): Promise<void>;
|
|
39
34
|
/**
|
|
40
35
|
* Creates a runtime context with standard test configuration.
|
|
41
36
|
* This helper DRYs up the common pattern of context creation in tests.
|
|
@@ -43,7 +38,7 @@ declare function writeTestContractMarker(client: Client, contract: SqlContract<S
|
|
|
43
38
|
* Accepts a raw adapter and optional extension descriptors, wrapping the
|
|
44
39
|
* adapter in a descriptor internally for descriptor-first context creation.
|
|
45
40
|
*/
|
|
46
|
-
declare function createTestContext<TContract extends SqlContract<SqlStorage>>(contract: TContract, adapter: Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>, options?: {
|
|
41
|
+
export declare function createTestContext<TContract extends SqlContract<SqlStorage>>(contract: TContract, adapter: Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>, options?: {
|
|
47
42
|
extensionPacks?: ReadonlyArray<SqlRuntimeExtensionDescriptor<'postgres'>>;
|
|
48
43
|
}): RuntimeContext<TContract>;
|
|
49
44
|
/**
|
|
@@ -53,12 +48,13 @@ declare function createTestContext<TContract extends SqlContract<SqlStorage>>(co
|
|
|
53
48
|
* The stub adapter includes simple codecs for common test types (pg/int4@1, pg/text@1, pg/timestamptz@1)
|
|
54
49
|
* to enable type inference in tests without requiring the postgres adapter package.
|
|
55
50
|
*/
|
|
56
|
-
declare function createStubAdapter(): Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>;
|
|
51
|
+
export declare function createStubAdapter(): Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>;
|
|
57
52
|
/**
|
|
58
53
|
* Creates a valid test contract without using validateContract.
|
|
59
|
-
* Ensures
|
|
54
|
+
* Ensures all required fields are present (mappings, capabilities, extensionPacks, meta, sources)
|
|
55
|
+
* and returns the contract with proper typing.
|
|
60
56
|
* This helper allows tests to create contracts without depending on sql-query.
|
|
61
57
|
*/
|
|
62
|
-
declare function createTestContract<T extends SqlContract<SqlStorage>>(contract: T): T;
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
export declare function createTestContract<T extends SqlContract<SqlStorage>>(contract: Partial<T> & Omit<T, 'mappings' | 'capabilities' | 'extensionPacks' | 'meta' | 'sources'>): T;
|
|
59
|
+
export { collectAsync, createDevDatabase, type DevDatabase, teardownTestDatabase, withClient, } from '@prisma-next/test-utils';
|
|
60
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,cAAc,EAEd,6BAA6B,EAC9B,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,CAAC,SAAS,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EACpE,OAAO,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,EAAE,IAAI,EAAE,C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AAU,CAAC,EAClE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAC,GAC7E,CAAC,CASH;AAGD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,KAAK,WAAW,EAChB,oBAAoB,EACpB,UAAU,GACX,MAAM,yBAAyB,CAAC"}
|
package/dist/test/utils.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
ensureSchemaStatement,
|
|
27
27
|
ensureTableStatement,
|
|
28
28
|
writeContractMarker
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-APA6GHYY.js";
|
|
30
30
|
import {
|
|
31
31
|
__commonJS,
|
|
32
32
|
__require,
|
|
@@ -454,8 +454,8 @@ var require_graceful_fs = __commonJS({
|
|
|
454
454
|
var gracefulQueue;
|
|
455
455
|
var previousSymbol;
|
|
456
456
|
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
457
|
-
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
458
|
-
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
457
|
+
gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue");
|
|
458
|
+
previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous");
|
|
459
459
|
} else {
|
|
460
460
|
gracefulQueue = "___graceful-fs.queue";
|
|
461
461
|
previousSymbol = "___graceful-fs.previous";
|
|
@@ -1242,7 +1242,7 @@ var require_signal_exit = __commonJS({
|
|
|
1242
1242
|
var require_mtime_precision = __commonJS({
|
|
1243
1243
|
"../../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/mtime-precision.js"(exports, module) {
|
|
1244
1244
|
"use strict";
|
|
1245
|
-
var cacheSymbol = Symbol();
|
|
1245
|
+
var cacheSymbol = /* @__PURE__ */ Symbol();
|
|
1246
1246
|
function probe(file, fs, callback) {
|
|
1247
1247
|
const cachedPrecision = fs[cacheSymbol];
|
|
1248
1248
|
if (cachedPrecision) {
|
|
@@ -2024,8 +2024,8 @@ var require_chunk_7PMGXL6S = __commonJS({
|
|
|
2024
2024
|
var import_promises3 = __toESM2(__require("fs/promises"));
|
|
2025
2025
|
var import_os = __toESM2(__require("os"));
|
|
2026
2026
|
var import_util2 = __require("util");
|
|
2027
|
-
var t6 = Symbol.for("@ts-pattern/matcher");
|
|
2028
|
-
var e2 = Symbol.for("@ts-pattern/isVariadic");
|
|
2027
|
+
var t6 = /* @__PURE__ */ Symbol.for("@ts-pattern/matcher");
|
|
2028
|
+
var e2 = /* @__PURE__ */ Symbol.for("@ts-pattern/isVariadic");
|
|
2029
2029
|
var n3 = "@ts-pattern/anonymous-select-key";
|
|
2030
2030
|
var r5 = (t22) => Boolean(t22 && "object" == typeof t22);
|
|
2031
2031
|
var i3 = (e22) => e22 && !!e22[t6];
|
|
@@ -5013,7 +5013,7 @@ var require_chunk_3UEKS5W6 = __commonJS({
|
|
|
5013
5013
|
module2.exports = minimatch;
|
|
5014
5014
|
var path3 = require_path();
|
|
5015
5015
|
minimatch.sep = path3.sep;
|
|
5016
|
-
var GLOBSTAR = Symbol("globstar **");
|
|
5016
|
+
var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
|
|
5017
5017
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
5018
5018
|
var expand = require_brace_expansion();
|
|
5019
5019
|
var plTypes = {
|
|
@@ -5077,7 +5077,7 @@ var require_chunk_3UEKS5W6 = __commonJS({
|
|
|
5077
5077
|
throw new TypeError("pattern is too long");
|
|
5078
5078
|
}
|
|
5079
5079
|
};
|
|
5080
|
-
var SUBPARSE = Symbol("subparse");
|
|
5080
|
+
var SUBPARSE = /* @__PURE__ */ Symbol("subparse");
|
|
5081
5081
|
minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe();
|
|
5082
5082
|
minimatch.match = (list, pattern, options = {}) => {
|
|
5083
5083
|
const mm = new Minimatch(pattern, options);
|
|
@@ -6864,7 +6864,7 @@ var require_chunk_3UEKS5W6 = __commonJS({
|
|
|
6864
6864
|
"use strict";
|
|
6865
6865
|
var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
|
|
6866
6866
|
var os2 = (0, import_chunk_2ESYSVXG.__require)("os");
|
|
6867
|
-
var tempDirectorySymbol = Symbol.for("__RESOLVED_TEMP_DIRECTORY__");
|
|
6867
|
+
var tempDirectorySymbol = /* @__PURE__ */ Symbol.for("__RESOLVED_TEMP_DIRECTORY__");
|
|
6868
6868
|
if (!global[tempDirectorySymbol]) {
|
|
6869
6869
|
Object.defineProperty(global, tempDirectorySymbol, {
|
|
6870
6870
|
value: fs.realpathSync(os2.tmpdir())
|
|
@@ -12337,7 +12337,7 @@ var require_chunk_3UEKS5W6 = __commonJS({
|
|
|
12337
12337
|
var SLASH = "/";
|
|
12338
12338
|
var TMP_KEY_IGNORE = "node-ignore";
|
|
12339
12339
|
if (typeof Symbol !== "undefined") {
|
|
12340
|
-
TMP_KEY_IGNORE = Symbol.for("node-ignore");
|
|
12340
|
+
TMP_KEY_IGNORE = /* @__PURE__ */ Symbol.for("node-ignore");
|
|
12341
12341
|
}
|
|
12342
12342
|
var KEY_IGNORE = TMP_KEY_IGNORE;
|
|
12343
12343
|
var define = (object2, key, value) => Object.defineProperty(object2, key, { value });
|
|
@@ -13389,8 +13389,8 @@ var require_chunk_3UEKS5W6 = __commonJS({
|
|
|
13389
13389
|
var gracefulQueue;
|
|
13390
13390
|
var previousSymbol;
|
|
13391
13391
|
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
13392
|
-
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
13393
|
-
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
13392
|
+
gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue");
|
|
13393
|
+
previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous");
|
|
13394
13394
|
} else {
|
|
13395
13395
|
gracefulQueue = "___graceful-fs.queue";
|
|
13396
13396
|
previousSymbol = "___graceful-fs.previous";
|
|
@@ -17273,7 +17273,7 @@ ${error.message}` : execaMessage;
|
|
|
17273
17273
|
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
17274
17274
|
}
|
|
17275
17275
|
var processOk = (process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function";
|
|
17276
|
-
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
17276
|
+
var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
|
|
17277
17277
|
var global2 = globalThis;
|
|
17278
17278
|
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
17279
17279
|
var Emitter = class {
|
|
@@ -21703,8 +21703,8 @@ var require_split2 = __commonJS({
|
|
|
21703
21703
|
"use strict";
|
|
21704
21704
|
var { Transform } = __require("stream");
|
|
21705
21705
|
var { StringDecoder } = __require("string_decoder");
|
|
21706
|
-
var kLast = Symbol("last");
|
|
21707
|
-
var kDecoder = Symbol("decoder");
|
|
21706
|
+
var kLast = /* @__PURE__ */ Symbol("last");
|
|
21707
|
+
var kDecoder = /* @__PURE__ */ Symbol("decoder");
|
|
21708
21708
|
function transform(chunk, enc, cb) {
|
|
21709
21709
|
let list;
|
|
21710
21710
|
if (this.overflow) {
|
|
@@ -24028,7 +24028,6 @@ var isAbsolute = function(p3) {
|
|
|
24028
24028
|
};
|
|
24029
24029
|
|
|
24030
24030
|
// ../../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/utils.mjs
|
|
24031
|
-
var normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
|
|
24032
24031
|
var SLASH_RE = /[/\\]/;
|
|
24033
24032
|
function filename(path) {
|
|
24034
24033
|
const base = path.split(SLASH_RE).pop();
|
|
@@ -24159,7 +24158,7 @@ var J = object({ url: _2 });
|
|
|
24159
24158
|
var M = pipe(number(), integer(), minValue(1));
|
|
24160
24159
|
var ie = object({ database: L, http: J, ppg: J, shadowDatabase: L });
|
|
24161
24160
|
var ne = object({ databasePort: M, exports: optional(ie), name: pipe(string(), minLength(1)), pid: optional(pipe(number(), integer(), minValue(0))), port: M, shadowDatabasePort: M, version: literal("1") });
|
|
24162
|
-
var E3 = Symbol("initialize");
|
|
24161
|
+
var E3 = /* @__PURE__ */ Symbol("initialize");
|
|
24163
24162
|
var k2 = "default";
|
|
24164
24163
|
var u = class {
|
|
24165
24164
|
_databasePort;
|
|
@@ -24339,7 +24338,7 @@ import { promisify as R2 } from "util";
|
|
|
24339
24338
|
async function y4(o2, e2) {
|
|
24340
24339
|
let { port: r5 } = e2;
|
|
24341
24340
|
if (e2.dryRun) return w2(r5, null);
|
|
24342
|
-
let n3 = await D2(o2, e2), { promise: m, reject: l2, resolve: a } = O(), { serve: c } = await import("../dist-
|
|
24341
|
+
let n3 = await D2(o2, e2), { promise: m, reject: l2, resolve: a } = O(), { serve: c } = await import("../dist-AQ3LWXOX.js"), i3 = c({ createServer: A, fetch: n3.fetch, overrideGlobalObjects: false, port: r5 }, a);
|
|
24343
24342
|
i3.on("error", (s) => {
|
|
24344
24343
|
if (typeof s == "object" && "code" in s && s.code === "EADDRINUSE") return l2(new f(r5));
|
|
24345
24344
|
console.error("[Accelerate]", s);
|
|
@@ -24353,7 +24352,7 @@ function w2(o2, e2) {
|
|
|
24353
24352
|
}, port: o2, url: `http://localhost:${o2}` };
|
|
24354
24353
|
}
|
|
24355
24354
|
async function D2(o2, e2) {
|
|
24356
|
-
let { debug: r5 } = e2, [{ Hono: n3 }, { accelerateRoute: m }, { utilityRoute: l2 }] = await Promise.all([import("../tiny-CW6F4GX6.js"), import("../accelerate-EEKAFGN3-
|
|
24355
|
+
let { debug: r5 } = e2, [{ Hono: n3 }, { accelerateRoute: m }, { utilityRoute: l2 }] = await Promise.all([import("../tiny-CW6F4GX6.js"), import("../accelerate-EEKAFGN3-P6A6XJWJ.js"), import("../utility-Q5A254LJ-J4HTKZPT.js")]), a = new n3(), c = await import_get_platform.default.getPlatformInfo();
|
|
24357
24356
|
if (r5 && console.debug("[Accelerate] platform info: %s", JSON.stringify(c)), r5) {
|
|
24358
24357
|
let { logger: t6 } = await import("../logger-WQ7SHNDD.js");
|
|
24359
24358
|
a.use("*", t6((...s) => console.log("[Accelerate]", ...s)));
|
|
@@ -24558,13 +24557,14 @@ function createStubAdapter() {
|
|
|
24558
24557
|
};
|
|
24559
24558
|
}
|
|
24560
24559
|
function createTestContract(contract) {
|
|
24561
|
-
|
|
24562
|
-
|
|
24563
|
-
|
|
24564
|
-
|
|
24565
|
-
}
|
|
24566
|
-
|
|
24567
|
-
|
|
24560
|
+
return {
|
|
24561
|
+
...contract,
|
|
24562
|
+
mappings: contract.mappings ?? { codecTypes: {}, operationTypes: {} },
|
|
24563
|
+
capabilities: contract.capabilities ?? {},
|
|
24564
|
+
extensionPacks: contract.extensionPacks ?? {},
|
|
24565
|
+
meta: contract.meta ?? {},
|
|
24566
|
+
sources: contract.sources ?? {}
|
|
24567
|
+
};
|
|
24568
24568
|
}
|
|
24569
24569
|
export {
|
|
24570
24570
|
collectAsync,
|