@prisma-next/sql-relational-core 0.12.0 → 0.13.0-dev.2
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-Cezo7k-i.d.mts → codec-types-DFLA6Hmj.d.mts} +6 -4
- package/dist/codec-types-DFLA6Hmj.d.mts.map +1 -0
- package/dist/ddl-types-D3vlEjMA.d.mts +126 -0
- package/dist/ddl-types-D3vlEjMA.d.mts.map +1 -0
- package/dist/ddl-types-X9_XHUl0.mjs +130 -0
- package/dist/ddl-types-X9_XHUl0.mjs.map +1 -0
- package/dist/{errors-BF7W5uUd.mjs → errors-BwyJxXME.mjs} +1 -1
- package/dist/{errors-BF7W5uUd.mjs.map → errors-BwyJxXME.mjs.map} +1 -1
- package/dist/{errors-Bavu5wZA.d.mts → errors-CPLfzKkw.d.mts} +2 -2
- package/dist/{errors-Bavu5wZA.d.mts.map → errors-CPLfzKkw.d.mts.map} +1 -1
- package/dist/exports/ast.d.mts +11 -15
- package/dist/exports/ast.d.mts.map +1 -1
- package/dist/exports/ast.mjs +4 -3
- package/dist/exports/ast.mjs.map +1 -1
- package/dist/exports/codec-descriptor-registry.d.mts +8 -4
- package/dist/exports/codec-descriptor-registry.d.mts.map +1 -1
- package/dist/exports/codec-descriptor-registry.mjs +24 -26
- package/dist/exports/codec-descriptor-registry.mjs.map +1 -1
- package/dist/exports/contract-free.d.mts +161 -0
- package/dist/exports/contract-free.d.mts.map +1 -0
- package/dist/exports/contract-free.mjs +268 -0
- package/dist/exports/contract-free.mjs.map +1 -0
- package/dist/exports/errors.d.mts +1 -1
- package/dist/exports/errors.mjs +1 -1
- package/dist/exports/expression.d.mts +2 -2
- package/dist/exports/expression.d.mts.map +1 -1
- package/dist/exports/expression.mjs +1 -1
- package/dist/exports/middleware.d.mts +2 -2
- package/dist/exports/middleware.mjs +1 -1
- package/dist/exports/plan.d.mts +2 -2
- package/dist/exports/query-lane-context.d.mts +1 -1
- package/dist/exports/types.d.mts +3 -3
- package/dist/index.d.mts +12 -11
- package/dist/index.mjs +6 -5
- package/dist/{middleware-EOcO8Ogo.d.mts → middleware-BXSFukKU.d.mts} +2 -2
- package/dist/{middleware-EOcO8Ogo.d.mts.map → middleware-BXSFukKU.d.mts.map} +1 -1
- package/dist/{middleware-B0yz0pff.mjs → middleware-CMr4CHNz.mjs} +2 -2
- package/dist/{middleware-B0yz0pff.mjs.map → middleware-CMr4CHNz.mjs.map} +1 -1
- package/dist/{plan-CG3sy5kw.d.mts → plan-DObuWSWi.d.mts} +3 -3
- package/dist/plan-DObuWSWi.d.mts.map +1 -0
- package/dist/{query-lane-context-Dw1Tz0kv.d.mts → query-lane-context-CY0-e8Qo.d.mts} +8 -6
- package/dist/query-lane-context-CY0-e8Qo.d.mts.map +1 -0
- package/dist/{sql-execution-plan-D4OimCVH.d.mts → sql-execution-plan-JwVeAzXt.d.mts} +2 -2
- package/dist/{sql-execution-plan-D4OimCVH.d.mts.map → sql-execution-plan-JwVeAzXt.d.mts.map} +1 -1
- package/dist/{types-C_1ZqLwZ.d.mts → types-BbGUx5Bi.d.mts} +19 -6
- package/dist/types-BbGUx5Bi.d.mts.map +1 -0
- package/dist/{types-DoolOzqd.d.mts → types-CQVke4QO.d.mts} +8 -20
- package/dist/types-CQVke4QO.d.mts.map +1 -0
- package/dist/{types-C4EdOD-s.mjs → types-D72v8s92.mjs} +24 -5
- package/dist/types-D72v8s92.mjs.map +1 -0
- package/dist/{types-CkTDkFcK.d.mts → types-LGikJRYV.d.mts} +3 -3
- package/dist/{types-CkTDkFcK.d.mts.map → types-LGikJRYV.d.mts.map} +1 -1
- package/dist/{util-DWmhUCEO.mjs → util-DQQgv2j1.mjs} +1 -1
- package/dist/{util-DWmhUCEO.mjs.map → util-DQQgv2j1.mjs.map} +1 -1
- package/package.json +14 -13
- package/src/ast/adapter-types.ts +0 -5
- package/src/ast/codec-types.ts +5 -3
- package/src/ast/ddl-types.ts +198 -0
- package/src/ast/types.ts +31 -6
- package/src/codec-descriptor-registry.ts +2 -2
- package/src/codec-ref-for-column.ts +26 -20
- package/src/contract-free/column.ts +56 -0
- package/src/contract-free/dml.ts +17 -0
- package/src/contract-free/table.ts +390 -0
- package/src/exports/ast.ts +1 -0
- package/src/exports/contract-free.ts +26 -0
- package/src/query-lane-context.ts +5 -3
- package/src/types.ts +3 -23
- package/dist/codec-types-Cezo7k-i.d.mts.map +0 -1
- package/dist/plan-CG3sy5kw.d.mts.map +0 -1
- package/dist/query-lane-context-Dw1Tz0kv.d.mts.map +0 -1
- package/dist/types-C4EdOD-s.mjs.map +0 -1
- package/dist/types-C_1ZqLwZ.d.mts.map +0 -1
- package/dist/types-DoolOzqd.d.mts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as planUnsupported, t as planInvalid } from "../errors-
|
|
1
|
+
import { n as planUnsupported, t as planInvalid } from "../errors-CPLfzKkw.mjs";
|
|
2
2
|
export { planInvalid, planUnsupported };
|
package/dist/exports/errors.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as planUnsupported, t as planInvalid } from "../errors-
|
|
1
|
+
import { n as planUnsupported, t as planInvalid } from "../errors-BwyJxXME.mjs";
|
|
2
2
|
export { planInvalid, planUnsupported };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as CodecRef } from "../codec-types-
|
|
2
|
-
import { J as ParamRef, et as RawSqlLiteral, o as AnyExpression } from "../types-
|
|
1
|
+
import { o as CodecRef } from "../codec-types-DFLA6Hmj.mjs";
|
|
2
|
+
import { J as ParamRef, et as RawSqlLiteral, o as AnyExpression } from "../types-BbGUx5Bi.mjs";
|
|
3
3
|
import { QueryOperationReturn } from "@prisma-next/sql-contract/types";
|
|
4
4
|
import { ParamSpec } from "@prisma-next/operations";
|
|
5
5
|
import { SqlLoweringSpec } from "@prisma-next/sql-operations";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.mts","names":[],"sources":["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,EAAY,IAAA,EAAM,kBAAA,CAAmB,CAAA,IAAK,UAAA,CAAW,CAAA;;;AAnGX;AAUnF;;;;;;;;;UAoHiB,eAAA;EACf,UAAA,CAAW,KAAA,EAAO,aAAa;AAAA;;UAIhB,aAAA;EACf,OAAA,mBAA0B,IAAA,EAAM,CAAA,GAAI,UAAA;IAAa,OAAA,EAAS,CAAA;IAAG,QAAA;EAAA;EAC7D,OAAA,8CAAqD,IAAA;IAAA,SAC1C,OAAA,EAAS,CAAA;IAAA,SACT,QAAA,GAAW,CAAA;EAAA,IAClB,UAAA;IAAa,OAAA,EAAS,CAAA;IAAG,QAAA,EAAU,CAAA;EAAA;AAAA;;KAI7B,SAAA,IACV,OAAA,EAAS,oBAAA,KACN,MAAA,EAAQ,mBAAA,OACR,aAAA;AAAA,KAEA,mBAAA,GAAsB,UAAA,CAAW,UAAA,IAAc,QAAA,GAAW,aAAA;AA5H/D;;;;;AAAA,iBA8JgB,YAAA,CAAa,OAAA,EAAS,eAAA,GAAkB,SAAS"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as RawExpr, S as OperationExpr, T as ParamRef } from "../types-
|
|
1
|
+
import { O as RawExpr, S as OperationExpr, T as ParamRef } from "../types-D72v8s92.mjs";
|
|
2
2
|
import { runtimeError } from "@prisma-next/framework-components/runtime";
|
|
3
3
|
//#region src/expression.ts
|
|
4
4
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "../middleware-
|
|
2
|
-
export { ParamRefEntry, ParamRefEntryUnion, ParamRefHandle, SqlParamRefMutator, SqlParamRefMutatorInternal, createSqlParamRefMutator };
|
|
1
|
+
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "../middleware-BXSFukKU.mjs";
|
|
2
|
+
export { type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, type SqlParamRefMutator, type SqlParamRefMutatorInternal, createSqlParamRefMutator };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createSqlParamRefMutator } from "../middleware-
|
|
1
|
+
import { t as createSqlParamRefMutator } from "../middleware-CMr4CHNz.mjs";
|
|
2
2
|
export { createSqlParamRefMutator };
|
package/dist/exports/plan.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as SqlExecutionPlan } from "../sql-execution-plan-
|
|
2
|
-
import { n as planFromAst, t as SqlQueryPlan } from "../plan-
|
|
1
|
+
import { t as SqlExecutionPlan } from "../sql-execution-plan-JwVeAzXt.mjs";
|
|
2
|
+
import { n as planFromAst, t as SqlQueryPlan } from "../plan-DObuWSWi.mjs";
|
|
3
3
|
export { type SqlExecutionPlan, SqlQueryPlan, planFromAst };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "../query-lane-context-
|
|
1
|
+
import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "../query-lane-context-CY0-e8Qo.mjs";
|
|
2
2
|
export { AppliedMutationDefault, CodecDescriptorRegistry, ExecutionContext, MutationDefaultsOp, MutationDefaultsOptions, TypeHelperRegistry };
|
package/dist/exports/types.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { n as SqlOrmPlan, t as RuntimeScope } from "../types-
|
|
3
|
-
export { BuildOptions, BuildParamsMap, CodecTypes, ColumnsOf, ComputeColumnJsType, Expr,
|
|
1
|
+
import { C as TableMetadata, S as TableKey, _ as RawTemplateOptions, a as ComputeColumnJsType, b as SqlPlan, c as Meta, d as OperationTypeSignature, f as OperationTypes, g as RawTemplateFactory, h as RawFunctionOptions, i as ColumnsOf, l as ModelDef, m as RawFactory, n as BuildParamsMap, o as Expr, p as OperationsForTypeId, r as CodecTypes, s as META, t as BuildOptions, u as ModelMetadata, v as RuntimeError, w as TablesOf, x as TableDef, y as SqlBuilderOptions } from "../types-CQVke4QO.mjs";
|
|
2
|
+
import { n as SqlOrmPlan, t as RuntimeScope } from "../types-LGikJRYV.mjs";
|
|
3
|
+
export { BuildOptions, BuildParamsMap, CodecTypes, ColumnsOf, ComputeColumnJsType, Expr, META, Meta, ModelDef, ModelMetadata, OperationTypeSignature, OperationTypes, OperationsForTypeId, RawFactory, RawFunctionOptions, RawTemplateFactory, RawTemplateOptions, RuntimeError, type RuntimeScope, SqlBuilderOptions, type SqlOrmPlan, SqlPlan, TableDef, TableKey, TableMetadata, TablesOf };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { a as CodecMeta, c as ContractCodecRegistry, d as DescriptorCodecTraits, f as ExtractCodecTypes, h as SqlColumnRef, i as CodecDescriptor, l as DescriptorCodecId, m as SqlCodecInstanceContext, n as Codec, o as CodecRef, p as SqlCodecCallContext, r as CodecCallContext, s as CodecTrait, t as AnyCodecDescriptor, u as DescriptorCodecInput } from "./codec-types-
|
|
2
|
-
import { $ as RawSqlExpr, A as InsertAst, B as LiteralExpr, C as EqColJoinOn, D as ExpressionRewriter, E as ExpressionFolder, F as JsonArrayAggExpr, G as OperationExpr, H as LoweredStatement, I as JsonObjectEntry, J as ParamRef, K as OrExpr, L as JsonObjectExpr, M as InsertValue, N as JoinAst, O as ExpressionSource, P as JoinOnExpr, Q as RawExpr, R as LimitOffsetValue, S as DoUpdateSetConflictAction, T as ExprVisitor, U as NotExpr, V as LoweredParam, W as NullCheckExpr, X as ProjectionExpr, Y as PreparedParamRef, Z as ProjectionItem, _ as DefaultValueExpr, a as AndExpr, at as TableSource, b as Direction, c as AnyInsertOnConflictAction, ct as WhereArg, d as AnyParamRef, dt as isQueryAst, et as RawSqlLiteral, f as AnyQueryAst, ft as isWhereExpr, g as ColumnRef, h as BinaryOp, i as AggregateOpFn, it as TableRef, j as InsertOnConflict, k as IdentifierRef, l as AnyInsertValue, lt as WindowFn, m as BinaryExpr, mt as whereExprKinds, n as AggregateExpr, nt as SelectAstOptions, o as AnyExpression, ot as ToWhereExpr, p as AstRewriter, pt as queryAstKinds, q as OrderByItem, r as AggregateFn, rt as SubqueryExpr, s as AnyFromSource, st as UpdateAst, t as AggregateCountFn, tt as SelectAst, u as AnyOperationArg, ut as WindowFuncExpr, v as DeleteAst, w as ExistsExpr, x as DoNothingConflictAction, y as DerivedTableSource, z as ListExpression } from "./types-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
1
|
+
import { a as CodecMeta, c as ContractCodecRegistry, d as DescriptorCodecTraits, f as ExtractCodecTypes, h as SqlColumnRef, i as CodecDescriptor, l as DescriptorCodecId, m as SqlCodecInstanceContext, n as Codec, o as CodecRef, p as SqlCodecCallContext, r as CodecCallContext, s as CodecTrait, t as AnyCodecDescriptor, u as DescriptorCodecInput } from "./codec-types-DFLA6Hmj.mjs";
|
|
2
|
+
import { $ as RawSqlExpr, A as InsertAst, B as LiteralExpr, C as EqColJoinOn, D as ExpressionRewriter, E as ExpressionFolder, F as JsonArrayAggExpr, G as OperationExpr, H as LoweredStatement, I as JsonObjectEntry, J as ParamRef, K as OrExpr, L as JsonObjectExpr, M as InsertValue, N as JoinAst, O as ExpressionSource, P as JoinOnExpr, Q as RawExpr, R as LimitOffsetValue, S as DoUpdateSetConflictAction, T as ExprVisitor, U as NotExpr, V as LoweredParam, W as NullCheckExpr, X as ProjectionExpr, Y as PreparedParamRef, Z as ProjectionItem, _ as DefaultValueExpr, a as AndExpr, at as TableSource, b as Direction, c as AnyInsertOnConflictAction, ct as WhereArg, d as AnyParamRef, dt as isQueryAst, et as RawSqlLiteral, f as AnyQueryAst, ft as isWhereExpr, g as ColumnRef, h as BinaryOp, i as AggregateOpFn, it as TableRef, j as InsertOnConflict, k as IdentifierRef, l as AnyInsertValue, lt as WindowFn, m as BinaryExpr, mt as whereExprKinds, n as AggregateExpr, nt as SelectAstOptions, o as AnyExpression, ot as ToWhereExpr, p as AstRewriter, pt as queryAstKinds, q as OrderByItem, r as AggregateFn, rt as SubqueryExpr, s as AnyFromSource, st as UpdateAst, t as AggregateCountFn, tt as SelectAst, u as AnyOperationArg, ut as WindowFuncExpr, v as DeleteAst, w as ExistsExpr, x as DoNothingConflictAction, y as DerivedTableSource, z as ListExpression } from "./types-BbGUx5Bi.mjs";
|
|
3
|
+
import { a as DdlColumnRenderContext, c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, i as DdlColumnDefaultVisitor, l as FunctionColumnDefault, n as DdlColumn, o as DdlNode, p as isDdlNode, r as DdlColumnDefault, s as DdlTableConstraint, t as AnyDdlColumnDefault, u as LiteralColumnDefault } from "./ddl-types-D3vlEjMA.mjs";
|
|
4
|
+
import { Adapter, AdapterProfile, AdapterTarget, Lowerer, LowererContext, MarkerReadResult, PreparedExecuteRequest, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SqlCharCodec, SqlCharDescriptor, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, collectOrderedParamRefs, compact, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType } from "./exports/ast.mjs";
|
|
5
|
+
import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-CY0-e8Qo.mjs";
|
|
6
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-JwVeAzXt.mjs";
|
|
7
|
+
import { C as TableMetadata, S as TableKey, _ as RawTemplateOptions, a as ComputeColumnJsType, b as SqlPlan, c as Meta, d as OperationTypeSignature, f as OperationTypes, g as RawTemplateFactory, h as RawFunctionOptions, i as ColumnsOf, l as ModelDef, m as RawFactory, n as BuildParamsMap, o as Expr, p as OperationsForTypeId, r as CodecTypes, s as META, t as BuildOptions, u as ModelMetadata, v as RuntimeError, w as TablesOf, x as TableDef, y as SqlBuilderOptions } from "./types-CQVke4QO.mjs";
|
|
8
|
+
import { n as planUnsupported, t as planInvalid } from "./errors-CPLfzKkw.mjs";
|
|
8
9
|
import { BuildOperationSpec, CodecExpression, CodecTypesBase, CodecValue, Expression, RawCodecInferer, RawSqlBuilder, RawSqlTag, ScopeField, TraitExpression, buildOperation, codecOf, createRawSql, param, toExpr } from "./exports/expression.mjs";
|
|
9
|
-
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-
|
|
10
|
-
import { n as planFromAst, t as SqlQueryPlan } from "./plan-
|
|
11
|
-
import { n as SqlOrmPlan, t as RuntimeScope } from "./types-
|
|
12
|
-
export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyOperationArg, AnyParamRef, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, Codec, CodecCallContext, CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecMeta, CodecRef, CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes,
|
|
10
|
+
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-BXSFukKU.mjs";
|
|
11
|
+
import { n as planFromAst, t as SqlQueryPlan } from "./plan-DObuWSWi.mjs";
|
|
12
|
+
import { n as SqlOrmPlan, t as RuntimeScope } from "./types-LGikJRYV.mjs";
|
|
13
|
+
export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyOperationArg, AnyParamRef, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, Codec, type CodecCallContext, type CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecMeta, type CodecRef, type CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionColumnDefault, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonObjectEntry, JsonObjectExpr, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NotExpr, NullCheckExpr, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, ParamRef, type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, PreparedExecuteRequest, PreparedParamRef, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawCodecInferer, RawExpr, RawFactory, RawFunctionOptions, RawSqlBuilder, RawSqlExpr, RawSqlLiteral, RawSqlTag, RawTemplateFactory, RawTemplateOptions, RuntimeError, type 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, ScopeField, SelectAst, SelectAstOptions, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, type SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, type SqlOrmPlan, type SqlParamRefMutator, type SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, buildOperation, codecOf, collectOrderedParamRefs, compact, createRawSql, createSqlParamRefMutator, isDdlNode, isQueryAst, isWhereExpr, param, planFromAst, planInvalid, planUnsupported, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, toExpr, whereExprKinds };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
1
|
+
import { a as FunctionColumnDefault, c as UniqueConstraint, i as ForeignKeyConstraint, l as isDdlNode, n as DdlColumnDefault, o as LiteralColumnDefault, r as DdlNode, s as PrimaryKeyConstraint, t as DdlColumn } from "./ddl-types-X9_XHUl0.mjs";
|
|
2
|
+
import { A as SelectAst, C as OrExpr, D as ProjectionItem, E as PreparedParamRef, F as isQueryAst, I as isWhereExpr, L as queryAstKinds, M as TableSource, N as UpdateAst, O as RawExpr, P as WindowFuncExpr, R as whereExprKinds, S as OperationExpr, T as ParamRef, _ as JsonObjectExpr, a as DefaultValueExpr, b as NotExpr, c as DoNothingConflictAction, d as ExistsExpr, f as IdentifierRef, g as JsonArrayAggExpr, h as JoinAst, i as ColumnRef, j as SubqueryExpr, k as RawSqlExpr, l as DoUpdateSetConflictAction, m as InsertOnConflict, n as AndExpr, o as DeleteAst, p as InsertAst, r as BinaryExpr, s as DerivedTableSource, t as AggregateExpr, u as EqColJoinOn, v as ListExpression, w as OrderByItem, x as NullCheckExpr, y as LiteralExpr } from "./types-D72v8s92.mjs";
|
|
3
|
+
import { n as compact, t as collectOrderedParamRefs } from "./util-DQQgv2j1.mjs";
|
|
3
4
|
import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType } from "./exports/ast.mjs";
|
|
4
|
-
import { n as planUnsupported, t as planInvalid } from "./errors-
|
|
5
|
+
import { n as planUnsupported, t as planInvalid } from "./errors-BwyJxXME.mjs";
|
|
5
6
|
import { buildOperation, codecOf, createRawSql, param, toExpr } from "./exports/expression.mjs";
|
|
6
|
-
import { t as createSqlParamRefMutator } from "./middleware-
|
|
7
|
+
import { t as createSqlParamRefMutator } from "./middleware-CMr4CHNz.mjs";
|
|
7
8
|
import { planFromAst } from "./exports/plan.mjs";
|
|
8
9
|
import "./exports/query-lane-context.mjs";
|
|
9
10
|
import "./exports/types.mjs";
|
|
10
|
-
export { AggregateExpr, AndExpr, BinaryExpr, ColumnRef, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonObjectExpr, ListExpression, LiteralExpr, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, ProjectionItem, RawExpr, RawSqlExpr, 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, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UpdateAst, WindowFuncExpr, buildOperation, codecOf, collectOrderedParamRefs, compact, createRawSql, createSqlParamRefMutator, isQueryAst, isWhereExpr, param, planFromAst, planInvalid, planUnsupported, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, toExpr, whereExprKinds };
|
|
11
|
+
export { AggregateExpr, AndExpr, BinaryExpr, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionColumnDefault, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawSqlExpr, 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, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, buildOperation, codecOf, collectOrderedParamRefs, compact, createRawSql, createSqlParamRefMutator, isDdlNode, isQueryAst, isWhereExpr, param, planFromAst, planInvalid, planUnsupported, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, toExpr, whereExprKinds };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-
|
|
1
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-JwVeAzXt.mjs";
|
|
2
2
|
import { ParamRefMutator } from "@prisma-next/framework-components/runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/param-ref-mutator.d.ts
|
|
@@ -116,4 +116,4 @@ interface SqlParamRefMutatorInternal<TCodecMap extends Record<string, unknown> =
|
|
|
116
116
|
declare function createSqlParamRefMutator<TCodecMap extends Record<string, unknown> = Record<string, unknown>>(plan: SqlExecutionPlan): SqlParamRefMutatorInternal<TCodecMap>;
|
|
117
117
|
//#endregion
|
|
118
118
|
export { SqlParamRefMutatorInternal as a, SqlParamRefMutator as i, ParamRefEntryUnion as n, createSqlParamRefMutator as o, ParamRefHandle as r, ParamRefEntry as t };
|
|
119
|
-
//# sourceMappingURL=middleware-
|
|
119
|
+
//# sourceMappingURL=middleware-BXSFukKU.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-
|
|
1
|
+
{"version":3,"file":"middleware-BXSFukKU.d.mts","names":[],"sources":["../src/middleware/param-ref-mutator.ts"],"mappings":";;;;;;AAG8D;;;;AAYd;AAWhD;;;cAXc,mBAAA;;;;;AAY4B;AAQ1C;;;;UATiB,cAAA;EAAA,UACL,mBAAmB,GAAG,QAAA;AAAA;;;;;;UAQjB,aAAA;EAAA,SACN,GAAA,EAAK,cAAA,CAAe,QAAA;EAAA,SACpB,KAAA;EAAA,SACA,OAAA,EAAS,QAAA;AAAA;AAWpB;;;;;;;;AAAA,KAAY,kBAAA,mBAAqC,MAAA,mCAC/B,SAAA,YAAqB,aAAA,CAAc,CAAA,UAAW,SAAA,aAC5D,aAAA;;;;;;;;;;AAAa;AA0BjB;;;;;;;;;;;;;;UAAiB,kBAAA,mBACG,MAAA,oBAA0B,MAAA,2BACpC,eAAA;EAmBU;EAjBlB,OAAA,IAAW,gBAAA,CAAiB,kBAAA,CAAmB,SAAA;EAFvC;;;;;;EAUR,YAAA,wBAAoC,SAAA,WAClC,GAAA,EAAK,cAAA,CAAe,QAAA,GACpB,QAAA,EAAU,SAAA,CAAU,QAAA;EAEtB,YAAA,CAAa,GAAA,EAAK,cAAA,aAA2B,QAAA;EAZlC;EAeX,aAAA,CACE,OAAA,EAAS,QAAA;IAAA,SACE,GAAA,EAAK,cAAA,QAAsB,SAAA;IAAA,SAC3B,QAAA;EAAA;AAAA;;;;;;;;;;;UAeE,0BAAA,mBACG,MAAA,oBAA0B,MAAA,2BACpC,kBAAA,CAAmB,SAAA;EAC3B,aAAA;AAAA;;;;;;AAjBI;AAcN;;;;;;;;;iBAuBgB,wBAAA,mBACI,MAAA,oBAA0B,MAAA,mBAC5C,IAAA,EAAM,gBAAA,GAAmB,0BAAA,CAA2B,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as collectOrderedParamRefs } from "./util-
|
|
1
|
+
import { t as collectOrderedParamRefs } from "./util-DQQgv2j1.mjs";
|
|
2
2
|
//#region src/middleware/param-ref-mutator.ts
|
|
3
3
|
/**
|
|
4
4
|
* Build a {@link SqlParamRefMutatorInternal} for the given lowered plan.
|
|
@@ -77,4 +77,4 @@ function createSqlParamRefMutator(plan) {
|
|
|
77
77
|
//#endregion
|
|
78
78
|
export { createSqlParamRefMutator as t };
|
|
79
79
|
|
|
80
|
-
//# sourceMappingURL=middleware-
|
|
80
|
+
//# sourceMappingURL=middleware-CMr4CHNz.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-B0yz0pff.mjs","names":[],"sources":["../src/middleware/param-ref-mutator.ts"],"sourcesContent":["import type { ParamRefMutator } from '@prisma-next/framework-components/runtime';\nimport type { AnyParamRef } from '../ast/types';\nimport { collectOrderedParamRefs } from '../ast/util';\nimport type { SqlExecutionPlan } from '../sql-execution-plan';\n\n/**\n * Brand applied to {@link ParamRefHandle} so user-constructed handles\n * are rejected by the type system. The mutator only accepts handles it\n * produced from `entries()`.\n *\n * The brand is a phantom type — there is no runtime token. At runtime\n * the handle is the underlying `ParamRef` instance from the plan's\n * `ast`; the brand only narrows the type-level surface so callers\n * cannot fabricate a handle from a fresh `ParamRef.of(...)`.\n */\ndeclare const paramRefHandleBrand: unique symbol;\n\n/**\n * Opaque token identifying a single `ParamRef` in the plan. Produced by\n * {@link SqlParamRefMutator.entries}; consumed by `replaceValue` /\n * `replaceValues`.\n *\n * The phantom `TCodecId` parameter records the codec id of the\n * referenced `ParamRef` so type-level inference can route replacement\n * values through `TCodecMap` to the codec's declared `TInput`.\n */\nexport interface ParamRefHandle<TCodecId extends string | undefined = string | undefined> {\n readonly [paramRefHandleBrand]: TCodecId;\n}\n\n/**\n * One outbound `ParamRef` slot in the plan exposed to middleware.\n * `value` is the current value (post any prior middleware mutations);\n * `codecId` is the codec id declared on the underlying `ParamRef.codec`.\n */\nexport interface ParamRefEntry<TCodecId extends string | undefined = string | undefined> {\n readonly ref: ParamRefHandle<TCodecId>;\n readonly value: unknown;\n readonly codecId: TCodecId;\n}\n\n/**\n * Discriminated entry union over a codec map. For each `K` in\n * `TCodecMap`, `entries()` may yield a `ParamRefEntry<K>`; ParamRefs\n * with no codec id (or a codec id outside the map) yield a\n * `ParamRefEntry<undefined>`. Pattern-matching on `entry.codecId`\n * narrows `entry.ref` to a `ParamRefHandle<K>`, which routes through\n * the typed `replaceValue` overload.\n */\nexport type ParamRefEntryUnion<TCodecMap extends Record<string, unknown>> =\n | { [K in keyof TCodecMap & string]: ParamRefEntry<K> }[keyof TCodecMap & string]\n | ParamRefEntry<undefined>;\n\n/**\n * SQL-family mutator threaded into `SqlMiddleware.beforeExecute` as\n * `params`. Scope is `ParamRef.value` slots only — middleware cannot\n * insert / remove `ParamRef`s, rewrite SQL, or modify projection. The\n * type-level `ParamRefHandle` brand and the `replaceValue(ref,\n * newValue)` shape enforce this at compile time.\n *\n * `entries()` surfaces both literal call-site `ParamRef` slots and\n * `prepare()`-time `PreparedParamRef` bind slots; the handle and codec\n * id work the same for both.\n *\n * Allocation discipline: the mutator is constructed lazily from the\n * plan. `entries()` walks the plan's existing AST without allocating\n * an intermediate array; the working params buffer is only allocated\n * on the first `replaceValue` / `replaceValues` call. If no middleware\n * mutates, `currentParams()` returns the plan's original `params` by\n * reference identity.\n *\n * The `TCodecMap` parameter is a record keyed by codec id; `replaceValue`\n * infers `newValue` from `TCodecMap[H['codecId']]` for handles whose\n * codec id is statically resolvable. For codec ids the type system\n * cannot resolve, `newValue` falls back to `unknown` and the middleware\n * is on the hook for runtime correctness.\n */\nexport interface SqlParamRefMutator<\n TCodecMap extends Record<string, unknown> = Record<string, unknown>,\n> extends ParamRefMutator {\n /** Iterate every outbound `ParamRef` the plan currently carries, in canonical order. */\n entries(): IterableIterator<ParamRefEntryUnion<TCodecMap>>;\n\n /**\n * Replace one `ParamRef`'s value with the result of bulk processing.\n * `newValue` is constrained to the codec's declared `TInput` for codec\n * ids the type system can resolve via `TCodecMap`; for unresolvable\n * codec ids `newValue` is `unknown` (the second overload).\n */\n replaceValue<TCodecId extends keyof TCodecMap & string>(\n ref: ParamRefHandle<TCodecId>,\n newValue: TCodecMap[TCodecId],\n ): void;\n replaceValue(ref: ParamRefHandle<undefined>, newValue: unknown): void;\n\n /** Replace many at once (typical for bulk-pattern middleware). */\n replaceValues(\n updates: Iterable<{\n readonly ref: ParamRefHandle<(keyof TCodecMap & string) | undefined>;\n readonly newValue: unknown;\n }>,\n ): void;\n}\n\n/**\n * Internal-only view of the mutator that exposes the post-mutation params\n * array to the SQL runtime. The runtime calls `currentParams()` after the\n * `beforeExecute` chain has run; the result is the plan's original\n * `params` by reference identity if no middleware mutated, otherwise a\n * frozen new array carrying the mutations applied in chain order.\n *\n * Family-internal contract — `SqlMiddleware` consumers never see this\n * shape; they receive the public `SqlParamRefMutator` view above.\n */\nexport interface SqlParamRefMutatorInternal<\n TCodecMap extends Record<string, unknown> = Record<string, unknown>,\n> extends SqlParamRefMutator<TCodecMap> {\n currentParams(): readonly unknown[];\n}\n\ntype AnyHandle = ParamRefHandle<string | undefined>;\n\n/**\n * Build a {@link SqlParamRefMutatorInternal} for the given lowered plan.\n *\n * The mutator captures `plan.params` by reference and walks\n * `plan.ast` (via `collectOrderedParamRefs`) on demand to build\n * entries. Mutations write to a lazily-allocated working copy so the\n * fast path (no mutation) preserves bit-for-bit reference identity to\n * the original `plan.params`.\n *\n * Threading: `plan.ast` carries the canonical `ParamRef` ordering used\n * by every consumer (renderer's `$N` index map, encode-side metadata\n * walk, etc.). The mutator's `entries()` yields the same order so\n * middleware that filters by codec id sees ParamRefs in the order the\n * runtime will encode them.\n */\nexport function createSqlParamRefMutator<\n TCodecMap extends Record<string, unknown> = Record<string, unknown>,\n>(plan: SqlExecutionPlan): SqlParamRefMutatorInternal<TCodecMap> {\n const originalParams = plan.params;\n const refs: ReadonlyArray<AnyParamRef> = plan.ast ? collectOrderedParamRefs(plan.ast) : [];\n let workingParams: unknown[] | undefined;\n\n const indexOfRef = (handle: AnyHandle): number => {\n // The handle is the underlying ParamRef instance the mutator yielded\n // from entries(); equality is identity equality on the ParamRef. The\n // brand on ParamRefHandle is unforgeable from outside, so the only\n // legal handles came from this mutator's entries().\n return refs.indexOf(handle as unknown as AnyParamRef);\n };\n\n const ensureWorkingParams = (): unknown[] => {\n if (!workingParams) {\n workingParams = [...originalParams];\n }\n return workingParams;\n };\n\n const writeAt = (index: number, value: unknown): void => {\n const buffer = ensureWorkingParams();\n buffer[index] = value;\n };\n\n function* entries(): IterableIterator<ParamRefEntryUnion<TCodecMap>> {\n const view = workingParams ?? originalParams;\n for (let i = 0; i < refs.length; i++) {\n const ref = refs[i];\n if (!ref) continue;\n const handle = ref as unknown as ParamRefHandle<string | undefined>;\n let value: unknown;\n let codecId: string | undefined;\n if (ref.kind === 'param-ref') {\n value = i < view.length ? view[i] : ref.value;\n codecId = ref.codec?.codecId;\n } else {\n // PreparedParamRef positions carry no AST-side fallback value —\n // the slot value at index `i` is the only source.\n value = i < view.length ? view[i] : undefined;\n codecId = ref.codec.codecId;\n }\n // The runtime erases the discriminated union to a single shape; the\n // public type pins each entry's `ref` to the matching `codecId`\n // arm at compile time.\n const entry: ParamRefEntry<string | undefined> = { ref: handle, value, codecId };\n yield entry as ParamRefEntryUnion<TCodecMap>;\n }\n }\n\n function replaceValue(handle: AnyHandle, newValue: unknown): void {\n const index = indexOfRef(handle);\n if (index < 0) {\n // Handle does not belong to this plan. The type system pins this\n // at the brand level; this runtime check guards against handles\n // smuggled across plans.\n return;\n }\n writeAt(index, newValue);\n }\n\n function replaceValues(\n updates: Iterable<{ readonly ref: AnyHandle; readonly newValue: unknown }>,\n ): void {\n for (const { ref, newValue } of updates) {\n const index = indexOfRef(ref);\n if (index < 0) continue;\n writeAt(index, newValue);\n }\n }\n\n // The public `SqlParamRefMutator` declares overloaded `replaceValue`\n // signatures (typed-by-codec / unresolvable-codec). The implementation\n // is one function with a permissive runtime signature; the cast is the\n // single point at which the runtime function meets the typed overload\n // surface, matching the overload-implementation pattern.\n return {\n entries,\n replaceValue: replaceValue as SqlParamRefMutator<TCodecMap>['replaceValue'],\n replaceValues,\n currentParams(): readonly unknown[] {\n if (!workingParams) {\n return originalParams;\n }\n return Object.freeze([...workingParams]);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyIA,SAAgB,yBAEd,MAA+D;CAC/D,MAAM,iBAAiB,KAAK;CAC5B,MAAM,OAAmC,KAAK,MAAM,wBAAwB,KAAK,GAAG,IAAI,CAAC;CACzF,IAAI;CAEJ,MAAM,cAAc,WAA8B;EAKhD,OAAO,KAAK,QAAQ,MAAgC;CACtD;CAEA,MAAM,4BAAuC;EAC3C,IAAI,CAAC,eACH,gBAAgB,CAAC,GAAG,cAAc;EAEpC,OAAO;CACT;CAEA,MAAM,WAAW,OAAe,UAAyB;EACvD,MAAM,SAAS,oBAAoB;EACnC,OAAO,SAAS;CAClB;CAEA,UAAU,UAA2D;EACnE,MAAM,OAAO,iBAAiB;EAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;GACpC,MAAM,MAAM,KAAK;GACjB,IAAI,CAAC,KAAK;GACV,MAAM,SAAS;GACf,IAAI;GACJ,IAAI;GACJ,IAAI,IAAI,SAAS,aAAa;IAC5B,QAAQ,IAAI,KAAK,SAAS,KAAK,KAAK,IAAI;IACxC,UAAU,IAAI,OAAO;GACvB,OAAO;IAGL,QAAQ,IAAI,KAAK,SAAS,KAAK,KAAK,KAAA;IACpC,UAAU,IAAI,MAAM;GACtB;GAKA,MAAM;IAD6C,KAAK;IAAQ;IAAO;GAC7D;EACZ;CACF;CAEA,SAAS,aAAa,QAAmB,UAAyB;EAChE,MAAM,QAAQ,WAAW,MAAM;EAC/B,IAAI,QAAQ,GAIV;EAEF,QAAQ,OAAO,QAAQ;CACzB;CAEA,SAAS,cACP,SACM;EACN,KAAK,MAAM,EAAE,KAAK,cAAc,SAAS;GACvC,MAAM,QAAQ,WAAW,GAAG;GAC5B,IAAI,QAAQ,GAAG;GACf,QAAQ,OAAO,QAAQ;EACzB;CACF;CAOA,OAAO;EACL;EACc;EACd;EACA,gBAAoC;GAClC,IAAI,CAAC,eACH,OAAO;GAET,OAAO,OAAO,OAAO,CAAC,GAAG,aAAa,CAAC;EACzC;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"middleware-CMr4CHNz.mjs","names":[],"sources":["../src/middleware/param-ref-mutator.ts"],"sourcesContent":["import type { ParamRefMutator } from '@prisma-next/framework-components/runtime';\nimport type { AnyParamRef } from '../ast/types';\nimport { collectOrderedParamRefs } from '../ast/util';\nimport type { SqlExecutionPlan } from '../sql-execution-plan';\n\n/**\n * Brand applied to {@link ParamRefHandle} so user-constructed handles\n * are rejected by the type system. The mutator only accepts handles it\n * produced from `entries()`.\n *\n * The brand is a phantom type — there is no runtime token. At runtime\n * the handle is the underlying `ParamRef` instance from the plan's\n * `ast`; the brand only narrows the type-level surface so callers\n * cannot fabricate a handle from a fresh `ParamRef.of(...)`.\n */\ndeclare const paramRefHandleBrand: unique symbol;\n\n/**\n * Opaque token identifying a single `ParamRef` in the plan. Produced by\n * {@link SqlParamRefMutator.entries}; consumed by `replaceValue` /\n * `replaceValues`.\n *\n * The phantom `TCodecId` parameter records the codec id of the\n * referenced `ParamRef` so type-level inference can route replacement\n * values through `TCodecMap` to the codec's declared `TInput`.\n */\nexport interface ParamRefHandle<TCodecId extends string | undefined = string | undefined> {\n readonly [paramRefHandleBrand]: TCodecId;\n}\n\n/**\n * One outbound `ParamRef` slot in the plan exposed to middleware.\n * `value` is the current value (post any prior middleware mutations);\n * `codecId` is the codec id declared on the underlying `ParamRef.codec`.\n */\nexport interface ParamRefEntry<TCodecId extends string | undefined = string | undefined> {\n readonly ref: ParamRefHandle<TCodecId>;\n readonly value: unknown;\n readonly codecId: TCodecId;\n}\n\n/**\n * Discriminated entry union over a codec map. For each `K` in\n * `TCodecMap`, `entries()` may yield a `ParamRefEntry<K>`; ParamRefs\n * with no codec id (or a codec id outside the map) yield a\n * `ParamRefEntry<undefined>`. Pattern-matching on `entry.codecId`\n * narrows `entry.ref` to a `ParamRefHandle<K>`, which routes through\n * the typed `replaceValue` overload.\n */\nexport type ParamRefEntryUnion<TCodecMap extends Record<string, unknown>> =\n | { [K in keyof TCodecMap & string]: ParamRefEntry<K> }[keyof TCodecMap & string]\n | ParamRefEntry<undefined>;\n\n/**\n * SQL-family mutator threaded into `SqlMiddleware.beforeExecute` as\n * `params`. Scope is `ParamRef.value` slots only — middleware cannot\n * insert / remove `ParamRef`s, rewrite SQL, or modify projection. The\n * type-level `ParamRefHandle` brand and the `replaceValue(ref,\n * newValue)` shape enforce this at compile time.\n *\n * `entries()` surfaces both literal call-site `ParamRef` slots and\n * `prepare()`-time `PreparedParamRef` bind slots; the handle and codec\n * id work the same for both.\n *\n * Allocation discipline: the mutator is constructed lazily from the\n * plan. `entries()` walks the plan's existing AST without allocating\n * an intermediate array; the working params buffer is only allocated\n * on the first `replaceValue` / `replaceValues` call. If no middleware\n * mutates, `currentParams()` returns the plan's original `params` by\n * reference identity.\n *\n * The `TCodecMap` parameter is a record keyed by codec id; `replaceValue`\n * infers `newValue` from `TCodecMap[H['codecId']]` for handles whose\n * codec id is statically resolvable. For codec ids the type system\n * cannot resolve, `newValue` falls back to `unknown` and the middleware\n * is on the hook for runtime correctness.\n */\nexport interface SqlParamRefMutator<\n TCodecMap extends Record<string, unknown> = Record<string, unknown>,\n> extends ParamRefMutator {\n /** Iterate every outbound `ParamRef` the plan currently carries, in canonical order. */\n entries(): IterableIterator<ParamRefEntryUnion<TCodecMap>>;\n\n /**\n * Replace one `ParamRef`'s value with the result of bulk processing.\n * `newValue` is constrained to the codec's declared `TInput` for codec\n * ids the type system can resolve via `TCodecMap`; for unresolvable\n * codec ids `newValue` is `unknown` (the second overload).\n */\n replaceValue<TCodecId extends keyof TCodecMap & string>(\n ref: ParamRefHandle<TCodecId>,\n newValue: TCodecMap[TCodecId],\n ): void;\n replaceValue(ref: ParamRefHandle<undefined>, newValue: unknown): void;\n\n /** Replace many at once (typical for bulk-pattern middleware). */\n replaceValues(\n updates: Iterable<{\n readonly ref: ParamRefHandle<(keyof TCodecMap & string) | undefined>;\n readonly newValue: unknown;\n }>,\n ): void;\n}\n\n/**\n * Internal-only view of the mutator that exposes the post-mutation params\n * array to the SQL runtime. The runtime calls `currentParams()` after the\n * `beforeExecute` chain has run; the result is the plan's original\n * `params` by reference identity if no middleware mutated, otherwise a\n * frozen new array carrying the mutations applied in chain order.\n *\n * Family-internal contract — `SqlMiddleware` consumers never see this\n * shape; they receive the public `SqlParamRefMutator` view above.\n */\nexport interface SqlParamRefMutatorInternal<\n TCodecMap extends Record<string, unknown> = Record<string, unknown>,\n> extends SqlParamRefMutator<TCodecMap> {\n currentParams(): readonly unknown[];\n}\n\ntype AnyHandle = ParamRefHandle<string | undefined>;\n\n/**\n * Build a {@link SqlParamRefMutatorInternal} for the given lowered plan.\n *\n * The mutator captures `plan.params` by reference and walks\n * `plan.ast` (via `collectOrderedParamRefs`) on demand to build\n * entries. Mutations write to a lazily-allocated working copy so the\n * fast path (no mutation) preserves bit-for-bit reference identity to\n * the original `plan.params`.\n *\n * Threading: `plan.ast` carries the canonical `ParamRef` ordering used\n * by every consumer (renderer's `$N` index map, encode-side metadata\n * walk, etc.). The mutator's `entries()` yields the same order so\n * middleware that filters by codec id sees ParamRefs in the order the\n * runtime will encode them.\n */\nexport function createSqlParamRefMutator<\n TCodecMap extends Record<string, unknown> = Record<string, unknown>,\n>(plan: SqlExecutionPlan): SqlParamRefMutatorInternal<TCodecMap> {\n const originalParams = plan.params;\n const refs: ReadonlyArray<AnyParamRef> = plan.ast ? collectOrderedParamRefs(plan.ast) : [];\n let workingParams: unknown[] | undefined;\n\n const indexOfRef = (handle: AnyHandle): number => {\n // The handle is the underlying ParamRef instance the mutator yielded\n // from entries(); equality is identity equality on the ParamRef. The\n // brand on ParamRefHandle is unforgeable from outside, so the only\n // legal handles came from this mutator's entries().\n return refs.indexOf(handle as unknown as AnyParamRef);\n };\n\n const ensureWorkingParams = (): unknown[] => {\n if (!workingParams) {\n workingParams = [...originalParams];\n }\n return workingParams;\n };\n\n const writeAt = (index: number, value: unknown): void => {\n const buffer = ensureWorkingParams();\n buffer[index] = value;\n };\n\n function* entries(): IterableIterator<ParamRefEntryUnion<TCodecMap>> {\n const view = workingParams ?? originalParams;\n for (let i = 0; i < refs.length; i++) {\n const ref = refs[i];\n if (!ref) continue;\n const handle = ref as unknown as ParamRefHandle<string | undefined>;\n let value: unknown;\n let codecId: string | undefined;\n if (ref.kind === 'param-ref') {\n value = i < view.length ? view[i] : ref.value;\n codecId = ref.codec?.codecId;\n } else {\n // PreparedParamRef positions carry no AST-side fallback value —\n // the slot value at index `i` is the only source.\n value = i < view.length ? view[i] : undefined;\n codecId = ref.codec.codecId;\n }\n // The runtime erases the discriminated union to a single shape; the\n // public type pins each entry's `ref` to the matching `codecId`\n // arm at compile time.\n const entry: ParamRefEntry<string | undefined> = { ref: handle, value, codecId };\n yield entry as ParamRefEntryUnion<TCodecMap>;\n }\n }\n\n function replaceValue(handle: AnyHandle, newValue: unknown): void {\n const index = indexOfRef(handle);\n if (index < 0) {\n // Handle does not belong to this plan. The type system pins this\n // at the brand level; this runtime check guards against handles\n // smuggled across plans.\n return;\n }\n writeAt(index, newValue);\n }\n\n function replaceValues(\n updates: Iterable<{ readonly ref: AnyHandle; readonly newValue: unknown }>,\n ): void {\n for (const { ref, newValue } of updates) {\n const index = indexOfRef(ref);\n if (index < 0) continue;\n writeAt(index, newValue);\n }\n }\n\n // The public `SqlParamRefMutator` declares overloaded `replaceValue`\n // signatures (typed-by-codec / unresolvable-codec). The implementation\n // is one function with a permissive runtime signature; the cast is the\n // single point at which the runtime function meets the typed overload\n // surface, matching the overload-implementation pattern.\n return {\n entries,\n replaceValue: replaceValue as SqlParamRefMutator<TCodecMap>['replaceValue'],\n replaceValues,\n currentParams(): readonly unknown[] {\n if (!workingParams) {\n return originalParams;\n }\n return Object.freeze([...workingParams]);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyIA,SAAgB,yBAEd,MAA+D;CAC/D,MAAM,iBAAiB,KAAK;CAC5B,MAAM,OAAmC,KAAK,MAAM,wBAAwB,KAAK,GAAG,IAAI,CAAC;CACzF,IAAI;CAEJ,MAAM,cAAc,WAA8B;EAKhD,OAAO,KAAK,QAAQ,MAAgC;CACtD;CAEA,MAAM,4BAAuC;EAC3C,IAAI,CAAC,eACH,gBAAgB,CAAC,GAAG,cAAc;EAEpC,OAAO;CACT;CAEA,MAAM,WAAW,OAAe,UAAyB;EACvD,MAAM,SAAS,oBAAoB;EACnC,OAAO,SAAS;CAClB;CAEA,UAAU,UAA2D;EACnE,MAAM,OAAO,iBAAiB;EAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;GACpC,MAAM,MAAM,KAAK;GACjB,IAAI,CAAC,KAAK;GACV,MAAM,SAAS;GACf,IAAI;GACJ,IAAI;GACJ,IAAI,IAAI,SAAS,aAAa;IAC5B,QAAQ,IAAI,KAAK,SAAS,KAAK,KAAK,IAAI;IACxC,UAAU,IAAI,OAAO;GACvB,OAAO;IAGL,QAAQ,IAAI,KAAK,SAAS,KAAK,KAAK,KAAA;IACpC,UAAU,IAAI,MAAM;GACtB;GAKA,MAAM;IAD6C,KAAK;IAAQ;IAAO;GAC7D;EACZ;CACF;CAEA,SAAS,aAAa,QAAmB,UAAyB;EAChE,MAAM,QAAQ,WAAW,MAAM;EAC/B,IAAI,QAAQ,GAIV;EAEF,QAAQ,OAAO,QAAQ;CACzB;CAEA,SAAS,cACP,SACM;EACN,KAAK,MAAM,EAAE,KAAK,cAAc,SAAS;GACvC,MAAM,QAAQ,WAAW,GAAG;GAC5B,IAAI,QAAQ,GAAG;GACf,QAAQ,OAAO,QAAQ;EACzB;CACF;CAOA,OAAO;EACL;EACc;EACd;EACA,gBAAoC;GAClC,IAAI,CAAC,eACH,OAAO;GAET,OAAO,OAAO,OAAO,CAAC,GAAG,aAAa,CAAC;EACzC;CACF;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as AnyQueryAst } from "./types-
|
|
1
|
+
import { f as AnyQueryAst } from "./types-BbGUx5Bi.mjs";
|
|
2
|
+
import { Contract } from "@prisma-next/contract/types";
|
|
2
3
|
import { QueryPlan } from "@prisma-next/framework-components/runtime";
|
|
3
4
|
import { SqlStorage } from "@prisma-next/sql-contract/types";
|
|
4
|
-
import { Contract } from "@prisma-next/contract/types";
|
|
5
5
|
|
|
6
6
|
//#region src/plan.d.ts
|
|
7
7
|
/**
|
|
@@ -41,4 +41,4 @@ interface SqlQueryPlan<Row = unknown> extends QueryPlan<Row> {
|
|
|
41
41
|
declare function planFromAst<Row = unknown>(ast: AnyQueryAst, contract: Contract<SqlStorage>, laneId?: string): SqlQueryPlan<Row>;
|
|
42
42
|
//#endregion
|
|
43
43
|
export { planFromAst as n, SqlQueryPlan as t };
|
|
44
|
-
//# sourceMappingURL=plan-
|
|
44
|
+
//# sourceMappingURL=plan-DObuWSWi.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-DObuWSWi.d.mts","names":[],"sources":["../src/plan.ts"],"mappings":";;;;;;;;AAkBA;;;;;;;;;;;UAAiB,YAAA,wBAAoC,SAAA,CAAU,GAAA;EAAA,SACpD,GAAA,EAAK,WAAA;EAAA,SACL,MAAA;AAAA;AAAM;AAoBjB;;;;;;;;;;;;;;;;AApBiB,iBAoBD,WAAA,gBACd,GAAA,EAAK,WAAA,EACL,QAAA,EAAU,QAAA,CAAS,UAAA,GACnB,MAAA,YACC,YAAA,CAAa,GAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as ContractCodecRegistry } from "./codec-types-
|
|
1
|
+
import { c as ContractCodecRegistry } from "./codec-types-DFLA6Hmj.mjs";
|
|
2
|
+
import { Contract } from "@prisma-next/contract/types";
|
|
2
3
|
import { CodecDescriptor, CodecRef } from "@prisma-next/framework-components/codec";
|
|
3
4
|
import { SqlStorage } from "@prisma-next/sql-contract/types";
|
|
4
|
-
import { Contract } from "@prisma-next/contract/types";
|
|
5
5
|
import { SqlOperationRegistry } from "@prisma-next/sql-operations";
|
|
6
6
|
|
|
7
7
|
//#region src/query-lane-context.d.ts
|
|
@@ -16,15 +16,17 @@ interface CodecDescriptorRegistry {
|
|
|
16
16
|
/**
|
|
17
17
|
* Derive the canonical {@link CodecRef} for a contract `(table, column)`. The builder side calls this at AST construction time to stamp `codec` onto every column-bound `ParamRef` / `ProjectionItem`; the runtime side uses the result as the cache key into the content-keyed codec resolver.
|
|
18
18
|
*
|
|
19
|
-
* Resolution rules over `storage.tables[table].columns[column]`:
|
|
19
|
+
* Resolution rules over `storage.namespaces[namespaceId].tables[table].columns[column]`:
|
|
20
20
|
*
|
|
21
21
|
* - `typeRef` column → emit `{codecId, typeParams}` from `storage.types[typeRef]` (multiple columns sharing the typeRef produce the same ref → same memoised codec).
|
|
22
22
|
* - inline `typeParams` column → emit `{codecId, typeParams}` from the column itself.
|
|
23
23
|
* - non-parameterized column → emit `{codecId}` with `typeParams` undefined (keys as `${codecId}:undefined` → one shared codec).
|
|
24
24
|
*
|
|
25
|
-
*
|
|
25
|
+
* The `namespaceId` coordinate leads and is always supplied — the table is resolved strictly within that namespace, so two same-bare-named tables in different namespaces resolve to their own per-namespace columns/codecs without colliding.
|
|
26
|
+
*
|
|
27
|
+
* Returns `undefined` when the registry was built without contract storage (package-scoped registries used purely as descriptor lookups), when the table or column is unknown in the namespace, or when the column declares a `typeRef` that the storage doesn't define.
|
|
26
28
|
*/
|
|
27
|
-
codecRefForColumn(table: string, column: string): CodecRef | undefined;
|
|
29
|
+
codecRefForColumn(namespaceId: string, table: string, column: string): CodecRef | undefined;
|
|
28
30
|
/**
|
|
29
31
|
* All registered descriptors. Used by `validateCodecRegistryCompleteness` and other startup-time consumers that enumerate descriptors.
|
|
30
32
|
*/
|
|
@@ -80,4 +82,4 @@ interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<Sql
|
|
|
80
82
|
}
|
|
81
83
|
//#endregion
|
|
82
84
|
export { MutationDefaultsOptions as a, MutationDefaultsOp as i, CodecDescriptorRegistry as n, TypeHelperRegistry as o, ExecutionContext as r, AppliedMutationDefault as t };
|
|
83
|
-
//# sourceMappingURL=query-lane-context-
|
|
85
|
+
//# sourceMappingURL=query-lane-context-CY0-e8Qo.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-lane-context-CY0-e8Qo.d.mts","names":[],"sources":["../src/query-lane-context.ts"],"mappings":";;;;;;;;;AASA;UAAiB,uBAAA;;;;EAIf,aAAA,CAAc,OAAA,WAAkB,eAAA;EAkBtB;;;;;;;;;;;;;EAJV,iBAAA,CAAkB,WAAA,UAAqB,KAAA,UAAe,MAAA,WAAiB,QAAA;EAI5C;;;EAA3B,MAAA,IAAU,gBAAA,CAAiB,eAAA;EAI+B;AAAA;AAM5D;EANE,YAAA,CAAa,UAAA,oBAA8B,eAAA;AAAA;;AAMN;AAEvC;KAFY,kBAAA,GAAqB,MAAM;AAAA,KAE3B,kBAAA;AAAA,KAEA,sBAAA;EAAA,SACD,MAAA;EAAA,SACA,KAAK;AAAA;AAAA,KAGJ,uBAAA;EAAA,SACD,EAAA,EAAI,kBAAA;EAAA,SACJ,KAAA;EAAA,SACA,MAAA,EAAQ,MAAA;EAHgB;;;;EAAA,SAQxB,iBAAA,GAAoB,GAAA;AAAA;;;;;;UAQd,gBAAA,mBAAmC,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA;EAAA,SACzE,QAAA,EAAU,SAAA;EATU;;AAAG;EAAH,SAapB,cAAA,EAAgB,qBAAA;EALM;;;EAAA,SAStB,gBAAA,EAAkB,uBAAA;EAAA,SAClB,eAAA,EAAiB,oBAAA;EAV+C;;;EAAA,SAchE,KAAA,EAAO,kBAAA;EAJU;;;EAQ1B,qBAAA,CAAsB,OAAA,EAAS,uBAAA,GAA0B,aAAA,CAAc,sBAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as AnyQueryAst } from "./types-
|
|
1
|
+
import { f as AnyQueryAst } from "./types-BbGUx5Bi.mjs";
|
|
2
2
|
import { ExecutionPlan } from "@prisma-next/framework-components/runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/sql-execution-plan.d.ts
|
|
@@ -29,4 +29,4 @@ interface SqlExecutionPlan<Row = unknown> extends ExecutionPlan<Row> {
|
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
export { SqlExecutionPlan as t };
|
|
32
|
-
//# sourceMappingURL=sql-execution-plan-
|
|
32
|
+
//# sourceMappingURL=sql-execution-plan-JwVeAzXt.d.mts.map
|
package/dist/{sql-execution-plan-D4OimCVH.d.mts.map → sql-execution-plan-JwVeAzXt.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql-execution-plan-
|
|
1
|
+
{"version":3,"file":"sql-execution-plan-JwVeAzXt.d.mts","names":[],"sources":["../src/sql-execution-plan.ts"],"mappings":";;;;;;AAuBA;;;;;;;;;;;;;;;;AAG2B;;UAHV,gBAAA,wBAAwC,aAAA,CAAc,GAAA;EAAA,SAC5D,GAAA;EAAA,SACA,MAAA;EAAA,SACA,GAAA,EAAK,WAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as CodecRef } from "./codec-types-
|
|
1
|
+
import { o as CodecRef } from "./codec-types-DFLA6Hmj.mjs";
|
|
2
2
|
import { ParamSpec } from "@prisma-next/operations";
|
|
3
3
|
import { SqlLoweringSpec } from "@prisma-next/sql-operations";
|
|
4
4
|
|
|
@@ -70,7 +70,7 @@ interface ExpressionFolder<T> {
|
|
|
70
70
|
rawExpr?(expr: RawExpr): T;
|
|
71
71
|
}
|
|
72
72
|
type ProjectionExpr = AnyExpression;
|
|
73
|
-
type InsertValue = ColumnRef | ParamRef | PreparedParamRef | DefaultValueExpr;
|
|
73
|
+
type InsertValue = ColumnRef | ParamRef | PreparedParamRef | DefaultValueExpr | RawExpr;
|
|
74
74
|
type JoinOnExpr = EqColJoinOn | AnyExpression;
|
|
75
75
|
type WhereArg = AnyExpression | ToWhereExpr;
|
|
76
76
|
type JsonObjectEntry = {
|
|
@@ -103,8 +103,15 @@ declare class TableSource extends FromSource {
|
|
|
103
103
|
readonly kind: "table-source";
|
|
104
104
|
readonly name: string;
|
|
105
105
|
readonly alias: string | undefined;
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Resolved storage namespace coordinate for this table, stamped when the
|
|
108
|
+
* table proxy constructs the AST. Renderers qualify via the namespace
|
|
109
|
+
* concretion's `qualifyTable()` using this id — never by re-resolving the
|
|
110
|
+
* bare table name at render time.
|
|
111
|
+
*/
|
|
112
|
+
readonly namespaceId: string | undefined;
|
|
113
|
+
protected constructor(name: string, alias?: string, namespaceId?: string);
|
|
114
|
+
static named(name: string, alias?: string, namespaceId?: string): TableSource;
|
|
108
115
|
rewrite(rewriter: AstRewriter): AnyFromSource;
|
|
109
116
|
toFromSource(): AnyFromSource;
|
|
110
117
|
}
|
|
@@ -297,6 +304,12 @@ declare class OrderByItem extends AstNode {
|
|
|
297
304
|
static asc(expr: AnyExpression): OrderByItem;
|
|
298
305
|
static desc(expr: AnyExpression): OrderByItem;
|
|
299
306
|
rewrite(rewriter: ExpressionRewriter): OrderByItem;
|
|
307
|
+
/**
|
|
308
|
+
* A new frozen item with the sort direction flipped and `expr` unchanged.
|
|
309
|
+
* Integrations that own pagination (e.g. backward cursor pagination) use
|
|
310
|
+
* this to reverse a user's sort order without reaching into the AST.
|
|
311
|
+
*/
|
|
312
|
+
reverse(): OrderByItem;
|
|
300
313
|
}
|
|
301
314
|
declare class JsonArrayAggExpr extends Expression {
|
|
302
315
|
readonly kind: "json-array-agg";
|
|
@@ -574,7 +587,7 @@ type AnyFromSource = TableSource | DerivedTableSource;
|
|
|
574
587
|
type AnyExpression = ColumnRef | IdentifierRef | ParamRef | PreparedParamRef | LiteralExpr | SubqueryExpr | OperationExpr | AggregateExpr | WindowFuncExpr | JsonObjectExpr | JsonArrayAggExpr | ListExpression | BinaryExpr | AndExpr | OrExpr | ExistsExpr | NullCheckExpr | NotExpr | RawExpr;
|
|
575
588
|
type AnyParamRef = ParamRef | PreparedParamRef;
|
|
576
589
|
type AnyInsertOnConflictAction = DoNothingConflictAction | DoUpdateSetConflictAction;
|
|
577
|
-
type AnyInsertValue = ColumnRef | ParamRef | PreparedParamRef | DefaultValueExpr;
|
|
590
|
+
type AnyInsertValue = ColumnRef | ParamRef | PreparedParamRef | DefaultValueExpr | RawExpr;
|
|
578
591
|
type AnyOperationArg = AnyExpression | ParamRef | PreparedParamRef | LiteralExpr;
|
|
579
592
|
declare const queryAstKinds: ReadonlySet<string>;
|
|
580
593
|
declare const whereExprKinds: ReadonlySet<string>;
|
|
@@ -611,4 +624,4 @@ interface LoweredStatement {
|
|
|
611
624
|
}
|
|
612
625
|
//#endregion
|
|
613
626
|
export { RawSqlExpr as $, InsertAst as A, LiteralExpr as B, EqColJoinOn as C, ExpressionRewriter as D, ExpressionFolder as E, JsonArrayAggExpr as F, OperationExpr as G, LoweredStatement as H, JsonObjectEntry as I, ParamRef as J, OrExpr as K, JsonObjectExpr as L, InsertValue as M, JoinAst as N, ExpressionSource as O, JoinOnExpr as P, RawExpr as Q, LimitOffsetValue as R, DoUpdateSetConflictAction as S, ExprVisitor as T, NotExpr as U, LoweredParam as V, NullCheckExpr as W, ProjectionExpr as X, PreparedParamRef as Y, ProjectionItem as Z, DefaultValueExpr as _, AndExpr as a, TableSource as at, Direction as b, AnyInsertOnConflictAction as c, WhereArg as ct, AnyParamRef as d, isQueryAst as dt, RawSqlLiteral as et, AnyQueryAst as f, isWhereExpr as ft, ColumnRef as g, BinaryOp as h, AggregateOpFn as i, TableRef as it, InsertOnConflict as j, IdentifierRef as k, AnyInsertValue as l, WindowFn as lt, BinaryExpr as m, whereExprKinds as mt, AggregateExpr as n, SelectAstOptions as nt, AnyExpression as o, ToWhereExpr as ot, AstRewriter as p, queryAstKinds as pt, OrderByItem as q, AggregateFn as r, SubqueryExpr as rt, AnyFromSource as s, UpdateAst as st, AggregateCountFn as t, SelectAst as tt, AnyOperationArg as u, WindowFuncExpr as ut, DeleteAst as v, ExistsExpr as w, DoNothingConflictAction as x, DerivedTableSource as y, ListExpression as z };
|
|
614
|
-
//# sourceMappingURL=types-
|
|
627
|
+
//# sourceMappingURL=types-BbGUx5Bi.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BbGUx5Bi.d.mts","names":[],"sources":["../src/ast/types.ts"],"mappings":";;;;;K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B;AAAA,KAChD,aAAA,GACR,SAAA,GACA,aAAA,GACA,QAAA,GACA,gBAAA,GACA,WAAA,GACA,YAAA,GACA,aAAA,GACA,aAAA,GACA,cAAA,GACA,cAAA,GACA,gBAAA,GACA,cAAA,GACA,UAAA,GACA,OAAA,GACA,MAAA,GACA,UAAA,GACA,aAAA,GACA,OAAA,GACA,OAAA;AAAA,KACQ,WAAA,GAAc,QAAA,GAAW,gBAAgB;AAAA,KACzC,yBAAA,GAA4B,uBAAA,GAA0B,yBAAyB;AAAA,KAC/E,cAAA,GAAiB,SAAA,GAAY,QAAA,GAAW,gBAAA,GAAmB,gBAAA,GAAmB,OAAA;AAAA,KAC9E,eAAA,GAAkB,aAAA,GAAgB,QAAA,GAAW,gBAAA,GAAmB,WAAA;AAAA,cAE/D,aAAA,EAAe,WAAW;AAAA,cAO1B,cAAA,EAAgB,WAAW;AAAA,iBASxB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,WAAW;AAAA,iBAShD,WAAA,CAAY,KAAA,YAAiB,KAAA,IAAS,aAAa;AAAA,UASlD,WAAA;EACf,WAAA,IAAe,aAAa;AAAA;;;;;;;;;;;;;;AAv/CoB;KAwgDtC,YAAA;EAAA,SACG,IAAA;EAAA,SAA0B,KAAA;AAAA;EAAA,SAC1B,IAAA;EAAA,SAAuB,IAAA;AAAA;AAAA,UAErB,gBAAA;EAAA,SACN,GAAA;EAAA,SACA,MAAA,WAAiB,YAAA;EAAA,SACjB,WAAA,GAAc,MAAM;AAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { J as ParamRef, g as ColumnRef } from "./types-
|
|
2
|
-
import { r as ExecutionContext } from "./query-lane-context-
|
|
3
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-
|
|
1
|
+
import { J as ParamRef, g as ColumnRef } from "./types-BbGUx5Bi.mjs";
|
|
2
|
+
import { r as ExecutionContext } from "./query-lane-context-CY0-e8Qo.mjs";
|
|
3
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-JwVeAzXt.mjs";
|
|
4
|
+
import { Contract, ContractModelDefinitions } from "@prisma-next/contract/types";
|
|
4
5
|
import { ExtractFieldOutputTypes, SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
|
|
5
|
-
import { Contract, ContractModelsMap } from "@prisma-next/contract/types";
|
|
6
6
|
import { ParamSpec } from "@prisma-next/operations";
|
|
7
7
|
import { SqlLoweringSpec } from "@prisma-next/sql-operations";
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ type Expr = ColumnRef | ParamRef;
|
|
|
12
12
|
* Extracts the model name for a given table by iterating models to find the one
|
|
13
13
|
* whose `storage.table` matches.
|
|
14
14
|
*/
|
|
15
|
-
type ExtractTableToModel<TContract extends Contract<SqlStorage>, TableName extends string> =
|
|
15
|
+
type ExtractTableToModel<TContract extends Contract<SqlStorage>, TableName extends string> = ContractModelDefinitions<TContract> extends infer Models extends Record<string, unknown> ? { [M in keyof Models & string]: Models[M] extends {
|
|
16
16
|
readonly storage: {
|
|
17
17
|
readonly table: TableName;
|
|
18
18
|
};
|
|
@@ -21,7 +21,7 @@ type ExtractTableToModel<TContract extends Contract<SqlStorage>, TableName exten
|
|
|
21
21
|
* Extracts the field name for a given column by finding the field in
|
|
22
22
|
* `model.storage.fields` whose `column` matches.
|
|
23
23
|
*/
|
|
24
|
-
type ExtractColumnToField<TContract extends Contract<SqlStorage>, TableName extends string, ColumnName extends string> = ExtractTableToModel<TContract, TableName> extends infer ModelName extends string ?
|
|
24
|
+
type ExtractColumnToField<TContract extends Contract<SqlStorage>, TableName extends string, ColumnName extends string> = ExtractTableToModel<TContract, TableName> extends infer ModelName extends string ? ContractModelDefinitions<TContract> extends infer Models extends Record<string, unknown> ? ModelName & keyof Models extends infer MKey extends string ? Models[MKey] extends {
|
|
25
25
|
readonly storage: {
|
|
26
26
|
readonly fields: infer Fields extends Record<string, unknown>;
|
|
27
27
|
};
|
|
@@ -94,18 +94,6 @@ type OperationsForTypeId<TypeId extends string, Operations extends OperationType
|
|
|
94
94
|
type ComputeColumnJsType<TContract extends Contract<SqlStorage>, TableName extends string, ColumnName extends string, ColumnMeta extends StorageColumn, CodecTypes extends Record<string, {
|
|
95
95
|
readonly output: unknown;
|
|
96
96
|
}>> = ExtractTableToModel<TContract, TableName> extends infer ModelName ? [ModelName] extends [never] ? FallbackCodecLookup<ColumnMeta, CodecTypes> : ModelName extends string ? ExtractColumnToField<TContract, TableName, ColumnName> extends infer FieldName ? [FieldName] extends [never] ? FallbackCodecLookup<ColumnMeta, CodecTypes> : FieldName extends string ? ModelName extends keyof ExtractFieldOutputTypes<TContract> ? FieldName extends keyof ExtractFieldOutputTypes<TContract>[ModelName] ? ExtractFieldOutputTypes<TContract>[ModelName][FieldName] : never : never : never : never : never : never;
|
|
97
|
-
/**
|
|
98
|
-
* Utility type to check if a contract has the required capabilities for includeMany.
|
|
99
|
-
* Requires both `lateral` and `jsonAgg` to be `true` in the contract's capabilities for the target.
|
|
100
|
-
* Capabilities are nested by target: `{ [target]: { lateral: true, jsonAgg: true } }`
|
|
101
|
-
*/
|
|
102
|
-
type HasIncludeManyCapabilities<TContract extends Contract<SqlStorage>> = TContract extends {
|
|
103
|
-
capabilities: infer C;
|
|
104
|
-
target: infer T;
|
|
105
|
-
} ? T extends string ? C extends Record<string, Record<string, boolean>> ? C extends { [K in T]: infer TargetCaps } ? TargetCaps extends {
|
|
106
|
-
lateral: true;
|
|
107
|
-
jsonAgg: true;
|
|
108
|
-
} ? true : false : false : false : false : false;
|
|
109
97
|
/**
|
|
110
98
|
* Alias for the SQL-domain executable plan, exposed under the legacy
|
|
111
99
|
* `SqlPlan` name for compatibility with SQL builder/utility call sites.
|
|
@@ -189,5 +177,5 @@ interface SqlBuilderOptions<TContract extends Contract<SqlStorage> = Contract<Sq
|
|
|
189
177
|
readonly context: ExecutionContext<TContract>;
|
|
190
178
|
}
|
|
191
179
|
//#endregion
|
|
192
|
-
export {
|
|
193
|
-
//# sourceMappingURL=types-
|
|
180
|
+
export { TableMetadata as C, TableKey as S, RawTemplateOptions as _, ComputeColumnJsType as a, SqlPlan as b, Meta as c, OperationTypeSignature as d, OperationTypes as f, RawTemplateFactory as g, RawFunctionOptions as h, ColumnsOf as i, ModelDef as l, RawFactory as m, BuildParamsMap as n, Expr as o, OperationsForTypeId as p, CodecTypes as r, META as s, BuildOptions as t, ModelMetadata as u, RuntimeError as v, TablesOf as w, TableDef as x, SqlBuilderOptions as y };
|
|
181
|
+
//# sourceMappingURL=types-CQVke4QO.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CQVke4QO.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;KAYY,IAAA,GAAO,SAAA,GAAY,QAAQ;;AAAvC;;;KAMK,mBAAA,mBAAsC,QAAA,CAAS,UAAA,+BAClD,wBAAA,CAAyB,SAAA,+BAAwC,MAAA,kCAE/C,MAAA,YAAkB,MAAA,CAAO,CAAA;EAAA,SAC1B,OAAA;IAAA,SAAoB,KAAA,EAAO,SAAA;EAAA;AAAA,IAElC,CAAA,iBAEE,MAAA;;;;;KAOT,oBAAA,mBACe,QAAA,CAAS,UAAA,0DAI3B,mBAAA,CAAoB,SAAA,EAAW,SAAA,2CAC3B,wBAAA,CAAyB,SAAA,+BAAwC,MAAA,oBAC/D,SAAA,SAAkB,MAAA,qCAChB,MAAA,CAAO,IAAA;EAAA,SACI,OAAA;IAAA,SAAoB,MAAA,uBAA6B,MAAA;EAAA;AAAA,kBAG5C,MAAA,YAAkB,MAAA,CAAO,CAAA;EAAA,SAAsB,MAAA,EAAQ,UAAA;AAAA,IAC/D,CAAA,iBAEE,MAAA;AAAA,KAMf,mBAAA,oBACgB,aAAA,qBACA,MAAA;EAAA,SAA0B,MAAA;AAAA,MAC3C,UAAA;EAAqB,OAAA;AAAA,IACrB,OAAA,eAAsB,UAAA,GACpB,UAAA,CAAW,OAAA;EAAA,SAA4B,MAAA;AAAA,IACrC,UAAA;EAAq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AAM,IAAI;AAAA;;;;UAMK,aAAA;EACf,IAAA,EAAM,IAAI;AAAA;;;AArID;AASX;UAmIiB,QAAA;EAAA,UACL,IAAA,GAAO,aAAA,CAAc,IAAA;AAAA;;;;;UAOhB,QAAA;EAAA,UACL,IAAA,GAAO,aAAA,CAAc,IAAA;AAAA;AAAA,KAGrB,SAAA,sBAEA,QAAA,CAAS,SAAA,KACjB,CAAA,eAAgB,QAAA,CAAS,SAAA,IACzB,QAAA,CAAS,SAAA,EAAW,CAAA;EAAa,OAAA;AAAA,IAC/B,CAAA;AAAA,UAIW,kBAAA;EAAA,SACN,WAAA,GAAc,MAAM;AAAA;AAAA,UAGd,kBAAA,SAA2B,kBAAkB;EAAA,SACnD,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGP,kBAAA,IACV,OAAA,EAAS,oBAAA,KACN,MAAA,yBACA,gBAAgB;AAAA,UAEJ,UAAA,SAAmB,kBAAA;EAAA,CACjC,IAAA,UAAc,OAAA,EAAS,kBAAA,GAAqB,gBAAA;EAC7C,IAAA,CAAK,OAAA,EAAS,kBAAA,GAAqB,kBAAA;AAAA;AAAA,UAGpB,YAAA,SAAqB,KAAK;EAAA,SAChC,IAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA,GAAU,MAAA;EAAA,SACV,KAAA;EAAA,SACA,IAAA;AAAA;AAAA,UAGM,cAAA;EAAA,UACL,IAAY;AAAA;AAAA,UAGP,YAAA;EAAA,SACN,MAAA,GAAS,cAAc;AAAA;AAAA,UAGjB,iBAAA,mBAAoC,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA;EAAA,SAC1E,OAAA,EAAS,gBAAA,CAAiB,SAAA;AAAA"}
|
|
@@ -77,6 +77,7 @@ function rewriteInsertValue(value, rewriter) {
|
|
|
77
77
|
case "prepared-param-ref": return rewriter.preparedParamRef ? rewriter.preparedParamRef(value) : value;
|
|
78
78
|
case "column-ref": return rewriter.columnRef ? rewriteColumnRefForInsert(value, rewriter) : value;
|
|
79
79
|
case "default-value": return value;
|
|
80
|
+
case "raw-expr": return value;
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
function rewriteParamRefForInsert(value, rewriter) {
|
|
@@ -137,14 +138,23 @@ var TableSource = class TableSource extends FromSource {
|
|
|
137
138
|
kind = "table-source";
|
|
138
139
|
name;
|
|
139
140
|
alias;
|
|
140
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Resolved storage namespace coordinate for this table, stamped when the
|
|
143
|
+
* table proxy constructs the AST. Renderers qualify via the namespace
|
|
144
|
+
* concretion's `qualifyTable()` using this id — never by re-resolving the
|
|
145
|
+
* bare table name at render time.
|
|
146
|
+
*/
|
|
147
|
+
namespaceId;
|
|
148
|
+
constructor(name, alias, namespaceId) {
|
|
141
149
|
super();
|
|
142
150
|
this.name = name;
|
|
143
151
|
this.alias = alias;
|
|
144
|
-
this.
|
|
152
|
+
this.namespaceId = namespaceId;
|
|
145
153
|
}
|
|
146
|
-
static named(name, alias) {
|
|
147
|
-
|
|
154
|
+
static named(name, alias, namespaceId) {
|
|
155
|
+
const source = new TableSource(name, alias, namespaceId);
|
|
156
|
+
source.freeze();
|
|
157
|
+
return source;
|
|
148
158
|
}
|
|
149
159
|
rewrite(rewriter) {
|
|
150
160
|
return rewriter.tableSource ? rewriter.tableSource(this) : this;
|
|
@@ -521,6 +531,14 @@ var OrderByItem = class OrderByItem extends AstNode {
|
|
|
521
531
|
rewrite(rewriter) {
|
|
522
532
|
return new OrderByItem(this.expr.rewrite(rewriter), this.dir);
|
|
523
533
|
}
|
|
534
|
+
/**
|
|
535
|
+
* A new frozen item with the sort direction flipped and `expr` unchanged.
|
|
536
|
+
* Integrations that own pagination (e.g. backward cursor pagination) use
|
|
537
|
+
* this to reverse a user's sort order without reaching into the AST.
|
|
538
|
+
*/
|
|
539
|
+
reverse() {
|
|
540
|
+
return new OrderByItem(this.expr, this.dir === "asc" ? "desc" : "asc");
|
|
541
|
+
}
|
|
524
542
|
};
|
|
525
543
|
var JsonArrayAggExpr = class JsonArrayAggExpr extends Expression {
|
|
526
544
|
kind = "json-array-agg";
|
|
@@ -1075,6 +1093,7 @@ var InsertAst = class InsertAst extends QueryAst {
|
|
|
1075
1093
|
collectParamRefs() {
|
|
1076
1094
|
const refs = [];
|
|
1077
1095
|
for (const row of this.rows) for (const value of Object.values(row)) if (value.kind === "param-ref" || value.kind === "prepared-param-ref") refs.push(value);
|
|
1096
|
+
else if (value.kind === "raw-expr") refs.push(...value.collectParamRefs());
|
|
1078
1097
|
if (this.onConflict?.action.kind === "do-update-set") {
|
|
1079
1098
|
for (const value of Object.values(this.onConflict.action.set)) if (value.kind === "param-ref" || value.kind === "prepared-param-ref") refs.push(value);
|
|
1080
1099
|
}
|
|
@@ -1222,4 +1241,4 @@ function isWhereExpr(value) {
|
|
|
1222
1241
|
//#endregion
|
|
1223
1242
|
export { SelectAst as A, OrExpr as C, ProjectionItem as D, PreparedParamRef as E, isQueryAst as F, isWhereExpr as I, queryAstKinds as L, TableSource as M, UpdateAst as N, RawExpr as O, WindowFuncExpr as P, whereExprKinds as R, OperationExpr as S, ParamRef as T, JsonObjectExpr as _, DefaultValueExpr as a, NotExpr as b, DoNothingConflictAction as c, ExistsExpr as d, IdentifierRef as f, JsonArrayAggExpr as g, JoinAst as h, ColumnRef as i, SubqueryExpr as j, RawSqlExpr as k, DoUpdateSetConflictAction as l, InsertOnConflict as m, AndExpr as n, DeleteAst as o, InsertAst as p, BinaryExpr as r, DerivedTableSource as s, AggregateExpr as t, EqColJoinOn as u, ListExpression as v, OrderByItem as w, NullCheckExpr as x, LiteralExpr as y };
|
|
1224
1243
|
|
|
1225
|
-
//# sourceMappingURL=types-
|
|
1244
|
+
//# sourceMappingURL=types-D72v8s92.mjs.map
|