@prisma-next/sql-relational-core 0.11.0 → 0.12.0-dev.10
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.map +1 -1
- package/dist/errors-BF7W5uUd.mjs.map +1 -1
- package/dist/{errors-Duz3ppqk.d.mts → errors-DyOlJVVe.d.mts} +2 -2
- package/dist/errors-DyOlJVVe.d.mts.map +1 -0
- package/dist/exports/ast.d.mts +6 -3
- package/dist/exports/ast.d.mts.map +1 -1
- package/dist/exports/ast.mjs +2 -2
- package/dist/exports/ast.mjs.map +1 -1
- package/dist/exports/codec-descriptor-registry.d.mts.map +1 -1
- package/dist/exports/codec-descriptor-registry.mjs +3 -3
- package/dist/exports/codec-descriptor-registry.mjs.map +1 -1
- package/dist/exports/errors.d.mts +1 -1
- package/dist/exports/expression.d.mts +46 -2
- package/dist/exports/expression.d.mts.map +1 -1
- package/dist/exports/expression.mjs +55 -2
- package/dist/exports/expression.mjs.map +1 -1
- package/dist/exports/middleware.d.mts +1 -1
- package/dist/exports/plan.d.mts +2 -2
- package/dist/exports/plan.mjs.map +1 -1
- package/dist/exports/types.d.mts +3 -3
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +3 -3
- package/dist/middleware-B0yz0pff.mjs.map +1 -1
- package/dist/{middleware-DI2DqOSg.d.mts → middleware-wAl5AE2L.d.mts} +2 -2
- package/dist/middleware-wAl5AE2L.d.mts.map +1 -0
- package/dist/{plan-D-Q5B-z_.d.mts → plan-DOddRU_l.d.mts} +2 -2
- package/dist/plan-DOddRU_l.d.mts.map +1 -0
- package/dist/query-lane-context-Dw1Tz0kv.d.mts.map +1 -1
- package/dist/{sql-execution-plan-B84vOmgK.d.mts → sql-execution-plan-DeBoZUre.d.mts} +2 -2
- package/dist/sql-execution-plan-DeBoZUre.d.mts.map +1 -0
- package/dist/{types-DNGyueh7.d.mts → types-BKeEhnEl.d.mts} +68 -3
- package/dist/types-BKeEhnEl.d.mts.map +1 -0
- package/dist/{types-CceENhhm.mjs → types-BS8Mm93x.mjs} +84 -2
- package/dist/types-BS8Mm93x.mjs.map +1 -0
- package/dist/{types-BJHEQbci.d.mts → types-CkfUpAlx.d.mts} +3 -3
- package/dist/types-CkfUpAlx.d.mts.map +1 -0
- package/dist/{types-DiV49xLs.d.mts → types-ptGgzUQd.d.mts} +7 -19
- package/dist/types-ptGgzUQd.d.mts.map +1 -0
- package/dist/util-DWmhUCEO.mjs.map +1 -1
- package/package.json +23 -12
- package/src/ast/adapter-types.ts +4 -1
- package/src/ast/types.ts +138 -1
- package/src/codec-ref-for-column.ts +3 -3
- package/src/expression.ts +108 -2
- package/src/types.ts +12 -34
- package/dist/errors-Duz3ppqk.d.mts.map +0 -1
- package/dist/middleware-DI2DqOSg.d.mts.map +0 -1
- package/dist/plan-D-Q5B-z_.d.mts.map +0 -1
- package/dist/sql-execution-plan-B84vOmgK.d.mts.map +0 -1
- package/dist/types-BJHEQbci.d.mts.map +0 -1
- package/dist/types-CceENhhm.mjs.map +0 -1
- package/dist/types-DNGyueh7.d.mts.map +0 -1
- package/dist/types-DiV49xLs.d.mts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
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-Cezo7k-i.mjs";
|
|
2
|
-
import { $ as
|
|
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-BKeEhnEl.mjs";
|
|
3
3
|
import { Adapter, AdapterProfile, AdapterTarget, Lowerer, LowererContext, MarkerReadResult, MarkerStatement, 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";
|
|
4
4
|
import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-Dw1Tz0kv.mjs";
|
|
5
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-
|
|
6
|
-
import { C as
|
|
7
|
-
import { n as planUnsupported, t as planInvalid } from "./errors-
|
|
8
|
-
import { BuildOperationSpec, CodecExpression, CodecTypesBase, CodecValue, Expression, ScopeField, TraitExpression, buildOperation, codecOf, 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,
|
|
5
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-DeBoZUre.mjs";
|
|
6
|
+
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-ptGgzUQd.mjs";
|
|
7
|
+
import { n as planUnsupported, t as planInvalid } from "./errors-DyOlJVVe.mjs";
|
|
8
|
+
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-wAl5AE2L.mjs";
|
|
10
|
+
import { n as planFromAst, t as SqlQueryPlan } from "./plan-DOddRU_l.mjs";
|
|
11
|
+
import { n as SqlOrmPlan, t as RuntimeScope } from "./types-CkfUpAlx.mjs";
|
|
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, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonObjectEntry, JsonObjectExpr, LimitOffsetValue, ListExpression, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, MarkerStatement, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NotExpr, NullCheckExpr, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, ParamRef, ParamRefEntry, ParamRefEntryUnion, ParamRefHandle, PreparedExecuteRequest, PreparedParamRef, ProjectionExpr, ProjectionItem, RawCodecInferer, RawExpr, RawFactory, RawFunctionOptions, RawSqlBuilder, RawSqlExpr, RawSqlLiteral, RawSqlTag, 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, ScopeField, SelectAst, SelectAstOptions, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlOrmPlan, SqlParamRefMutator, SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UpdateAst, WhereArg, WindowFn, 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
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-BS8Mm93x.mjs";
|
|
2
2
|
import { n as compact, t as collectOrderedParamRefs } from "./util-DWmhUCEO.mjs";
|
|
3
3
|
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
4
|
import { n as planUnsupported, t as planInvalid } from "./errors-BF7W5uUd.mjs";
|
|
5
|
-
import { buildOperation, codecOf, toExpr } from "./exports/expression.mjs";
|
|
5
|
+
import { buildOperation, codecOf, createRawSql, param, toExpr } from "./exports/expression.mjs";
|
|
6
6
|
import { t as createSqlParamRefMutator } from "./middleware-B0yz0pff.mjs";
|
|
7
7
|
import { planFromAst } from "./exports/plan.mjs";
|
|
8
8
|
import "./exports/query-lane-context.mjs";
|
|
9
9
|
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, 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, buildOperation, codecOf, collectOrderedParamRefs, compact, createSqlParamRefMutator, isQueryAst, isWhereExpr, 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 };
|
|
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 };
|
|
@@ -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,IAAI,GAAG,EAAE;CAC1F,IAAI;CAEJ,MAAM,cAAc,WAA8B;EAKhD,OAAO,KAAK,QAAQ,OAAiC;;CAGvD,MAAM,4BAAuC;EAC3C,IAAI,CAAC,eACH,gBAAgB,CAAC,GAAG,eAAe;EAErC,OAAO;;CAGT,MAAM,WAAW,OAAe,UAAyB;EACvD,MAAM,SAAS,qBAAqB;EACpC,OAAO,SAAS;;CAGlB,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;UAChB;IAGL,QAAQ,IAAI,KAAK,SAAS,KAAK,KAAK,KAAA;IACpC,UAAU,IAAI,MAAM;;GAMtB,MAAM;IAD6C,KAAK;IAAQ;IAAO;IAC5D;;;CAIf,SAAS,aAAa,QAAmB,UAAyB;EAChE,MAAM,QAAQ,WAAW,OAAO;EAChC,IAAI,QAAQ,GAIV;EAEF,QAAQ,OAAO,SAAS;;CAG1B,SAAS,cACP,SACM;EACN,KAAK,MAAM,EAAE,KAAK,cAAc,SAAS;GACvC,MAAM,QAAQ,WAAW,IAAI;GAC7B,IAAI,QAAQ,GAAG;GACf,QAAQ,OAAO,SAAS;;;CAS5B,OAAO;EACL;EACc;EACd;EACA,gBAAoC;GAClC,IAAI,CAAC,eACH,OAAO;GAET,OAAO,OAAO,OAAO,CAAC,GAAG,cAAc,CAAC;;EAE3C"}
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-
|
|
1
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-DeBoZUre.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-wAl5AE2L.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-wAl5AE2L.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,kBAAA,CAC5C,IAAA,EAAM,gBAAA,GAAmB,0BAAA,CAA2B,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as AnyQueryAst } from "./types-
|
|
1
|
+
import { f as AnyQueryAst } from "./types-BKeEhnEl.mjs";
|
|
2
2
|
import { QueryPlan } from "@prisma-next/framework-components/runtime";
|
|
3
3
|
import { SqlStorage } from "@prisma-next/sql-contract/types";
|
|
4
4
|
import { Contract } from "@prisma-next/contract/types";
|
|
@@ -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-DOddRU_l.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-DOddRU_l.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,eAAA,CACd,GAAA,EAAK,WAAA,EACL,QAAA,EAAU,QAAA,CAAS,UAAA,GACnB,MAAA,YACC,YAAA,CAAa,GAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-lane-context-Dw1Tz0kv.d.mts","names":[],"sources":["../src/query-lane-context.ts"],"mappings":";;;;;;;;;AASA;UAAiB,uBAAA;;;;EAIf,aAAA,CAAc,OAAA,WAAkB,eAAA;EAgBtB;;;;;;;;;;;EAJV,iBAAA,CAAkB,KAAA,UAAe,MAAA,WAAiB,QAAA;EAIxC;;;EAAV,MAAA,IAAU,gBAAA,CAAiB,eAAA;EAIgB
|
|
1
|
+
{"version":3,"file":"query-lane-context-Dw1Tz0kv.d.mts","names":[],"sources":["../src/query-lane-context.ts"],"mappings":";;;;;;;;;AASA;UAAiB,uBAAA;;;;EAIf,aAAA,CAAc,OAAA,WAAkB,eAAA;EAgBtB;;;;;;;;;;;EAJV,iBAAA,CAAkB,KAAA,UAAe,MAAA,WAAiB,QAAA;EAIxC;;;EAAV,MAAA,IAAU,gBAAA,CAAiB,eAAA;EAIgB;;AAAe;EAA1D,YAAA,CAAa,UAAA,oBAA8B,eAAA;AAAA;;;AAMN;KAA3B,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;EAHP;;;;EAAA,SAQD,iBAAA,GAAoB,GAAA;AAAA;;;;;;UAQd,gBAAA,mBAAmC,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA;EAAA,SACzE,QAAA,EAAU,SAAA;EATV;;;EAAA,SAaA,cAAA,EAAgB,qBAAA;EALV;;;EAAA,SASN,gBAAA,EAAkB,uBAAA;EAAA,SAClB,eAAA,EAAiB,oBAAA;EAVwD;;;EAAA,SAczE,KAAA,EAAO,kBAAA;EALW;;;EAS3B,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-BKeEhnEl.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-DeBoZUre.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-execution-plan-DeBoZUre.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"}
|
|
@@ -8,6 +8,16 @@ type BinaryOp = 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte' | 'like' | 'in' | 'no
|
|
|
8
8
|
type AggregateCountFn = 'count';
|
|
9
9
|
type AggregateOpFn = 'sum' | 'avg' | 'min' | 'max';
|
|
10
10
|
type AggregateFn = AggregateCountFn | AggregateOpFn;
|
|
11
|
+
/**
|
|
12
|
+
* Window function names. Currently only `row_number` is wired up — added
|
|
13
|
+
* to support `ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...) = 1`
|
|
14
|
+
* lowering for `.distinct(cols)` semantics in the SQL ORM client. `rank`
|
|
15
|
+
* and `dense_rank` are reserved here so future additions don't churn the
|
|
16
|
+
* type; renderers only need to dispatch on the function name string.
|
|
17
|
+
*/
|
|
18
|
+
type WindowFn = 'row_number' | 'rank' | 'dense_rank';
|
|
19
|
+
/** Scalar JS values that map directly to a SQL wire type. Values outside this set must be routed through `param(value, { codecId })` to declare the target codec explicitly. */
|
|
20
|
+
type RawSqlLiteral = number | bigint | string | boolean | Uint8Array;
|
|
11
21
|
interface ExpressionSource {
|
|
12
22
|
toExpr(): AnyExpression;
|
|
13
23
|
}
|
|
@@ -19,6 +29,7 @@ interface ExpressionRewriter {
|
|
|
19
29
|
literal?(expr: LiteralExpr): LiteralExpr;
|
|
20
30
|
list?(expr: ListExpression): ListExpression | LiteralExpr;
|
|
21
31
|
select?(ast: SelectAst): SelectAst;
|
|
32
|
+
rawExpr?(expr: RawExpr): AnyExpression;
|
|
22
33
|
}
|
|
23
34
|
interface AstRewriter extends ExpressionRewriter {
|
|
24
35
|
tableSource?(source: TableSource): TableSource;
|
|
@@ -30,6 +41,7 @@ interface ExprVisitor<R> {
|
|
|
30
41
|
subquery(expr: SubqueryExpr): R;
|
|
31
42
|
operation(expr: OperationExpr): R;
|
|
32
43
|
aggregate(expr: AggregateExpr): R;
|
|
44
|
+
windowFunc(expr: WindowFuncExpr): R;
|
|
33
45
|
jsonObject(expr: JsonObjectExpr): R;
|
|
34
46
|
jsonArrayAgg(expr: JsonArrayAggExpr): R;
|
|
35
47
|
binary(expr: BinaryExpr): R;
|
|
@@ -42,6 +54,7 @@ interface ExprVisitor<R> {
|
|
|
42
54
|
param(expr: ParamRef): R;
|
|
43
55
|
preparedParam(expr: PreparedParamRef): R;
|
|
44
56
|
list(expr: ListExpression): R;
|
|
57
|
+
rawExpr(expr: RawExpr): R;
|
|
45
58
|
}
|
|
46
59
|
interface ExpressionFolder<T> {
|
|
47
60
|
empty: T;
|
|
@@ -54,6 +67,7 @@ interface ExpressionFolder<T> {
|
|
|
54
67
|
literal?(expr: LiteralExpr): T;
|
|
55
68
|
list?(expr: ListExpression): T;
|
|
56
69
|
select?(ast: SelectAst): T;
|
|
70
|
+
rawExpr?(expr: RawExpr): T;
|
|
57
71
|
}
|
|
58
72
|
type ProjectionExpr = AnyExpression;
|
|
59
73
|
type InsertValue = ColumnRef | ParamRef | PreparedParamRef | DefaultValueExpr;
|
|
@@ -206,6 +220,18 @@ declare class OperationExpr extends Expression {
|
|
|
206
220
|
fold<T>(folder: ExpressionFolder<T>): T;
|
|
207
221
|
baseColumnRef(): ColumnRef;
|
|
208
222
|
}
|
|
223
|
+
declare class RawExpr extends Expression {
|
|
224
|
+
readonly kind: "raw-expr";
|
|
225
|
+
readonly parts: ReadonlyArray<string | AnyExpression>;
|
|
226
|
+
readonly returns: ParamSpec;
|
|
227
|
+
constructor(options: {
|
|
228
|
+
readonly parts: ReadonlyArray<string | AnyExpression>;
|
|
229
|
+
readonly returns: ParamSpec;
|
|
230
|
+
});
|
|
231
|
+
accept<R>(visitor: ExprVisitor<R>): R;
|
|
232
|
+
rewrite(rewriter: ExpressionRewriter): AnyExpression;
|
|
233
|
+
fold<T>(folder: ExpressionFolder<T>): T;
|
|
234
|
+
}
|
|
209
235
|
declare class AggregateExpr extends Expression {
|
|
210
236
|
readonly kind: "aggregate";
|
|
211
237
|
readonly fn: AggregateFn;
|
|
@@ -220,6 +246,39 @@ declare class AggregateExpr extends Expression {
|
|
|
220
246
|
rewrite(rewriter: ExpressionRewriter): AnyExpression;
|
|
221
247
|
fold<T>(folder: ExpressionFolder<T>): T;
|
|
222
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Window function call: `fn(args) OVER (PARTITION BY ... ORDER BY ...)`.
|
|
251
|
+
*
|
|
252
|
+
* Both `partitionBy` and `orderBy` are optional; an empty `OVER ()`
|
|
253
|
+
* clause is legal SQL but rarely useful. For `ROW_NUMBER`, `RANK`, and
|
|
254
|
+
* `DENSE_RANK` the standard mandates an `ORDER BY` for deterministic
|
|
255
|
+
* results — callers are expected to provide one, but the AST does not
|
|
256
|
+
* enforce it.
|
|
257
|
+
*
|
|
258
|
+
* The `args` slot exists for future window function additions that take
|
|
259
|
+
* arguments (e.g. `COUNT(*) OVER`, `SUM(x) OVER`); `ROW_NUMBER` and the
|
|
260
|
+
* other ranking functions take no arguments.
|
|
261
|
+
*/
|
|
262
|
+
declare class WindowFuncExpr extends Expression {
|
|
263
|
+
readonly kind: "window-func";
|
|
264
|
+
readonly fn: WindowFn;
|
|
265
|
+
readonly args: ReadonlyArray<AnyExpression>;
|
|
266
|
+
readonly partitionBy: ReadonlyArray<AnyExpression> | undefined;
|
|
267
|
+
readonly orderBy: ReadonlyArray<OrderByItem> | undefined;
|
|
268
|
+
constructor(options: {
|
|
269
|
+
readonly fn: WindowFn;
|
|
270
|
+
readonly args?: ReadonlyArray<AnyExpression>;
|
|
271
|
+
readonly partitionBy?: ReadonlyArray<AnyExpression>;
|
|
272
|
+
readonly orderBy?: ReadonlyArray<OrderByItem>;
|
|
273
|
+
});
|
|
274
|
+
static rowNumber(options: {
|
|
275
|
+
readonly partitionBy?: ReadonlyArray<AnyExpression>;
|
|
276
|
+
readonly orderBy?: ReadonlyArray<OrderByItem>;
|
|
277
|
+
}): WindowFuncExpr;
|
|
278
|
+
accept<R>(visitor: ExprVisitor<R>): R;
|
|
279
|
+
rewrite(rewriter: ExpressionRewriter): AnyExpression;
|
|
280
|
+
fold<T>(folder: ExpressionFolder<T>): T;
|
|
281
|
+
}
|
|
223
282
|
declare class JsonObjectExpr extends Expression {
|
|
224
283
|
readonly kind: "json-object";
|
|
225
284
|
readonly entries: ReadonlyArray<JsonObjectEntry>;
|
|
@@ -238,6 +297,12 @@ declare class OrderByItem extends AstNode {
|
|
|
238
297
|
static asc(expr: AnyExpression): OrderByItem;
|
|
239
298
|
static desc(expr: AnyExpression): OrderByItem;
|
|
240
299
|
rewrite(rewriter: ExpressionRewriter): OrderByItem;
|
|
300
|
+
/**
|
|
301
|
+
* A new frozen item with the sort direction flipped and `expr` unchanged.
|
|
302
|
+
* Integrations that own pagination (e.g. backward cursor pagination) use
|
|
303
|
+
* this to reverse a user's sort order without reaching into the AST.
|
|
304
|
+
*/
|
|
305
|
+
reverse(): OrderByItem;
|
|
241
306
|
}
|
|
242
307
|
declare class JsonArrayAggExpr extends Expression {
|
|
243
308
|
readonly kind: "json-array-agg";
|
|
@@ -512,7 +577,7 @@ declare class RawSqlExpr extends QueryAst {
|
|
|
512
577
|
}
|
|
513
578
|
type AnyQueryAst = SelectAst | InsertAst | UpdateAst | DeleteAst | RawSqlExpr;
|
|
514
579
|
type AnyFromSource = TableSource | DerivedTableSource;
|
|
515
|
-
type AnyExpression = ColumnRef | IdentifierRef | ParamRef | PreparedParamRef | LiteralExpr | SubqueryExpr | OperationExpr | AggregateExpr | JsonObjectExpr | JsonArrayAggExpr | ListExpression | BinaryExpr | AndExpr | OrExpr | ExistsExpr | NullCheckExpr | NotExpr;
|
|
580
|
+
type AnyExpression = ColumnRef | IdentifierRef | ParamRef | PreparedParamRef | LiteralExpr | SubqueryExpr | OperationExpr | AggregateExpr | WindowFuncExpr | JsonObjectExpr | JsonArrayAggExpr | ListExpression | BinaryExpr | AndExpr | OrExpr | ExistsExpr | NullCheckExpr | NotExpr | RawExpr;
|
|
516
581
|
type AnyParamRef = ParamRef | PreparedParamRef;
|
|
517
582
|
type AnyInsertOnConflictAction = DoNothingConflictAction | DoUpdateSetConflictAction;
|
|
518
583
|
type AnyInsertValue = ColumnRef | ParamRef | PreparedParamRef | DefaultValueExpr;
|
|
@@ -551,5 +616,5 @@ interface LoweredStatement {
|
|
|
551
616
|
readonly annotations?: Record<string, unknown>;
|
|
552
617
|
}
|
|
553
618
|
//#endregion
|
|
554
|
-
export {
|
|
555
|
-
//# sourceMappingURL=types-
|
|
619
|
+
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 };
|
|
620
|
+
//# sourceMappingURL=types-BKeEhnEl.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BKeEhnEl.d.mts","names":[],"sources":["../src/ast/types.ts"],"mappings":";;;;;KAKY,SAAA;AAAA,KAEA,QAAA;AAAA,KAEA,gBAAA;AAAA,KACA,aAAA;AAAA,KACA,WAAA,GAAc,gBAAA,GAAmB,aAAa;;AANrC;AAErB;;;;AAAoB;KAaR,QAAA;;KAGA,aAAA,wCAAqD,UAAU;AAAA,UAE1D,gBAAA;EACf,MAAA,IAAU,aAAa;AAAA;AAAA,UAGR,kBAAA;EACf,SAAA,EAAW,IAAA,EAAM,SAAA,GAAY,aAAA;EAC7B,aAAA,EAAe,IAAA,EAAM,aAAA,GAAgB,aAAA;EACrC,QAAA,EAAU,IAAA,EAAM,QAAA,GAAW,QAAA,GAAW,WAAA;EACtC,gBAAA,EAAkB,IAAA,EAAM,gBAAA,GAAmB,gBAAA;EAC3C,OAAA,EAAS,IAAA,EAAM,WAAA,GAAc,WAAA;EAC7B,IAAA,EAAM,IAAA,EAAM,cAAA,GAAiB,cAAA,GAAiB,WAAA;EAC9C,MAAA,EAAQ,GAAA,EAAK,SAAA,GAAY,SAAA;EACzB,OAAA,EAAS,IAAA,EAAM,OAAA,GAAU,aAAA;AAAA;AAAA,UAGV,WAAA,SAAoB,kBAAA;EACnC,WAAA,EAAa,MAAA,EAAQ,WAAA,GAAc,WAAA;EACnC,WAAA,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B,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;;;;;;;;;;;;;;;KAiBlB,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,3 +1,4 @@
|
|
|
1
|
+
import { ifDefined } from "@prisma-next/utils/defined";
|
|
1
2
|
//#region src/ast/types.ts
|
|
2
3
|
function frozenArrayCopy(values) {
|
|
3
4
|
return Object.freeze([...values]);
|
|
@@ -362,6 +363,27 @@ var OperationExpr = class OperationExpr extends Expression {
|
|
|
362
363
|
return this.self.baseColumnRef();
|
|
363
364
|
}
|
|
364
365
|
};
|
|
366
|
+
var RawExpr = class extends Expression {
|
|
367
|
+
kind = "raw-expr";
|
|
368
|
+
parts;
|
|
369
|
+
returns;
|
|
370
|
+
constructor(options) {
|
|
371
|
+
super();
|
|
372
|
+
this.parts = frozenArrayCopy(options.parts);
|
|
373
|
+
this.returns = options.returns;
|
|
374
|
+
this.freeze();
|
|
375
|
+
}
|
|
376
|
+
accept(visitor) {
|
|
377
|
+
return visitor.rawExpr(this);
|
|
378
|
+
}
|
|
379
|
+
rewrite(rewriter) {
|
|
380
|
+
return rewriter.rawExpr ? rewriter.rawExpr(this) : this;
|
|
381
|
+
}
|
|
382
|
+
fold(folder) {
|
|
383
|
+
if (folder.rawExpr) return folder.rawExpr(this);
|
|
384
|
+
return combineAll(folder, this.parts.filter((p) => typeof p !== "string").map((p) => () => p.fold(folder)));
|
|
385
|
+
}
|
|
386
|
+
};
|
|
365
387
|
var AggregateExpr = class AggregateExpr extends Expression {
|
|
366
388
|
kind = "aggregate";
|
|
367
389
|
fn;
|
|
@@ -398,6 +420,58 @@ var AggregateExpr = class AggregateExpr extends Expression {
|
|
|
398
420
|
return this.expr ? this.expr.fold(folder) : folder.empty;
|
|
399
421
|
}
|
|
400
422
|
};
|
|
423
|
+
/**
|
|
424
|
+
* Window function call: `fn(args) OVER (PARTITION BY ... ORDER BY ...)`.
|
|
425
|
+
*
|
|
426
|
+
* Both `partitionBy` and `orderBy` are optional; an empty `OVER ()`
|
|
427
|
+
* clause is legal SQL but rarely useful. For `ROW_NUMBER`, `RANK`, and
|
|
428
|
+
* `DENSE_RANK` the standard mandates an `ORDER BY` for deterministic
|
|
429
|
+
* results — callers are expected to provide one, but the AST does not
|
|
430
|
+
* enforce it.
|
|
431
|
+
*
|
|
432
|
+
* The `args` slot exists for future window function additions that take
|
|
433
|
+
* arguments (e.g. `COUNT(*) OVER`, `SUM(x) OVER`); `ROW_NUMBER` and the
|
|
434
|
+
* other ranking functions take no arguments.
|
|
435
|
+
*/
|
|
436
|
+
var WindowFuncExpr = class WindowFuncExpr extends Expression {
|
|
437
|
+
kind = "window-func";
|
|
438
|
+
fn;
|
|
439
|
+
args;
|
|
440
|
+
partitionBy;
|
|
441
|
+
orderBy;
|
|
442
|
+
constructor(options) {
|
|
443
|
+
super();
|
|
444
|
+
this.fn = options.fn;
|
|
445
|
+
this.args = options.args && options.args.length > 0 ? frozenArrayCopy(options.args) : [];
|
|
446
|
+
this.partitionBy = options.partitionBy && options.partitionBy.length > 0 ? frozenArrayCopy(options.partitionBy) : void 0;
|
|
447
|
+
this.orderBy = options.orderBy && options.orderBy.length > 0 ? frozenArrayCopy(options.orderBy) : void 0;
|
|
448
|
+
this.freeze();
|
|
449
|
+
}
|
|
450
|
+
static rowNumber(options) {
|
|
451
|
+
return new WindowFuncExpr({
|
|
452
|
+
fn: "row_number",
|
|
453
|
+
...options
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
accept(visitor) {
|
|
457
|
+
return visitor.windowFunc(this);
|
|
458
|
+
}
|
|
459
|
+
rewrite(rewriter) {
|
|
460
|
+
return new WindowFuncExpr({
|
|
461
|
+
fn: this.fn,
|
|
462
|
+
args: this.args.map((arg) => arg.rewrite(rewriter)),
|
|
463
|
+
...ifDefined("partitionBy", this.partitionBy?.map((expr) => expr.rewrite(rewriter))),
|
|
464
|
+
...ifDefined("orderBy", this.orderBy?.map((orderItem) => orderItem.rewrite(rewriter)))
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
fold(folder) {
|
|
468
|
+
return combineAll(folder, [
|
|
469
|
+
...this.args.map((arg) => () => arg.fold(folder)),
|
|
470
|
+
...(this.partitionBy ?? []).map((expr) => () => expr.fold(folder)),
|
|
471
|
+
...(this.orderBy ?? []).map((orderItem) => () => orderItem.expr.fold(folder))
|
|
472
|
+
]);
|
|
473
|
+
}
|
|
474
|
+
};
|
|
401
475
|
var JsonObjectExpr = class JsonObjectExpr extends Expression {
|
|
402
476
|
kind = "json-object";
|
|
403
477
|
entries;
|
|
@@ -447,6 +521,14 @@ var OrderByItem = class OrderByItem extends AstNode {
|
|
|
447
521
|
rewrite(rewriter) {
|
|
448
522
|
return new OrderByItem(this.expr.rewrite(rewriter), this.dir);
|
|
449
523
|
}
|
|
524
|
+
/**
|
|
525
|
+
* A new frozen item with the sort direction flipped and `expr` unchanged.
|
|
526
|
+
* Integrations that own pagination (e.g. backward cursor pagination) use
|
|
527
|
+
* this to reverse a user's sort order without reaching into the AST.
|
|
528
|
+
*/
|
|
529
|
+
reverse() {
|
|
530
|
+
return new OrderByItem(this.expr, this.dir === "asc" ? "desc" : "asc");
|
|
531
|
+
}
|
|
450
532
|
};
|
|
451
533
|
var JsonArrayAggExpr = class JsonArrayAggExpr extends Expression {
|
|
452
534
|
kind = "json-array-agg";
|
|
@@ -1146,6 +1228,6 @@ function isWhereExpr(value) {
|
|
|
1146
1228
|
return typeof value === "object" && value !== null && "kind" in value && whereExprKinds.has(value.kind);
|
|
1147
1229
|
}
|
|
1148
1230
|
//#endregion
|
|
1149
|
-
export {
|
|
1231
|
+
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 };
|
|
1150
1232
|
|
|
1151
|
-
//# sourceMappingURL=types-
|
|
1233
|
+
//# sourceMappingURL=types-BS8Mm93x.mjs.map
|