@prisma-next/sql-relational-core 0.5.0-dev.8 → 0.5.0-dev.9
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/dist/codec-types-B2Xdq0Wr.d.mts.map +1 -1
- package/dist/{errors-DI_RVH66.d.mts → errors-CDvhnH7P.d.mts} +2 -2
- package/dist/errors-CDvhnH7P.d.mts.map +1 -0
- package/dist/exports/errors.d.mts +3 -3
- package/dist/exports/plan.d.mts +3 -2
- package/dist/exports/plan.mjs.map +1 -1
- package/dist/exports/query-lane-context.d.mts +1 -1
- package/dist/exports/types.d.mts +4 -3
- package/dist/index.d.mts +7 -6
- package/dist/plan-CRPxW2Jj.d.mts +32 -0
- package/dist/plan-CRPxW2Jj.d.mts.map +1 -0
- package/dist/{query-lane-context-D2H78Mg0.d.mts → query-lane-context-DDRW5NBG.d.mts} +1 -1
- package/dist/{query-lane-context-D2H78Mg0.d.mts.map → query-lane-context-DDRW5NBG.d.mts.map} +1 -1
- package/dist/sql-execution-plan-DY0WvJOW.d.mts +33 -0
- package/dist/sql-execution-plan-DY0WvJOW.d.mts.map +1 -0
- package/dist/types-B5XsBeaT.d.mts +24 -0
- package/dist/types-B5XsBeaT.d.mts.map +1 -0
- package/dist/{types-D3vVZzRZ.d.mts → types-CG3u534i.d.mts} +12 -17
- package/dist/types-CG3u534i.d.mts.map +1 -0
- package/package.json +8 -8
- package/src/exports/plan.ts +1 -0
- package/src/exports/types.ts +1 -0
- package/src/plan.ts +12 -11
- package/src/runtime-scope.ts +20 -0
- package/src/sql-execution-plan.ts +28 -0
- package/src/types.ts +9 -20
- package/dist/errors-DI_RVH66.d.mts.map +0 -1
- package/dist/plan-Cs65hb-E.d.mts +0 -28
- package/dist/plan-Cs65hb-E.d.mts.map +0 -1
- package/dist/types-D3vVZzRZ.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-types-B2Xdq0Wr.d.mts","names":[],"sources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ATP,SASO,CAAA,EARjB,eAQiB,CAPlB,CAAA,CAAE,SAOgB,CAPN,WAOM,EAPO,MAOP,CAPc,UAOd,EAP0B,SAO1B,CAAA,CAAA,GAPwC,MAOxC,CAP+C,UAO/C,EAP2D,SAO3D,CAAA,CAAA;EAAY,SAAA,gBAAA,EAAA,iBACD,MAJR,WAIQ,GAAA;IAAY,SAAA,MAAA,EAHtB,WAGsB,CAHV,CAGU,CAAA,SAHC,OAGD,CAAA,KAAA,YAAA,MAAA,CAAA,GAAA,EAAA,GAAA,KAAA;IAAvB,SAAA,MAAA,EAFC,CAED;IACY,SAAA,KAAA,EAFZ,WAEY,CAFA,CAEA,CAAA;IAAY,SAAA,KAAA,EADxB,UACwB,CADb,WACa,CADD,CACC,CAAA,CAAA;IAAvB,SAAA,MAAA,EAAA,UAAA,CAAW,WAAX,CAAuB,CAAvB,CAAA,CAAA;IACW,SAAA,MAAA,EAAX,UAAW,CAAA,WAAA,CAAY,CAAZ,CAAA,CAAA;EAAY,CAAA,EAAvB;EAKE,SAAA,SAAA,EAAA,iBAC4B,MAD5B,WAC4B,GAAA,kBAAG,MAA5B,iBAA4B,CAAV,MAAU,CAAH,CAAG,EAAA,WAAA,CAAY,CAAZ,CAAA,CAAA,CAAA,GAAmB,EAAnB,EAAY,CAAA,MACxD,iBADwD,CACtC,MADsC,CAC/B,CAD+B,EAC5B,WAD4B,CAChB,CADgB,CAAA,CAAA,CAAA,CAAA,EAAtB;;;;;AACM,iBAyHpC,mBAAA,CAAA,CAzHoC,EAyHb,aAzHa;;;;AAyHpC,iBAOA,YAAA,CAAA,CAPmB,EAOH,eAPoB,CAOJ,MAPI,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { y as RuntimeError } from "./types-CG3u534i.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors.d.ts
|
|
4
4
|
declare function planInvalid(message: string, details?: Record<string, unknown>, hints?: readonly string[], docs?: readonly string[]): RuntimeError;
|
|
5
5
|
declare function planUnsupported(message: string, details?: Record<string, unknown>, hints?: readonly string[], docs?: readonly string[]): RuntimeError;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { planUnsupported as n, planInvalid as t };
|
|
8
|
-
//# sourceMappingURL=errors-
|
|
8
|
+
//# sourceMappingURL=errors-CDvhnH7P.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-CDvhnH7P.d.mts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,WAAA,4BAEJ,+EAGT;iBAkBa,eAAA,4BAEJ,+EAGT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../codec-types-B2Xdq0Wr.mjs";
|
|
2
|
-
import "../query-lane-context-
|
|
3
|
-
import "../types-
|
|
4
|
-
import { n as planUnsupported, t as planInvalid } from "../errors-
|
|
2
|
+
import "../query-lane-context-DDRW5NBG.mjs";
|
|
3
|
+
import "../types-CG3u534i.mjs";
|
|
4
|
+
import { n as planUnsupported, t as planInvalid } from "../errors-CDvhnH7P.mjs";
|
|
5
5
|
export { planInvalid, planUnsupported };
|
package/dist/exports/plan.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as SqlExecutionPlan } from "../sql-execution-plan-DY0WvJOW.mjs";
|
|
2
|
+
import { n as augmentDescriptorWithColumnMeta, t as SqlQueryPlan } from "../plan-CRPxW2Jj.mjs";
|
|
3
|
+
export { type SqlExecutionPlan, SqlQueryPlan, augmentDescriptorWithColumnMeta };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.mjs","names":[],"sources":["../../src/plan.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"plan.mjs","names":[],"sources":["../../src/plan.ts"],"sourcesContent":["import type { ParamDescriptor } from '@prisma-next/contract/types';\nimport type { QueryPlan } from '@prisma-next/framework-components/runtime';\nimport type { StorageColumn } from '@prisma-next/sql-contract/types';\nimport type { AnyQueryAst } from './ast/types';\n\n/**\n * SQL query plan produced by lanes before lowering.\n *\n * Lanes build ASTs and metadata but do not perform SQL lowering. The `sql`\n * field is absent — `RuntimeCore` (the runtime base class in\n * `@prisma-next/framework-components/runtime`) drives lowering via the\n * SQL adapter and produces a `SqlExecutionPlan`.\n *\n * Extends the framework-level `QueryPlan<Row>` marker (`meta + _row`) and\n * adds SQL-specific fields (`ast`, `params`). The phantom `_row` property\n * (inherited from `QueryPlan`) is what `ResultType<P>` inspects to recover\n * the row type.\n */\nexport interface SqlQueryPlan<Row = unknown> extends QueryPlan<Row> {\n readonly ast: AnyQueryAst;\n readonly params: readonly unknown[];\n}\n\n/**\n * Augments the last ParamDescriptor in the array with codecId and nativeType from columnMeta.\n * This is used when building WHERE expressions to ensure param descriptors have type information.\n */\nexport function augmentDescriptorWithColumnMeta(\n descriptors: ParamDescriptor[],\n columnMeta: StorageColumn | undefined,\n): void {\n const descriptor = descriptors[descriptors.length - 1];\n if (descriptor && columnMeta) {\n descriptors[descriptors.length - 1] = {\n ...descriptor,\n codecId: columnMeta.codecId,\n nativeType: columnMeta.nativeType,\n };\n }\n}\n"],"mappings":";;;;;AA2BA,SAAgB,gCACd,aACA,YACM;CACN,MAAM,aAAa,YAAY,YAAY,SAAS;AACpD,KAAI,cAAc,WAChB,aAAY,YAAY,SAAS,KAAK;EACpC,GAAG;EACH,SAAS,WAAW;EACpB,YAAY,WAAW;EACxB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../codec-types-B2Xdq0Wr.mjs";
|
|
2
|
-
import { a as JsonSchemaValidationResult, c as MutationDefaultsOptions, i as JsonSchemaValidationError, l as TypeHelperRegistry, n as ExecutionContext, o as JsonSchemaValidatorRegistry, r as JsonSchemaValidateFn, s as MutationDefaultsOp, t as AppliedMutationDefault } from "../query-lane-context-
|
|
2
|
+
import { a as JsonSchemaValidationResult, c as MutationDefaultsOptions, i as JsonSchemaValidationError, l as TypeHelperRegistry, n as ExecutionContext, o as JsonSchemaValidatorRegistry, r as JsonSchemaValidateFn, s as MutationDefaultsOp, t as AppliedMutationDefault } from "../query-lane-context-DDRW5NBG.mjs";
|
|
3
3
|
export { AppliedMutationDefault, ExecutionContext, JsonSchemaValidateFn, JsonSchemaValidationError, JsonSchemaValidationResult, JsonSchemaValidatorRegistry, MutationDefaultsOp, MutationDefaultsOptions, TypeHelperRegistry };
|
package/dist/exports/types.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../codec-types-B2Xdq0Wr.mjs";
|
|
2
|
-
import "../query-lane-context-
|
|
3
|
-
import { C as
|
|
4
|
-
|
|
2
|
+
import "../query-lane-context-DDRW5NBG.mjs";
|
|
3
|
+
import { C as TableKey, S as TableDef, T as TablesOf, _ as RawTemplateFactory, a as ComputeColumnJsType, b as SqlBuilderOptions, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnsOf, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as Expr, p as OperationTypes, r as CodecTypes, s as HasIncludeManyCapabilities, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TableMetadata, x as SqlPlan, y as RuntimeError } from "../types-CG3u534i.mjs";
|
|
4
|
+
import { n as SqlOrmPlan, t as RuntimeScope } from "../types-B5XsBeaT.mjs";
|
|
5
|
+
export { BuildOptions, BuildParamsMap, CodecTypes, ColumnsOf, ComputeColumnJsType, Expr, HasIncludeManyCapabilities, META, Meta, ModelDef, ModelMetadata, OperationTypeSignature, OperationTypes, OperationsForTypeId, RawFactory, RawFunctionOptions, RawTemplateFactory, RawTemplateOptions, RuntimeError, RuntimeScope, SqlBuilderOptions, SqlOrmPlan, SqlPlan, TableDef, TableKey, TableMetadata, TablesOf };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { a as CodecMeta, c as CodecTrait, d as ExtractDataTypes, f as codec, i as CodecInput, l as CodecTraits, m as defineCodecs, n as CodecDefBuilder, o as CodecParamsDescriptor, p as createCodecRegistry, r as CodecId, s as CodecRegistry, t as Codec, u as ExtractCodecTypes } from "./codec-types-B2Xdq0Wr.mjs";
|
|
2
2
|
import { $ as ToWhereExpr, A as InsertOnConflict, B as NotExpr, C as ExistsExpr, D as ExpressionSource, E as ExpressionRewriter, F as JsonObjectEntry, G as ParamRef, H as OperationExpr, I as JsonObjectExpr, J as SelectAst, K as ProjectionExpr, L as ListExpression, M as JoinAst, N as JoinOnExpr, O as IdentifierRef, P as JsonArrayAggExpr, Q as TableSource, R as LiteralExpr, S as EqColJoinOn, T as ExpressionFolder, U as OrExpr, V as NullCheckExpr, W as OrderByItem, X as SubqueryExpr, Y as SelectAstOptions, Z as TableRef, _ as DeleteAst, a as AndExpr, at as whereExprKinds, b as DoNothingConflictAction, c as AnyInsertOnConflictAction, d as AnyQueryAst, et as UpdateAst, f as AstRewriter, g as DefaultValueExpr, h as ColumnRef, i as AggregateOpFn, it as queryAstKinds, j as InsertValue, k as InsertAst, l as AnyInsertValue, m as BinaryOp, n as AggregateExpr, nt as isQueryAst, o as AnyExpression, p as BinaryExpr, q as ProjectionItem, r as AggregateFn, rt as isWhereExpr, s as AnyFromSource, t as AggregateCountFn, tt as WhereArg, u as AnyOperationArg, v as DerivedTableSource, w as ExprVisitor, x as DoUpdateSetConflictAction, y as Direction, z as LoweredStatement } from "./types-C3Hg-CVz.mjs";
|
|
3
3
|
import { Adapter, AdapterProfile, AdapterTarget, Lowerer, LowererContext, MarkerStatement, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SqlCodecTypes, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, SqlExplainResult, SqlQueryResult, SqlQueryable, SqlTransaction, compact, sqlCodecDefinitions, sqlDataTypes } from "./exports/ast.mjs";
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import { C as
|
|
7
|
-
import { n as planUnsupported, t as planInvalid } from "./errors-
|
|
4
|
+
import { a as JsonSchemaValidationResult, c as MutationDefaultsOptions, i as JsonSchemaValidationError, l as TypeHelperRegistry, n as ExecutionContext, o as JsonSchemaValidatorRegistry, r as JsonSchemaValidateFn, s as MutationDefaultsOp, t as AppliedMutationDefault } from "./query-lane-context-DDRW5NBG.mjs";
|
|
5
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-DY0WvJOW.mjs";
|
|
6
|
+
import { C as TableKey, S as TableDef, T as TablesOf, _ as RawTemplateFactory, a as ComputeColumnJsType, b as SqlBuilderOptions, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnsOf, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as Expr, p as OperationTypes, r as CodecTypes, s as HasIncludeManyCapabilities, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TableMetadata, x as SqlPlan, y as RuntimeError } from "./types-CG3u534i.mjs";
|
|
7
|
+
import { n as planUnsupported, t as planInvalid } from "./errors-CDvhnH7P.mjs";
|
|
8
|
+
import { n as augmentDescriptorWithColumnMeta, t as SqlQueryPlan } from "./plan-CRPxW2Jj.mjs";
|
|
8
9
|
import "./exports/plan.mjs";
|
|
9
10
|
import "./exports/query-lane-context.mjs";
|
|
10
|
-
import "./
|
|
11
|
-
export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyOperationArg, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOptions, BuildParamsMap, Codec, CodecDefBuilder, CodecId, CodecInput, CodecMeta, CodecParamsDescriptor, CodecRegistry, CodecTrait, CodecTraits, CodecTypes, ColumnRef, ColumnsOf, ComputeColumnJsType, DefaultValueExpr, DeleteAst, DerivedTableSource, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ExtractDataTypes, HasIncludeManyCapabilities, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonObjectEntry, JsonObjectExpr, JsonSchemaValidateFn, JsonSchemaValidationError, JsonSchemaValidationResult, JsonSchemaValidatorRegistry, ListExpression, LiteralExpr, LoweredStatement, Lowerer, LowererContext, META, MarkerStatement, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NotExpr, NullCheckExpr, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, ParamRef, ProjectionExpr, ProjectionItem, RawFactory, RawFunctionOptions, RawTemplateFactory, RawTemplateOptions,
|
|
11
|
+
import { n as SqlOrmPlan, t as RuntimeScope } from "./types-B5XsBeaT.mjs";
|
|
12
|
+
export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyOperationArg, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOptions, BuildParamsMap, Codec, CodecDefBuilder, CodecId, CodecInput, CodecMeta, CodecParamsDescriptor, CodecRegistry, CodecTrait, CodecTraits, CodecTypes, ColumnRef, ColumnsOf, ComputeColumnJsType, DefaultValueExpr, DeleteAst, DerivedTableSource, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ExtractDataTypes, HasIncludeManyCapabilities, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonObjectEntry, JsonObjectExpr, JsonSchemaValidateFn, JsonSchemaValidationError, JsonSchemaValidationResult, JsonSchemaValidatorRegistry, ListExpression, LiteralExpr, LoweredStatement, Lowerer, LowererContext, META, MarkerStatement, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NotExpr, NullCheckExpr, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, ParamRef, ProjectionExpr, ProjectionItem, RawFactory, RawFunctionOptions, RawTemplateFactory, RawTemplateOptions, RuntimeError, RuntimeScope, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SelectAstOptions, SqlBuilderOptions, SqlCodecTypes, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, SqlExecutionPlan, SqlExplainResult, SqlOrmPlan, SqlPlan, SqlQueryPlan, SqlQueryResult, SqlQueryable, SqlTransaction, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TypeHelperRegistry, UpdateAst, WhereArg, augmentDescriptorWithColumnMeta, codec, compact, createCodecRegistry, defineCodecs, isQueryAst, isWhereExpr, planInvalid, planUnsupported, queryAstKinds, sqlCodecDefinitions, sqlDataTypes, whereExprKinds };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { d as AnyQueryAst } from "./types-C3Hg-CVz.mjs";
|
|
2
|
+
import { ParamDescriptor } from "@prisma-next/contract/types";
|
|
3
|
+
import { StorageColumn } from "@prisma-next/sql-contract/types";
|
|
4
|
+
import { QueryPlan } from "@prisma-next/framework-components/runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/plan.d.ts
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* SQL query plan produced by lanes before lowering.
|
|
10
|
+
*
|
|
11
|
+
* Lanes build ASTs and metadata but do not perform SQL lowering. The `sql`
|
|
12
|
+
* field is absent — `RuntimeCore` (the runtime base class in
|
|
13
|
+
* `@prisma-next/framework-components/runtime`) drives lowering via the
|
|
14
|
+
* SQL adapter and produces a `SqlExecutionPlan`.
|
|
15
|
+
*
|
|
16
|
+
* Extends the framework-level `QueryPlan<Row>` marker (`meta + _row`) and
|
|
17
|
+
* adds SQL-specific fields (`ast`, `params`). The phantom `_row` property
|
|
18
|
+
* (inherited from `QueryPlan`) is what `ResultType<P>` inspects to recover
|
|
19
|
+
* the row type.
|
|
20
|
+
*/
|
|
21
|
+
interface SqlQueryPlan<Row = unknown> extends QueryPlan<Row> {
|
|
22
|
+
readonly ast: AnyQueryAst;
|
|
23
|
+
readonly params: readonly unknown[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Augments the last ParamDescriptor in the array with codecId and nativeType from columnMeta.
|
|
27
|
+
* This is used when building WHERE expressions to ensure param descriptors have type information.
|
|
28
|
+
*/
|
|
29
|
+
declare function augmentDescriptorWithColumnMeta(descriptors: ParamDescriptor[], columnMeta: StorageColumn | undefined): void;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { augmentDescriptorWithColumnMeta as n, SqlQueryPlan as t };
|
|
32
|
+
//# sourceMappingURL=plan-CRPxW2Jj.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-CRPxW2Jj.d.mts","names":[],"sources":["../src/plan.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAkBA;;;;;AASA;;;;;;UATiB,oCAAoC,UAAU;gBAC/C;;;;;;;iBAQA,+BAAA,cACD,+BACD"}
|
|
@@ -86,4 +86,4 @@ interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<Sql
|
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
88
|
export { JsonSchemaValidationResult as a, MutationDefaultsOptions as c, JsonSchemaValidationError as i, TypeHelperRegistry as l, ExecutionContext as n, JsonSchemaValidatorRegistry as o, JsonSchemaValidateFn as r, MutationDefaultsOp as s, AppliedMutationDefault as t };
|
|
89
|
-
//# sourceMappingURL=query-lane-context-
|
|
89
|
+
//# sourceMappingURL=query-lane-context-DDRW5NBG.d.mts.map
|
package/dist/{query-lane-context-D2H78Mg0.d.mts.map → query-lane-context-DDRW5NBG.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-lane-context-
|
|
1
|
+
{"version":3,"file":"query-lane-context-DDRW5NBG.d.mts","names":[],"sources":["../src/query-lane-context.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAWA;AASA;AASA;AAQA;AASiB,KAnCL,kBAAA,GAAqB,MAmCW,CAAA,MAExB,EAAA,OAAA,CAAA;AAKpB;AAEA;AAKA;AAaiB,UArDA,yBAAA,CAqDgB;EAA4B,SAAA,IAAA,EAAA,MAAA;EAAT,SAAA,OAAA,EAAA,MAAA;EAAgC,SAAA,OAAA,EAAA,MAAA;;;;;AAQlE,KApDN,0BAAA,GAoDM;EAKgB,SAAA,KAAA,EAAA,IAAA;CAKD,GAAA;EAAwC,SAAA,KAAA,EAAA,KAAA;EAAd,SAAA,MAAA,EA5Db,aA4Da,CA5DC,yBA4DD,CAAA;CAAa;;;;;KAtD5D,oBAAA,uBAA2C;;;;;;;;UAStC,2BAAA;;oBAEG;;;;KAKR,kBAAA;KAEA,sBAAA;;;;KAKA,uBAAA;eACG;;mBAEI;;;;;;;;;UAUF,mCAAmC,SAAS,cAAc,SAAS;qBAC/D;mBACF;4BACS;;;;;kBAKV;;;;;kCAKgB;;;;;iCAKD,0BAA0B,cAAc"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { d as AnyQueryAst } from "./types-C3Hg-CVz.mjs";
|
|
2
|
+
import { ExecutionPlan } from "@prisma-next/framework-components/runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/sql-execution-plan.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* SQL-domain execution plan: a query lowered to the wire-level shape that a
|
|
8
|
+
* SQL driver can run.
|
|
9
|
+
*
|
|
10
|
+
* The plan carries:
|
|
11
|
+
* - `sql` — the rendered SQL text
|
|
12
|
+
* - `params` — the bound parameter list
|
|
13
|
+
* - `ast` — optional pre-lowering AST, retained for telemetry / debugging
|
|
14
|
+
* - `meta` — family-agnostic plan metadata (target, lane, hashes, ...)
|
|
15
|
+
* - `_row` — phantom row type, propagated from the originating `SqlQueryPlan`
|
|
16
|
+
*
|
|
17
|
+
* Extends the framework-level `ExecutionPlan<Row>` marker so generic SPIs
|
|
18
|
+
* (`RuntimeExecutor<SqlExecutionPlan>`, `RuntimeMiddleware<SqlExecutionPlan>`)
|
|
19
|
+
* can be parameterized over it.
|
|
20
|
+
*
|
|
21
|
+
* Co-located with `SqlQueryPlan` (its pre-lowering counterpart) in the lanes
|
|
22
|
+
* layer because lane-level utilities (`RawTemplateFactory`, `RawFactory`,
|
|
23
|
+
* `SqlPlan`) compose against the executable shape and the lanes layer cannot
|
|
24
|
+
* depend on the runtime layer.
|
|
25
|
+
*/
|
|
26
|
+
interface SqlExecutionPlan<Row = unknown> extends ExecutionPlan<Row> {
|
|
27
|
+
readonly sql: string;
|
|
28
|
+
readonly params: readonly unknown[];
|
|
29
|
+
readonly ast?: AnyQueryAst;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { SqlExecutionPlan as t };
|
|
33
|
+
//# sourceMappingURL=sql-execution-plan-DY0WvJOW.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-execution-plan-DY0WvJOW.d.mts","names":[],"sources":["../src/sql-execution-plan.ts"],"sourcesContent":[],"mappings":";;;;;;;AAuBA;;;;;;;;;;;;;;;;;;UAAiB,wCAAwC,cAAc;;;iBAGtD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-DY0WvJOW.mjs";
|
|
2
|
+
import { t as SqlQueryPlan } from "./plan-CRPxW2Jj.mjs";
|
|
3
|
+
import { RuntimeExecutor } from "@prisma-next/framework-components/runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/runtime-scope.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The plan shape accepted by the SQL ORM client and SQL runtime: either a
|
|
9
|
+
* pre-lowering `SqlQueryPlan` (AST + meta) or a post-lowering
|
|
10
|
+
* `SqlExecutionPlan` (sql + params + meta).
|
|
11
|
+
*/
|
|
12
|
+
type SqlOrmPlan = SqlExecutionPlan | SqlQueryPlan;
|
|
13
|
+
/**
|
|
14
|
+
* The minimal SQL-runtime surface that the ORM client and SQL runtime both
|
|
15
|
+
* depend on: the `execute` method of `RuntimeExecutor<SqlOrmPlan>`.
|
|
16
|
+
*
|
|
17
|
+
* Owned by `sql-relational-core` (lanes layer) so both
|
|
18
|
+
* `@prisma-next/sql-runtime` and `@prisma-next/sql-orm-client` consume the
|
|
19
|
+
* same source of truth without a layering inversion.
|
|
20
|
+
*/
|
|
21
|
+
type RuntimeScope = Pick<RuntimeExecutor<SqlOrmPlan>, 'execute'>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SqlOrmPlan as n, RuntimeScope as t };
|
|
24
|
+
//# sourceMappingURL=types-B5XsBeaT.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-B5XsBeaT.d.mts","names":[],"sources":["../src/runtime-scope.ts"],"sourcesContent":[],"mappings":";;;;;;;;AASA;AAUA;;AAAgC,KAVpB,UAAA,GAAa,gBAUO,GAVY,YAUZ;;;;;;;;;KAApB,YAAA,GAAe,KAAK,gBAAgB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as ParamRef,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Contract,
|
|
1
|
+
import { G as ParamRef, h as ColumnRef } from "./types-C3Hg-CVz.mjs";
|
|
2
|
+
import { n as ExecutionContext } from "./query-lane-context-DDRW5NBG.mjs";
|
|
3
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-DY0WvJOW.mjs";
|
|
4
|
+
import { Contract, PlanRefs } from "@prisma-next/contract/types";
|
|
5
5
|
import { ParamSpec } from "@prisma-next/operations";
|
|
6
6
|
import { SqlLoweringSpec } from "@prisma-next/sql-operations";
|
|
7
7
|
import { ExtractFieldOutputTypes, SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
|
|
@@ -107,10 +107,11 @@ type HasIncludeManyCapabilities<TContract extends Contract<SqlStorage>> = TContr
|
|
|
107
107
|
jsonAgg: true;
|
|
108
108
|
} ? true : false : false : false : false : false;
|
|
109
109
|
/**
|
|
110
|
-
* SQL-
|
|
111
|
-
*
|
|
110
|
+
* Alias for the SQL-domain executable plan, exposed under the legacy
|
|
111
|
+
* `SqlPlan` name for compatibility with SQL builder/utility call sites.
|
|
112
|
+
* The canonical name is `SqlExecutionPlan` (`./sql-execution-plan`).
|
|
112
113
|
*/
|
|
113
|
-
type SqlPlan<Row = unknown> =
|
|
114
|
+
type SqlPlan<Row = unknown> = SqlExecutionPlan<Row>;
|
|
114
115
|
/**
|
|
115
116
|
* Helper types for extracting contract structure.
|
|
116
117
|
*/
|
|
@@ -167,9 +168,9 @@ interface RawTemplateOptions {
|
|
|
167
168
|
interface RawFunctionOptions extends RawTemplateOptions {
|
|
168
169
|
readonly params: ReadonlyArray<unknown>;
|
|
169
170
|
}
|
|
170
|
-
type RawTemplateFactory = (strings: TemplateStringsArray, ...values: readonly unknown[]) =>
|
|
171
|
+
type RawTemplateFactory = (strings: TemplateStringsArray, ...values: readonly unknown[]) => SqlExecutionPlan;
|
|
171
172
|
interface RawFactory extends RawTemplateFactory {
|
|
172
|
-
(text: string, options: RawFunctionOptions):
|
|
173
|
+
(text: string, options: RawFunctionOptions): SqlExecutionPlan;
|
|
173
174
|
with(options: RawTemplateOptions): RawTemplateFactory;
|
|
174
175
|
}
|
|
175
176
|
interface RuntimeError extends Error {
|
|
@@ -189,12 +190,6 @@ interface BuildOptions {
|
|
|
189
190
|
interface SqlBuilderOptions<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> {
|
|
190
191
|
readonly context: ExecutionContext<TContract>;
|
|
191
192
|
}
|
|
192
|
-
/**
|
|
193
|
-
* SQL-specific ResultType that works with both Plan and SqlQueryPlan.
|
|
194
|
-
* This extends the core ResultType to also handle SqlQueryPlan.
|
|
195
|
-
* Example: `type Row = ResultType<typeof plan>`
|
|
196
|
-
*/
|
|
197
|
-
type ResultType$1<P> = P extends SqlQueryPlan<infer R> ? R : ResultType<P>;
|
|
198
193
|
//#endregion
|
|
199
|
-
export {
|
|
200
|
-
//# sourceMappingURL=types-
|
|
194
|
+
export { TableKey as C, TableDef as S, TablesOf as T, RawTemplateFactory as _, ComputeColumnJsType as a, SqlBuilderOptions as b, META as c, ModelMetadata as d, OperationTypeSignature as f, RawFunctionOptions as g, RawFactory as h, ColumnsOf as i, Meta as l, OperationsForTypeId as m, BuildParamsMap as n, Expr as o, OperationTypes as p, CodecTypes as r, HasIncludeManyCapabilities as s, BuildOptions as t, ModelDef as u, RawTemplateOptions as v, TableMetadata as w, SqlPlan as x, RuntimeError as y };
|
|
195
|
+
//# sourceMappingURL=types-CG3u534i.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CG3u534i.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAYY,IAAA,GAAO,YAAY;;AAA/B;AAAwC;;KAMnC,mBACe,CAAA,kBAAA,QAAA,CAAS,UAAT,CAAA,EAAA,kBAAA,MAAA,CAAA,GAEhB,SAFgB,CAAA,QAAA,CAAA,SAAA,KAAA,gBAEiC,MAFjC,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,QAEhB,MAEc,MAFd,GAAA,MAAA,GAEgC,MAFhC,CAEuC,CAFvC,CAAA,SAAA;EAAiD,SAAA,OAAA,EAAA;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,EA/BD,aA+BC,CAAA,OAAA,CAAA;;KA5BR,kBAAA,aACD,wDAEN;UAEY,UAAA,SAAmB;0BACV,qBAAqB;gBAC/B,qBAAqB;;UAGpB,YAAA,SAAqB;;;;qBAIjB;;;;UAKJ,cAAA;;;UAIA,YAAA;oBACG;;UAGH,oCAAoC,SAAS,cAAc,SAAS;oBACjE,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/sql-relational-core",
|
|
3
|
-
"version": "0.5.0-dev.
|
|
3
|
+
"version": "0.5.0-dev.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "AST types, query lane context, and type utilities for Prisma Next SQL lanes",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"arktype": "^2.1.29",
|
|
9
9
|
"ts-toolbelt": "^9.6.0",
|
|
10
|
-
"@prisma-next/
|
|
11
|
-
"@prisma-next/
|
|
12
|
-
"@prisma-next/operations": "0.5.0-dev.
|
|
13
|
-
"@prisma-next/sql-contract": "0.5.0-dev.
|
|
14
|
-
"@prisma-next/sql-operations": "0.5.0-dev.
|
|
15
|
-
"@prisma-next/utils": "0.5.0-dev.
|
|
10
|
+
"@prisma-next/contract": "0.5.0-dev.9",
|
|
11
|
+
"@prisma-next/framework-components": "0.5.0-dev.9",
|
|
12
|
+
"@prisma-next/operations": "0.5.0-dev.9",
|
|
13
|
+
"@prisma-next/sql-contract": "0.5.0-dev.9",
|
|
14
|
+
"@prisma-next/sql-operations": "0.5.0-dev.9",
|
|
15
|
+
"@prisma-next/utils": "0.5.0-dev.9"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tsdown": "0.18.4",
|
|
19
19
|
"typescript": "5.9.3",
|
|
20
20
|
"vitest": "4.0.17",
|
|
21
|
-
"@prisma-next/sql-contract-ts": "0.5.0-dev.8",
|
|
22
21
|
"@prisma-next/test-utils": "0.0.1",
|
|
22
|
+
"@prisma-next/sql-contract-ts": "0.5.0-dev.9",
|
|
23
23
|
"@prisma-next/tsconfig": "0.0.0",
|
|
24
24
|
"@prisma-next/tsdown": "0.0.0"
|
|
25
25
|
},
|
package/src/exports/plan.ts
CHANGED
package/src/exports/types.ts
CHANGED
package/src/plan.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ParamDescriptor } from '@prisma-next/contract/types';
|
|
2
|
+
import type { QueryPlan } from '@prisma-next/framework-components/runtime';
|
|
2
3
|
import type { StorageColumn } from '@prisma-next/sql-contract/types';
|
|
3
4
|
import type { AnyQueryAst } from './ast/types';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* SQL query plan produced by lanes before lowering.
|
|
7
8
|
*
|
|
8
|
-
* Lanes build ASTs and metadata but do not perform SQL lowering.
|
|
9
|
-
*
|
|
9
|
+
* Lanes build ASTs and metadata but do not perform SQL lowering. The `sql`
|
|
10
|
+
* field is absent — `RuntimeCore` (the runtime base class in
|
|
11
|
+
* `@prisma-next/framework-components/runtime`) drives lowering via the
|
|
12
|
+
* SQL adapter and produces a `SqlExecutionPlan`.
|
|
10
13
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
+
* Extends the framework-level `QueryPlan<Row>` marker (`meta + _row`) and
|
|
15
|
+
* adds SQL-specific fields (`ast`, `params`). The phantom `_row` property
|
|
16
|
+
* (inherited from `QueryPlan`) is what `ResultType<P>` inspects to recover
|
|
17
|
+
* the row type.
|
|
14
18
|
*/
|
|
15
|
-
export interface SqlQueryPlan<
|
|
16
|
-
extends Pick<ExecutionPlan<_Row, AnyQueryAst>, 'params' | 'meta'> {
|
|
19
|
+
export interface SqlQueryPlan<Row = unknown> extends QueryPlan<Row> {
|
|
17
20
|
readonly ast: AnyQueryAst;
|
|
18
|
-
|
|
19
|
-
// This allows ResultType to extract _Row for SqlQueryPlan values.
|
|
20
|
-
readonly _Row?: _Row;
|
|
21
|
+
readonly params: readonly unknown[];
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RuntimeExecutor } from '@prisma-next/framework-components/runtime';
|
|
2
|
+
import type { SqlQueryPlan } from './plan';
|
|
3
|
+
import type { SqlExecutionPlan } from './sql-execution-plan';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The plan shape accepted by the SQL ORM client and SQL runtime: either a
|
|
7
|
+
* pre-lowering `SqlQueryPlan` (AST + meta) or a post-lowering
|
|
8
|
+
* `SqlExecutionPlan` (sql + params + meta).
|
|
9
|
+
*/
|
|
10
|
+
export type SqlOrmPlan = SqlExecutionPlan | SqlQueryPlan;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The minimal SQL-runtime surface that the ORM client and SQL runtime both
|
|
14
|
+
* depend on: the `execute` method of `RuntimeExecutor<SqlOrmPlan>`.
|
|
15
|
+
*
|
|
16
|
+
* Owned by `sql-relational-core` (lanes layer) so both
|
|
17
|
+
* `@prisma-next/sql-runtime` and `@prisma-next/sql-orm-client` consume the
|
|
18
|
+
* same source of truth without a layering inversion.
|
|
19
|
+
*/
|
|
20
|
+
export type RuntimeScope = Pick<RuntimeExecutor<SqlOrmPlan>, 'execute'>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ExecutionPlan } from '@prisma-next/framework-components/runtime';
|
|
2
|
+
import type { AnyQueryAst } from './ast/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SQL-domain execution plan: a query lowered to the wire-level shape that a
|
|
6
|
+
* SQL driver can run.
|
|
7
|
+
*
|
|
8
|
+
* The plan carries:
|
|
9
|
+
* - `sql` — the rendered SQL text
|
|
10
|
+
* - `params` — the bound parameter list
|
|
11
|
+
* - `ast` — optional pre-lowering AST, retained for telemetry / debugging
|
|
12
|
+
* - `meta` — family-agnostic plan metadata (target, lane, hashes, ...)
|
|
13
|
+
* - `_row` — phantom row type, propagated from the originating `SqlQueryPlan`
|
|
14
|
+
*
|
|
15
|
+
* Extends the framework-level `ExecutionPlan<Row>` marker so generic SPIs
|
|
16
|
+
* (`RuntimeExecutor<SqlExecutionPlan>`, `RuntimeMiddleware<SqlExecutionPlan>`)
|
|
17
|
+
* can be parameterized over it.
|
|
18
|
+
*
|
|
19
|
+
* Co-located with `SqlQueryPlan` (its pre-lowering counterpart) in the lanes
|
|
20
|
+
* layer because lane-level utilities (`RawTemplateFactory`, `RawFactory`,
|
|
21
|
+
* `SqlPlan`) compose against the executable shape and the lanes layer cannot
|
|
22
|
+
* depend on the runtime layer.
|
|
23
|
+
*/
|
|
24
|
+
export interface SqlExecutionPlan<Row = unknown> extends ExecutionPlan<Row> {
|
|
25
|
+
readonly sql: string;
|
|
26
|
+
readonly params: readonly unknown[];
|
|
27
|
+
readonly ast?: AnyQueryAst;
|
|
28
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Contract,
|
|
3
|
-
ResultType as CoreResultType,
|
|
4
|
-
ExecutionPlan,
|
|
5
|
-
PlanRefs,
|
|
6
|
-
} from '@prisma-next/contract/types';
|
|
1
|
+
import type { Contract, PlanRefs } from '@prisma-next/contract/types';
|
|
7
2
|
import type { ParamSpec } from '@prisma-next/operations';
|
|
8
3
|
import type {
|
|
9
4
|
ExtractFieldOutputTypes,
|
|
@@ -11,9 +6,9 @@ import type {
|
|
|
11
6
|
StorageColumn,
|
|
12
7
|
} from '@prisma-next/sql-contract/types';
|
|
13
8
|
import type { SqlLoweringSpec } from '@prisma-next/sql-operations';
|
|
14
|
-
import type {
|
|
15
|
-
import type { SqlQueryPlan } from './plan';
|
|
9
|
+
import type { ColumnRef, ParamRef } from './ast/types';
|
|
16
10
|
import type { ExecutionContext } from './query-lane-context';
|
|
11
|
+
import type { SqlExecutionPlan } from './sql-execution-plan';
|
|
17
12
|
|
|
18
13
|
export type Expr = ColumnRef | ParamRef;
|
|
19
14
|
|
|
@@ -179,10 +174,11 @@ export type HasIncludeManyCapabilities<TContract extends Contract<SqlStorage>> =
|
|
|
179
174
|
: false;
|
|
180
175
|
|
|
181
176
|
/**
|
|
182
|
-
* SQL-
|
|
183
|
-
*
|
|
177
|
+
* Alias for the SQL-domain executable plan, exposed under the legacy
|
|
178
|
+
* `SqlPlan` name for compatibility with SQL builder/utility call sites.
|
|
179
|
+
* The canonical name is `SqlExecutionPlan` (`./sql-execution-plan`).
|
|
184
180
|
*/
|
|
185
|
-
export type SqlPlan<Row = unknown> =
|
|
181
|
+
export type SqlPlan<Row = unknown> = SqlExecutionPlan<Row>;
|
|
186
182
|
|
|
187
183
|
/**
|
|
188
184
|
* Helper types for extracting contract structure.
|
|
@@ -260,10 +256,10 @@ export interface RawFunctionOptions extends RawTemplateOptions {
|
|
|
260
256
|
export type RawTemplateFactory = (
|
|
261
257
|
strings: TemplateStringsArray,
|
|
262
258
|
...values: readonly unknown[]
|
|
263
|
-
) =>
|
|
259
|
+
) => SqlExecutionPlan;
|
|
264
260
|
|
|
265
261
|
export interface RawFactory extends RawTemplateFactory {
|
|
266
|
-
(text: string, options: RawFunctionOptions):
|
|
262
|
+
(text: string, options: RawFunctionOptions): SqlExecutionPlan;
|
|
267
263
|
with(options: RawTemplateOptions): RawTemplateFactory;
|
|
268
264
|
}
|
|
269
265
|
|
|
@@ -287,10 +283,3 @@ export interface BuildOptions {
|
|
|
287
283
|
export interface SqlBuilderOptions<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> {
|
|
288
284
|
readonly context: ExecutionContext<TContract>;
|
|
289
285
|
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* SQL-specific ResultType that works with both Plan and SqlQueryPlan.
|
|
293
|
-
* This extends the core ResultType to also handle SqlQueryPlan.
|
|
294
|
-
* Example: `type Row = ResultType<typeof plan>`
|
|
295
|
-
*/
|
|
296
|
-
export type ResultType<P> = P extends SqlQueryPlan<infer R> ? R : CoreResultType<P>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-DI_RVH66.d.mts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,WAAA,4BAEJ,+EAGT;iBAkBa,eAAA,4BAEJ,+EAGT"}
|
package/dist/plan-Cs65hb-E.d.mts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { d as AnyQueryAst } from "./types-C3Hg-CVz.mjs";
|
|
2
|
-
import { ExecutionPlan, ParamDescriptor } from "@prisma-next/contract/types";
|
|
3
|
-
import { StorageColumn } from "@prisma-next/sql-contract/types";
|
|
4
|
-
|
|
5
|
-
//#region src/plan.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* SQL query plan produced by lanes before lowering.
|
|
9
|
-
*
|
|
10
|
-
* Lanes build ASTs and metadata but do not perform SQL lowering.
|
|
11
|
-
* The `sql` field is absent - lowering happens in the runtime executor.
|
|
12
|
-
*
|
|
13
|
-
* Structurally aligns with ExecutionPlan<Row, AnyQueryAst> (without sql field) to maintain
|
|
14
|
-
* compatibility with ExecutionPlan/Plan-based utilities.
|
|
15
|
-
* The generic parameter `_Row` is preserved for type extraction via ResultType.
|
|
16
|
-
*/
|
|
17
|
-
interface SqlQueryPlan<_Row = unknown> extends Pick<ExecutionPlan<_Row, AnyQueryAst>, 'params' | 'meta'> {
|
|
18
|
-
readonly ast: AnyQueryAst;
|
|
19
|
-
readonly _Row?: _Row;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Augments the last ParamDescriptor in the array with codecId and nativeType from columnMeta.
|
|
23
|
-
* This is used when building WHERE expressions to ensure param descriptors have type information.
|
|
24
|
-
*/
|
|
25
|
-
declare function augmentDescriptorWithColumnMeta(descriptors: ParamDescriptor[], columnMeta: StorageColumn | undefined): void;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { augmentDescriptorWithColumnMeta as n, SqlQueryPlan as t };
|
|
28
|
-
//# sourceMappingURL=plan-Cs65hb-E.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plan-Cs65hb-E.d.mts","names":[],"sources":["../src/plan.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;;;;;;;;AAYgB,UAZC,YAYD,CAAA,OAAA,OAA+B,CAAA,SAXrC,IAYK,CAZA,aAaD,CAbe,IAaf,EAbqB,WAaR,CAAA,EAAA,QAAA,GAAA,MAAA,CAAA,CAAA;gBAZX;kBAGE;;;;;;iBAOF,+BAAA,cACD,+BACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-D3vVZzRZ.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAiBY,IAAA,GAAO,YAAY;;AAA/B;AAAwC;;KAMnC,mBACe,CAAA,kBAAA,QAAA,CAAS,UAAT,CAAA,EAAA,kBAAA,MAAA,CAAA,GAEhB,SAFgB,CAAA,QAAA,CAAA,SAAA,KAAA,gBAEiC,MAFjC,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,QAEhB,MAEc,MAFd,GAAA,MAAA,GAEgC,MAFhC,CAEuC,CAFvC,CAAA,SAAA;EAAiD,SAAA,OAAA,EAAA;IAEnC,SAAA,KAAA,EAC0B,SAD1B;EAAkB,CAAA;AAAO,CAAA,GAGjC,CAHiC,GAAA,KAAA,EACC,CAAA,MAIhC,MAJgC,GAAA,MAAA,CAAA,GAAA,KAAA;;;;AAI1B;KAOb,oBACwB,CAAA,kBAAT,QAAS,CAAA,UAAA,CAAA,EAAA,kBAAA,MAAA,EAAA,mBAAA,MAAA,CAAA,GAGzB,mBAHyB,CAGL,SAHK,EAGM,SAHN,CAAA,SAAA,KAAA,mBAAA,MAAA,GAIzB,SAJyB,CAAA,QAAA,CAAA,SAAA,KAAA,gBAIwB,MAJxB,CAAA,MAAA,EAAA,OAAA,CAAA,GAKvB,SALuB,GAAA,MAKL,MALK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