joist-core 2.5.0-next.21 → 2.5.0-next.22
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/build/EntityManager.cjs +15 -3
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +3 -3
- package/build/EntityManager.d.cts.map +1 -1
- package/build/EntityManager.d.mts +3 -3
- package/build/EntityManager.d.mts.map +1 -1
- package/build/EntityManager.js +15 -3
- package/build/EntityManager.js.map +1 -1
- package/build/PluginManager.cjs +6 -0
- package/build/PluginManager.cjs.map +1 -1
- package/build/PluginManager.d.cts +10 -0
- package/build/PluginManager.d.cts.map +1 -1
- package/build/PluginManager.d.mts +10 -0
- package/build/PluginManager.d.mts.map +1 -1
- package/build/PluginManager.js +6 -0
- package/build/PluginManager.js.map +1 -1
- package/build/index.cjs +10 -3
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +9 -7
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +9 -7
- package/build/index.d.mts.map +1 -1
- package/build/index.js +6 -4
- package/build/index.js.map +1 -1
- package/build/queries/ConditionBuilder.cjs +2 -1
- package/build/queries/ConditionBuilder.cjs.map +1 -1
- package/build/queries/ConditionBuilder.d.cts +9 -1
- package/build/queries/ConditionBuilder.d.cts.map +1 -1
- package/build/queries/ConditionBuilder.d.mts +9 -1
- package/build/queries/ConditionBuilder.d.mts.map +1 -1
- package/build/queries/ConditionBuilder.js +2 -2
- package/build/queries/ConditionBuilder.js.map +1 -1
- package/build/queries/conditions.cjs.map +1 -1
- package/build/queries/conditions.d.cts +4 -1
- package/build/queries/conditions.d.cts.map +1 -1
- package/build/queries/conditions.d.mts +4 -1
- package/build/queries/conditions.d.mts.map +1 -1
- package/build/queries/conditions.js.map +1 -1
- package/build/queries/sql/Expr.cjs +79 -134
- package/build/queries/sql/Expr.cjs.map +1 -1
- package/build/queries/sql/Expr.d.cts +26 -34
- package/build/queries/sql/Expr.d.cts.map +1 -1
- package/build/queries/sql/Expr.d.mts +26 -34
- package/build/queries/sql/Expr.d.mts.map +1 -1
- package/build/queries/sql/Expr.js +80 -133
- package/build/queries/sql/Expr.js.map +1 -1
- package/build/queries/sql/ParsedQuery.cjs +119 -0
- package/build/queries/sql/ParsedQuery.cjs.map +1 -0
- package/build/queries/sql/ParsedQuery.d.cts +105 -0
- package/build/queries/sql/ParsedQuery.d.cts.map +1 -0
- package/build/queries/sql/ParsedQuery.d.mts +105 -0
- package/build/queries/sql/ParsedQuery.d.mts.map +1 -0
- package/build/queries/sql/ParsedQuery.js +116 -0
- package/build/queries/sql/ParsedQuery.js.map +1 -0
- package/build/queries/sql/ParsedSqlExpression.cjs +74 -0
- package/build/queries/sql/ParsedSqlExpression.cjs.map +1 -0
- package/build/queries/sql/ParsedSqlExpression.d.cts +65 -0
- package/build/queries/sql/ParsedSqlExpression.d.cts.map +1 -0
- package/build/queries/sql/ParsedSqlExpression.d.mts +65 -0
- package/build/queries/sql/ParsedSqlExpression.d.mts.map +1 -0
- package/build/queries/sql/ParsedSqlExpression.js +69 -0
- package/build/queries/sql/ParsedSqlExpression.js.map +1 -0
- package/build/queries/sql/Tables.cjs +61 -46
- package/build/queries/sql/Tables.cjs.map +1 -1
- package/build/queries/sql/Tables.d.cts.map +1 -1
- package/build/queries/sql/Tables.d.mts.map +1 -1
- package/build/queries/sql/Tables.js +61 -46
- package/build/queries/sql/Tables.js.map +1 -1
- package/build/queries/sql/execute.cjs +45 -62
- package/build/queries/sql/execute.cjs.map +1 -1
- package/build/queries/sql/execute.d.cts +4 -3
- package/build/queries/sql/execute.d.cts.map +1 -1
- package/build/queries/sql/execute.d.mts +4 -3
- package/build/queries/sql/execute.d.mts.map +1 -1
- package/build/queries/sql/execute.js +47 -64
- package/build/queries/sql/execute.js.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.cjs +14 -15
- package/build/queries/sql/expressions/arrayAgg.cjs.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.cts +3 -2
- package/build/queries/sql/expressions/arrayAgg.d.cts.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.mts +3 -2
- package/build/queries/sql/expressions/arrayAgg.d.mts.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.js +15 -16
- package/build/queries/sql/expressions/arrayAgg.js.map +1 -1
- package/build/queries/sql/expressions/case.cjs +11 -16
- package/build/queries/sql/expressions/case.cjs.map +1 -1
- package/build/queries/sql/expressions/case.d.cts +3 -2
- package/build/queries/sql/expressions/case.d.cts.map +1 -1
- package/build/queries/sql/expressions/case.d.mts +3 -2
- package/build/queries/sql/expressions/case.d.mts.map +1 -1
- package/build/queries/sql/expressions/case.js +11 -16
- package/build/queries/sql/expressions/case.js.map +1 -1
- package/build/queries/sql/expressions/coalesce.cjs.map +1 -1
- package/build/queries/sql/expressions/coalesce.d.cts +3 -2
- package/build/queries/sql/expressions/coalesce.d.cts.map +1 -1
- package/build/queries/sql/expressions/coalesce.d.mts +3 -2
- package/build/queries/sql/expressions/coalesce.d.mts.map +1 -1
- package/build/queries/sql/expressions/coalesce.js.map +1 -1
- package/build/queries/sql/expressions/expression.cjs +10 -12
- package/build/queries/sql/expressions/expression.cjs.map +1 -1
- package/build/queries/sql/expressions/expression.d.cts +4 -3
- package/build/queries/sql/expressions/expression.d.cts.map +1 -1
- package/build/queries/sql/expressions/expression.d.mts +4 -3
- package/build/queries/sql/expressions/expression.d.mts.map +1 -1
- package/build/queries/sql/expressions/expression.js +11 -13
- package/build/queries/sql/expressions/expression.js.map +1 -1
- package/build/queries/sql/expressions/greatest.cjs.map +1 -1
- package/build/queries/sql/expressions/greatest.d.cts +3 -2
- package/build/queries/sql/expressions/greatest.d.cts.map +1 -1
- package/build/queries/sql/expressions/greatest.d.mts +3 -2
- package/build/queries/sql/expressions/greatest.d.mts.map +1 -1
- package/build/queries/sql/expressions/greatest.js.map +1 -1
- package/build/queries/sql/expressions/least.cjs.map +1 -1
- package/build/queries/sql/expressions/least.d.cts +3 -2
- package/build/queries/sql/expressions/least.d.cts.map +1 -1
- package/build/queries/sql/expressions/least.d.mts +3 -2
- package/build/queries/sql/expressions/least.d.mts.map +1 -1
- package/build/queries/sql/expressions/least.js.map +1 -1
- package/build/queries/sql/expressions/nullIf.cjs.map +1 -1
- package/build/queries/sql/expressions/nullIf.d.cts +3 -2
- package/build/queries/sql/expressions/nullIf.d.cts.map +1 -1
- package/build/queries/sql/expressions/nullIf.d.mts +3 -2
- package/build/queries/sql/expressions/nullIf.d.mts.map +1 -1
- package/build/queries/sql/expressions/nullIf.js.map +1 -1
- package/build/queries/sql/query.cjs +168 -381
- package/build/queries/sql/query.cjs.map +1 -1
- package/build/queries/sql/query.d.cts +44 -45
- package/build/queries/sql/query.d.cts.map +1 -1
- package/build/queries/sql/query.d.mts +44 -45
- package/build/queries/sql/query.d.mts.map +1 -1
- package/build/queries/sql/query.js +172 -383
- package/build/queries/sql/query.js.map +1 -1
- package/build/queries/sql/renderSql.cjs +321 -0
- package/build/queries/sql/renderSql.cjs.map +1 -0
- package/build/queries/sql/renderSql.d.cts +14 -0
- package/build/queries/sql/renderSql.d.cts.map +1 -0
- package/build/queries/sql/renderSql.d.mts +14 -0
- package/build/queries/sql/renderSql.d.mts.map +1 -0
- package/build/queries/sql/renderSql.js +318 -0
- package/build/queries/sql/renderSql.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Entity } from "../../Entity.cjs";
|
|
2
2
|
import { EntityMetadata } from "../../EntityMetadata.cjs";
|
|
3
|
+
import { CheckInput, ExprFromInput, ExprInput, ExpressionSources, ExpressionValue } from "./expressions/types.cjs";
|
|
3
4
|
import { SqlCondition, SqlPredicate, UnbrandedPredicate } from "../conditions.cjs";
|
|
4
5
|
import { ColumnCondition } from "../parsedConditions.cjs";
|
|
5
6
|
import { AliasAssigner } from "./AliasAssigner.cjs";
|
|
6
|
-
import {
|
|
7
|
-
import { BaseExpr, Expr, ExprContext, ExprLike, InnerJoin, LeftJoin, SqlFragment, selectKeyBrand } from "./Expr.cjs";
|
|
7
|
+
import { BaseExpr, Expr, ExprContext, ExprLike, InnerJoin, LeftJoin, selectKeyBrand } from "./Expr.cjs";
|
|
8
8
|
import "./expressions/expression.cjs";
|
|
9
9
|
import { CheckJoinInput, TreeEntries } from "./JoinTree.cjs";
|
|
10
|
-
import {
|
|
10
|
+
import { ParsedReadQuery } from "./ParsedQuery.cjs";
|
|
11
|
+
import { ParsedSql, QuerySql } from "./ParsedSqlExpression.cjs";
|
|
12
|
+
import { JoinTableHandle, Table, TableBrand, TableFor, TableSourceBrand, TableSourceMgmt, referenceJoinSource, tableMgmt } from "./Tables.cjs";
|
|
11
13
|
import { TypeInfo } from "../../serde/TypeInfo.cjs";
|
|
12
14
|
/**
|
|
13
15
|
* `em.query`: SQL-shaped queries as plain object literals.
|
|
@@ -653,7 +655,7 @@ export declare function isReadQueryValue(arg: unknown): boolean;
|
|
|
653
655
|
* Source-shaped values need read hydration/source rules and are deliberately excluded here.
|
|
654
656
|
*/
|
|
655
657
|
export declare function projectionToSql(select: unknown, ctx: Ctx, joins?: QueryJoinList): {
|
|
656
|
-
selects:
|
|
658
|
+
selects: ParsedSql[];
|
|
657
659
|
decodeRows: Plan["decodeRows"];
|
|
658
660
|
output: QueryOutput;
|
|
659
661
|
};
|
|
@@ -668,11 +670,8 @@ export declare function projectionToSql(select: unknown, ctx: Ctx, joins?: Query
|
|
|
668
670
|
export interface EntityHydrator {
|
|
669
671
|
hydrate(cstr: any, rows: readonly any[]): any[];
|
|
670
672
|
}
|
|
671
|
-
export interface Plan {
|
|
672
|
-
|
|
673
|
-
bindings: any[];
|
|
674
|
-
/** Aliases of enclosing queries this (sub)query referenced. */
|
|
675
|
-
outerRefs: string[];
|
|
673
|
+
export interface Plan<Q = ParsedReadQuery> {
|
|
674
|
+
query: Q;
|
|
676
675
|
/** Ordered SQL output columns and their existing expression codecs, before JS row decoding. */
|
|
677
676
|
output: QueryOutput;
|
|
678
677
|
decodeRows(em: EntityHydrator, rows: any[]): any[];
|
|
@@ -731,7 +730,7 @@ declare class SubqueryColumnExpr extends BaseExpr {
|
|
|
731
730
|
private inner;
|
|
732
731
|
constructor(handle: SubqueryHandle, key: string, inner: BaseExpr);
|
|
733
732
|
get [selectKeyBrand](): string;
|
|
734
|
-
|
|
733
|
+
parseSql(ctx: ExprContext): ParsedSql;
|
|
735
734
|
decode(value: unknown): unknown;
|
|
736
735
|
encode(value: unknown): unknown;
|
|
737
736
|
get outputType(): TypeInfo | undefined;
|
|
@@ -741,9 +740,7 @@ declare class SubqueryColumnExpr extends BaseExpr {
|
|
|
741
740
|
/**
|
|
742
741
|
* What an expression needs from the query it is generating SQL for.
|
|
743
742
|
*
|
|
744
|
-
* Each (sub)query gets its own `Ctx`; a lookup that misses locally walks up to the enclosing query
|
|
745
|
-
* records the hit in `outerRefs`, which is how a correlated subquery reports the outer aliases it
|
|
746
|
-
* depends on (the way `ExistsCondition.outerAliases` does), so join pruning keeps them.
|
|
743
|
+
* Each (sub)query gets its own `Ctx`; a lookup that misses locally walks up to the enclosing query.
|
|
747
744
|
*/
|
|
748
745
|
export declare class Ctx implements ExprContext {
|
|
749
746
|
readonly assigner: AliasAssigner;
|
|
@@ -765,7 +762,6 @@ export declare class Ctx implements ExprContext {
|
|
|
765
762
|
private usedCtes;
|
|
766
763
|
/** The recursive CTE whose body this query is part of, if any; see `recursiveSelf`. */
|
|
767
764
|
private ownRecursiveSelf;
|
|
768
|
-
readonly outerRefs: Set<string>;
|
|
769
765
|
constructor(assigner: AliasAssigner, parent: Ctx | undefined);
|
|
770
766
|
/**
|
|
771
767
|
* One handle can hold only one alias per query, so a value used twice must be told apart, not
|
|
@@ -779,9 +775,6 @@ export declare class Ctx implements ExprContext {
|
|
|
779
775
|
/**
|
|
780
776
|
* The CTE name for `handle`, looking in the enclosing queries too, because a CTE is in scope for the
|
|
781
777
|
* whole statement.
|
|
782
|
-
*
|
|
783
|
-
* Unlike `aliasFor`, a hit in an enclosing query is not added to `outerRefs`: reading a CTE by name
|
|
784
|
-
* is not a correlated reference, so it must not keep an enclosing join alive.
|
|
785
778
|
*/
|
|
786
779
|
cteAliasFor(handle: object): string | undefined;
|
|
787
780
|
/**
|
|
@@ -804,15 +797,44 @@ export declare class Ctx implements ExprContext {
|
|
|
804
797
|
*/
|
|
805
798
|
useCte(handle: object): void;
|
|
806
799
|
aliasFor(handle: object): string;
|
|
807
|
-
|
|
800
|
+
parseCondition(cond: QueryCondition): ParsedSql | undefined;
|
|
801
|
+
}
|
|
802
|
+
export type ParsedSource = ParsedTableSource | ParsedCteSource | ParsedQuerySource;
|
|
803
|
+
interface ParsedSourceBase {
|
|
804
|
+
handle: TableSourceMgmt | SubqueryHandle | JoinTableHandle;
|
|
805
|
+
alias: string;
|
|
806
|
+
meta: EntityMetadata | undefined;
|
|
807
|
+
}
|
|
808
|
+
/** A physical table in FROM or JOIN. */
|
|
809
|
+
export interface ParsedTableSource extends ParsedSourceBase {
|
|
810
|
+
kind: "table";
|
|
811
|
+
table: string;
|
|
812
|
+
schema?: string;
|
|
813
|
+
}
|
|
814
|
+
/** A reference to a named CTE. */
|
|
815
|
+
export interface ParsedCteSource extends ParsedSourceBase {
|
|
816
|
+
kind: "cte";
|
|
817
|
+
cte: string;
|
|
818
|
+
}
|
|
819
|
+
/** An inline subquery in FROM or JOIN. */
|
|
820
|
+
export interface ParsedQuerySource extends ParsedSourceBase {
|
|
821
|
+
kind: "query";
|
|
822
|
+
query: ParsedReadQuery;
|
|
808
823
|
}
|
|
809
824
|
/** A parsed `with` entry: the CTE's name and its body, ready to render into the WITH clause. */
|
|
810
825
|
export interface ParsedCte {
|
|
811
826
|
alias: string;
|
|
812
|
-
|
|
827
|
+
query: ParsedReadQuery;
|
|
813
828
|
/** A recursive CTE reads itself, and makes the whole clause `WITH RECURSIVE`. */
|
|
814
829
|
recursive: boolean;
|
|
815
830
|
}
|
|
831
|
+
export interface ParsedJoin {
|
|
832
|
+
kind: "inner" | "left";
|
|
833
|
+
source: ParsedSource;
|
|
834
|
+
/** An absent ON is an error if the join survives pruning. */
|
|
835
|
+
on: ParsedSql | undefined;
|
|
836
|
+
keep: boolean;
|
|
837
|
+
}
|
|
816
838
|
/**
|
|
817
839
|
* Per-source soft-delete injections: `alias.deleted_at IS NULL` for a soft-deletable entity.
|
|
818
840
|
* CTI subtypes are skipped because their deleted-at column belongs to the base table (see
|
|
@@ -831,7 +853,7 @@ export declare function injectedConditions(source: {
|
|
|
831
853
|
* `pruneIfUndefined` applies unchanged. Deferred SQL expression conditions are resolved
|
|
832
854
|
* against the context first.
|
|
833
855
|
*/
|
|
834
|
-
export declare function
|
|
856
|
+
export declare function parseCondition(cond: QueryCondition | undefined, ctx: Ctx, topLevel: boolean): ParsedSql | undefined;
|
|
835
857
|
/**
|
|
836
858
|
* Accepts only own enumerable POJO fields, so nothing a caller supplied can be silently ignored: the
|
|
837
859
|
* compilers read these POJOs back with `Object.entries`/`Object.keys`, which skip inherited,
|
|
@@ -856,30 +878,7 @@ export declare function checkPojoKeys(value: object, allowed: readonly PropertyK
|
|
|
856
878
|
export declare function registerCtes(q: {
|
|
857
879
|
with?: WithInput;
|
|
858
880
|
}, ctx: Ctx, assigner: AliasAssigner): ParsedCte[];
|
|
859
|
-
/**
|
|
860
|
-
|
|
861
|
-
*
|
|
862
|
-
* `referenced` is the aliases the rest of the statement used. The WITH clause leads the statement, so
|
|
863
|
-
* its bindings lead the statement's bindings too.
|
|
864
|
-
*/
|
|
865
|
-
export declare function prependCtes(ctes: ParsedCte[], referenced: Set<string>, sql: string, bindings: any[]): {
|
|
866
|
-
sql: string;
|
|
867
|
-
bindings: any[];
|
|
868
|
-
};
|
|
869
|
-
/**
|
|
870
|
-
* Drops the CTEs that nothing reads, given the aliases the rest of the statement referenced.
|
|
871
|
-
*
|
|
872
|
-
* A CTE can only read earlier siblings, so going last to first means every CTE that could read this one
|
|
873
|
-
* was already visited, and its own reads are already in `referenced`. That makes one pass enough; first
|
|
874
|
-
* to last would have to repeat until the set stopped growing. `unshift` restores WITH order.
|
|
875
|
-
*/
|
|
876
|
-
export declare function pruneCtes(ctes: ParsedCte[], referenced: Set<string>): ParsedCte[];
|
|
877
|
-
/**
|
|
878
|
-
* Renders `WITH a AS (...), b AS (...) `, whose bindings lead the statement, as their SQL does.
|
|
879
|
-
*
|
|
880
|
-
* One recursive CTE makes the whole clause `WITH RECURSIVE`, PostgreSQL's rule: the keyword is on the
|
|
881
|
-
* clause, not on the entry that needs it, and it does not force the other entries to be recursive.
|
|
882
|
-
*/
|
|
883
|
-
export declare function withFragment(ctes: ParsedCte[]): SqlFragment;
|
|
881
|
+
/** Embeds a parsed child by reference for rendering after the statement hook. */
|
|
882
|
+
export declare function queryFragment(plan: Pick<Plan, "query">): QuerySql;
|
|
884
883
|
export {};
|
|
885
884
|
//# sourceMappingURL=query.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.cts","names":[],"sources":["../../../src/queries/sql/query.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.cts","names":[],"sources":["../../../src/queries/sql/query.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAiHa;qBACA;qBACA;;YAGD,cAAc,8BAA8B,YAAY;YAAsB;;;;;;;;;YAS9E,iBACR,eACA;EAEM,eAAe;EAA+B;EAAY;EAAgB;;EAC1E,cAAc;EAA+B;EAAa;EAAgB;;EAC1E;;EACJ,QAAQ;EAAyB;EAAmB;EAAa;;EACjE,WAAW;EAAyB;EAAgB;EAAa;;;iBAGtD,gBAAgB,GAAG;WACzB,OAAO;WACP,QAAQ;;;YAIP,cAAc,GAAG,uBAAuB,gBAAgB,GAAG;;YAG3D;YACI,YAAY;;YACZ,gBAAgB;;;KAG3B;YACW,YAAY;;YACZ,gBAAgB;;;;;;;YAOpB,YAAY,UAAU,aAAa,kBAAkB,SAAS,aAAa;YAC3E,0BAA0B;;YAG1B,iBAAiB,gBAAgB,SAA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BAIQ;EACf;EACA,OAAO;;EAEP;;iBAGe;EACf;EACA,QAAQ;;EAER,IAAI;EACJ;;;;;;;;;;wBAoKc,mBACd;EAAU,MAAM;EAA4B;GAC5C,qCACC;;;;;;;wBAkRa,eAAe,MAAM,4BAA4B,KAAK,KAAK,oBAAoB;;;;;;;;;;;;wBA2I/E,cAAc,eAAe,kBAAkB,eAAe;;;;;;;;;;wBA+F9D,aAAa;EAAK,OAAO;GAAa,KAAK,KAAK,UAAU,gBAAgB;;wBAiF1E,cAAc,MAAM,KAAK,iBAAiB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Entity } from "../../Entity.mjs";
|
|
2
2
|
import { EntityMetadata } from "../../EntityMetadata.mjs";
|
|
3
|
+
import { CheckInput, ExprFromInput, ExprInput, ExpressionSources, ExpressionValue } from "./expressions/types.mjs";
|
|
3
4
|
import { SqlCondition, SqlPredicate, UnbrandedPredicate } from "../conditions.mjs";
|
|
4
5
|
import { ColumnCondition } from "../parsedConditions.mjs";
|
|
5
6
|
import { AliasAssigner } from "./AliasAssigner.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { BaseExpr, Expr, ExprContext, ExprLike, InnerJoin, LeftJoin, SqlFragment, selectKeyBrand } from "./Expr.mjs";
|
|
7
|
+
import { BaseExpr, Expr, ExprContext, ExprLike, InnerJoin, LeftJoin, selectKeyBrand } from "./Expr.mjs";
|
|
8
8
|
import "./expressions/expression.mjs";
|
|
9
9
|
import { CheckJoinInput, TreeEntries } from "./JoinTree.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { ParsedReadQuery } from "./ParsedQuery.mjs";
|
|
11
|
+
import { ParsedSql, QuerySql } from "./ParsedSqlExpression.mjs";
|
|
12
|
+
import { JoinTableHandle, Table, TableBrand, TableFor, TableSourceBrand, TableSourceMgmt, referenceJoinSource, tableMgmt } from "./Tables.mjs";
|
|
11
13
|
import { TypeInfo } from "../../serde/TypeInfo.mjs";
|
|
12
14
|
/**
|
|
13
15
|
* `em.query`: SQL-shaped queries as plain object literals.
|
|
@@ -653,7 +655,7 @@ export declare function isReadQueryValue(arg: unknown): boolean;
|
|
|
653
655
|
* Source-shaped values need read hydration/source rules and are deliberately excluded here.
|
|
654
656
|
*/
|
|
655
657
|
export declare function projectionToSql(select: unknown, ctx: Ctx, joins?: QueryJoinList): {
|
|
656
|
-
selects:
|
|
658
|
+
selects: ParsedSql[];
|
|
657
659
|
decodeRows: Plan["decodeRows"];
|
|
658
660
|
output: QueryOutput;
|
|
659
661
|
};
|
|
@@ -668,11 +670,8 @@ export declare function projectionToSql(select: unknown, ctx: Ctx, joins?: Query
|
|
|
668
670
|
export interface EntityHydrator {
|
|
669
671
|
hydrate(cstr: any, rows: readonly any[]): any[];
|
|
670
672
|
}
|
|
671
|
-
export interface Plan {
|
|
672
|
-
|
|
673
|
-
bindings: any[];
|
|
674
|
-
/** Aliases of enclosing queries this (sub)query referenced. */
|
|
675
|
-
outerRefs: string[];
|
|
673
|
+
export interface Plan<Q = ParsedReadQuery> {
|
|
674
|
+
query: Q;
|
|
676
675
|
/** Ordered SQL output columns and their existing expression codecs, before JS row decoding. */
|
|
677
676
|
output: QueryOutput;
|
|
678
677
|
decodeRows(em: EntityHydrator, rows: any[]): any[];
|
|
@@ -731,7 +730,7 @@ declare class SubqueryColumnExpr extends BaseExpr {
|
|
|
731
730
|
private inner;
|
|
732
731
|
constructor(handle: SubqueryHandle, key: string, inner: BaseExpr);
|
|
733
732
|
get [selectKeyBrand](): string;
|
|
734
|
-
|
|
733
|
+
parseSql(ctx: ExprContext): ParsedSql;
|
|
735
734
|
decode(value: unknown): unknown;
|
|
736
735
|
encode(value: unknown): unknown;
|
|
737
736
|
get outputType(): TypeInfo | undefined;
|
|
@@ -741,9 +740,7 @@ declare class SubqueryColumnExpr extends BaseExpr {
|
|
|
741
740
|
/**
|
|
742
741
|
* What an expression needs from the query it is generating SQL for.
|
|
743
742
|
*
|
|
744
|
-
* Each (sub)query gets its own `Ctx`; a lookup that misses locally walks up to the enclosing query
|
|
745
|
-
* records the hit in `outerRefs`, which is how a correlated subquery reports the outer aliases it
|
|
746
|
-
* depends on (the way `ExistsCondition.outerAliases` does), so join pruning keeps them.
|
|
743
|
+
* Each (sub)query gets its own `Ctx`; a lookup that misses locally walks up to the enclosing query.
|
|
747
744
|
*/
|
|
748
745
|
export declare class Ctx implements ExprContext {
|
|
749
746
|
readonly assigner: AliasAssigner;
|
|
@@ -765,7 +762,6 @@ export declare class Ctx implements ExprContext {
|
|
|
765
762
|
private usedCtes;
|
|
766
763
|
/** The recursive CTE whose body this query is part of, if any; see `recursiveSelf`. */
|
|
767
764
|
private ownRecursiveSelf;
|
|
768
|
-
readonly outerRefs: Set<string>;
|
|
769
765
|
constructor(assigner: AliasAssigner, parent: Ctx | undefined);
|
|
770
766
|
/**
|
|
771
767
|
* One handle can hold only one alias per query, so a value used twice must be told apart, not
|
|
@@ -779,9 +775,6 @@ export declare class Ctx implements ExprContext {
|
|
|
779
775
|
/**
|
|
780
776
|
* The CTE name for `handle`, looking in the enclosing queries too, because a CTE is in scope for the
|
|
781
777
|
* whole statement.
|
|
782
|
-
*
|
|
783
|
-
* Unlike `aliasFor`, a hit in an enclosing query is not added to `outerRefs`: reading a CTE by name
|
|
784
|
-
* is not a correlated reference, so it must not keep an enclosing join alive.
|
|
785
778
|
*/
|
|
786
779
|
cteAliasFor(handle: object): string | undefined;
|
|
787
780
|
/**
|
|
@@ -804,15 +797,44 @@ export declare class Ctx implements ExprContext {
|
|
|
804
797
|
*/
|
|
805
798
|
useCte(handle: object): void;
|
|
806
799
|
aliasFor(handle: object): string;
|
|
807
|
-
|
|
800
|
+
parseCondition(cond: QueryCondition): ParsedSql | undefined;
|
|
801
|
+
}
|
|
802
|
+
export type ParsedSource = ParsedTableSource | ParsedCteSource | ParsedQuerySource;
|
|
803
|
+
interface ParsedSourceBase {
|
|
804
|
+
handle: TableSourceMgmt | SubqueryHandle | JoinTableHandle;
|
|
805
|
+
alias: string;
|
|
806
|
+
meta: EntityMetadata | undefined;
|
|
807
|
+
}
|
|
808
|
+
/** A physical table in FROM or JOIN. */
|
|
809
|
+
export interface ParsedTableSource extends ParsedSourceBase {
|
|
810
|
+
kind: "table";
|
|
811
|
+
table: string;
|
|
812
|
+
schema?: string;
|
|
813
|
+
}
|
|
814
|
+
/** A reference to a named CTE. */
|
|
815
|
+
export interface ParsedCteSource extends ParsedSourceBase {
|
|
816
|
+
kind: "cte";
|
|
817
|
+
cte: string;
|
|
818
|
+
}
|
|
819
|
+
/** An inline subquery in FROM or JOIN. */
|
|
820
|
+
export interface ParsedQuerySource extends ParsedSourceBase {
|
|
821
|
+
kind: "query";
|
|
822
|
+
query: ParsedReadQuery;
|
|
808
823
|
}
|
|
809
824
|
/** A parsed `with` entry: the CTE's name and its body, ready to render into the WITH clause. */
|
|
810
825
|
export interface ParsedCte {
|
|
811
826
|
alias: string;
|
|
812
|
-
|
|
827
|
+
query: ParsedReadQuery;
|
|
813
828
|
/** A recursive CTE reads itself, and makes the whole clause `WITH RECURSIVE`. */
|
|
814
829
|
recursive: boolean;
|
|
815
830
|
}
|
|
831
|
+
export interface ParsedJoin {
|
|
832
|
+
kind: "inner" | "left";
|
|
833
|
+
source: ParsedSource;
|
|
834
|
+
/** An absent ON is an error if the join survives pruning. */
|
|
835
|
+
on: ParsedSql | undefined;
|
|
836
|
+
keep: boolean;
|
|
837
|
+
}
|
|
816
838
|
/**
|
|
817
839
|
* Per-source soft-delete injections: `alias.deleted_at IS NULL` for a soft-deletable entity.
|
|
818
840
|
* CTI subtypes are skipped because their deleted-at column belongs to the base table (see
|
|
@@ -831,7 +853,7 @@ export declare function injectedConditions(source: {
|
|
|
831
853
|
* `pruneIfUndefined` applies unchanged. Deferred SQL expression conditions are resolved
|
|
832
854
|
* against the context first.
|
|
833
855
|
*/
|
|
834
|
-
export declare function
|
|
856
|
+
export declare function parseCondition(cond: QueryCondition | undefined, ctx: Ctx, topLevel: boolean): ParsedSql | undefined;
|
|
835
857
|
/**
|
|
836
858
|
* Accepts only own enumerable POJO fields, so nothing a caller supplied can be silently ignored: the
|
|
837
859
|
* compilers read these POJOs back with `Object.entries`/`Object.keys`, which skip inherited,
|
|
@@ -856,30 +878,7 @@ export declare function checkPojoKeys(value: object, allowed: readonly PropertyK
|
|
|
856
878
|
export declare function registerCtes(q: {
|
|
857
879
|
with?: WithInput;
|
|
858
880
|
}, ctx: Ctx, assigner: AliasAssigner): ParsedCte[];
|
|
859
|
-
/**
|
|
860
|
-
|
|
861
|
-
*
|
|
862
|
-
* `referenced` is the aliases the rest of the statement used. The WITH clause leads the statement, so
|
|
863
|
-
* its bindings lead the statement's bindings too.
|
|
864
|
-
*/
|
|
865
|
-
export declare function prependCtes(ctes: ParsedCte[], referenced: Set<string>, sql: string, bindings: any[]): {
|
|
866
|
-
sql: string;
|
|
867
|
-
bindings: any[];
|
|
868
|
-
};
|
|
869
|
-
/**
|
|
870
|
-
* Drops the CTEs that nothing reads, given the aliases the rest of the statement referenced.
|
|
871
|
-
*
|
|
872
|
-
* A CTE can only read earlier siblings, so going last to first means every CTE that could read this one
|
|
873
|
-
* was already visited, and its own reads are already in `referenced`. That makes one pass enough; first
|
|
874
|
-
* to last would have to repeat until the set stopped growing. `unshift` restores WITH order.
|
|
875
|
-
*/
|
|
876
|
-
export declare function pruneCtes(ctes: ParsedCte[], referenced: Set<string>): ParsedCte[];
|
|
877
|
-
/**
|
|
878
|
-
* Renders `WITH a AS (...), b AS (...) `, whose bindings lead the statement, as their SQL does.
|
|
879
|
-
*
|
|
880
|
-
* One recursive CTE makes the whole clause `WITH RECURSIVE`, PostgreSQL's rule: the keyword is on the
|
|
881
|
-
* clause, not on the entry that needs it, and it does not force the other entries to be recursive.
|
|
882
|
-
*/
|
|
883
|
-
export declare function withFragment(ctes: ParsedCte[]): SqlFragment;
|
|
881
|
+
/** Embeds a parsed child by reference for rendering after the statement hook. */
|
|
882
|
+
export declare function queryFragment(plan: Pick<Plan, "query">): QuerySql;
|
|
884
883
|
export {};
|
|
885
884
|
//# sourceMappingURL=query.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.mts","names":[],"sources":["../../../src/queries/sql/query.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.mts","names":[],"sources":["../../../src/queries/sql/query.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAiHa;qBACA;qBACA;;YAGD,cAAc,8BAA8B,YAAY;YAAsB;;;;;;;;;YAS9E,iBACR,eACA;EAEM,eAAe;EAA+B;EAAY;EAAgB;;EAC1E,cAAc;EAA+B;EAAa;EAAgB;;EAC1E;;EACJ,QAAQ;EAAyB;EAAmB;EAAa;;EACjE,WAAW;EAAyB;EAAgB;EAAa;;;iBAGtD,gBAAgB,GAAG;WACzB,OAAO;WACP,QAAQ;;;YAIP,cAAc,GAAG,uBAAuB,gBAAgB,GAAG;;YAG3D;YACI,YAAY;;YACZ,gBAAgB;;;KAG3B;YACW,YAAY;;YACZ,gBAAgB;;;;;;;YAOpB,YAAY,UAAU,aAAa,kBAAkB,SAAS,aAAa;YAC3E,0BAA0B;;YAG1B,iBAAiB,gBAAgB,SAAS;;;;;YAM1C,cAAc,GAAG,KAAK,UAAU,gBACxC,IACA,UAAU,eAAe,UAAU,UACjC,YAAY,GAAG,kBAAiB,cACrB,QAAQ,GAAG;;;;;;;YAUhB,aAAa;;YAGb,YAAY,uBAAuB;;iBAG9B;;EAEf;;;YAIU;WACD,MAAM;WACN;WACA;;YAGC;;;;;;;;;YAgBA,YAAY,KAEtB,mBAAmB,sCACH,KAAK,UAAU,cAAc,kCAEzC;YAAsB;aAAuB,gBAAgB;;IAC3D,UAAU,qBAEI,WAAW,MAAM,MAAM,MAAM,GAAG,WAAW,gBAAgB,aACjE,0CAKR,UAAU,wCAGI,WAAW,cAAc;;KAG1C,WAAW,KAAK,0BAA0B,YAAY;;KAGtD,yBAAyB,KAAK,oCACjB,WAAW,g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