@entity-access/entity-access 1.2.27 → 1.2.29
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/.tsbuildinfo +1 -1
- package/dist/drivers/sql-server/ExpressionToSqlServer.js +14 -4
- package/dist/drivers/sql-server/ExpressionToSqlServer.js.map +1 -1
- package/dist/model/EntityQuery.js +8 -4
- package/dist/model/EntityQuery.js.map +1 -1
- package/dist/query/ast/ExpressionToSql.js +5 -1
- package/dist/query/ast/ExpressionToSql.js.map +1 -1
- package/dist/query/ast/Expressions.js +1 -0
- package/dist/query/ast/Expressions.js.map +1 -1
- package/dist/workflows/WorkflowStorage.js +3 -4
- package/dist/workflows/WorkflowStorage.js.map +1 -1
- package/dist/workflows/WorkflowTask.js +3 -2
- package/dist/workflows/WorkflowTask.js.map +1 -1
- package/package.json +1 -1
- package/src/drivers/sql-server/ExpressionToSqlServer.ts +17 -4
- package/src/model/EntityQuery.ts +10 -4
- package/src/model/IFilterWithParameter.ts +2 -0
- package/src/query/ast/ExpressionToSql.ts +5 -1
- package/src/query/ast/Expressions.ts +1 -0
- package/src/workflows/WorkflowStorage.ts +3 -4
- package/src/workflows/WorkflowTask.ts +3 -2
- package/tsconfig.json +0 -2
- package/dist/common/CIMap.d.ts +0 -16
- package/dist/common/CIMap.d.ts.map +0 -1
- package/dist/common/CustomEvent.d.ts +0 -12
- package/dist/common/CustomEvent.d.ts.map +0 -1
- package/dist/common/EALogger.d.ts +0 -4
- package/dist/common/EALogger.d.ts.map +0 -1
- package/dist/common/EntityAccessError.d.ts +0 -7
- package/dist/common/EntityAccessError.d.ts.map +0 -1
- package/dist/common/ErrorModel.d.ts +0 -14
- package/dist/common/ErrorModel.d.ts.map +0 -1
- package/dist/common/EventSet.d.ts +0 -20
- package/dist/common/EventSet.d.ts.map +0 -1
- package/dist/common/IColumnSchema.d.ts +0 -21
- package/dist/common/IColumnSchema.d.ts.map +0 -1
- package/dist/common/IDisposable.d.ts +0 -7
- package/dist/common/IDisposable.d.ts.map +0 -1
- package/dist/common/ImmutableObject.d.ts +0 -5
- package/dist/common/ImmutableObject.d.ts.map +0 -1
- package/dist/common/JsonGenerator.d.ts +0 -11
- package/dist/common/JsonGenerator.d.ts.map +0 -1
- package/dist/common/Logger.d.ts +0 -33
- package/dist/common/Logger.d.ts.map +0 -1
- package/dist/common/ObjectPool.d.ts +0 -61
- package/dist/common/ObjectPool.d.ts.map +0 -1
- package/dist/common/TypeInfo.d.ts +0 -4
- package/dist/common/TypeInfo.d.ts.map +0 -1
- package/dist/common/cache/InstanceCache.d.ts +0 -2
- package/dist/common/cache/InstanceCache.d.ts.map +0 -1
- package/dist/common/cache/TimedCache.d.ts +0 -33
- package/dist/common/cache/TimedCache.d.ts.map +0 -1
- package/dist/common/cloner.d.ts +0 -4
- package/dist/common/cloner.d.ts.map +0 -1
- package/dist/common/sleep.d.ts +0 -2
- package/dist/common/sleep.d.ts.map +0 -1
- package/dist/common/symbols/symbols.d.ts +0 -8
- package/dist/common/symbols/symbols.d.ts.map +0 -1
- package/dist/common/usingAsync.d.ts +0 -15
- package/dist/common/usingAsync.d.ts.map +0 -1
- package/dist/compiler/ISqlHelpers.d.ts +0 -12
- package/dist/compiler/ISqlHelpers.d.ts.map +0 -1
- package/dist/compiler/NamingConventions.d.ts +0 -8
- package/dist/compiler/NamingConventions.d.ts.map +0 -1
- package/dist/compiler/QueryCompiler.d.ts +0 -45
- package/dist/compiler/QueryCompiler.d.ts.map +0 -1
- package/dist/compiler/RawQuery.d.ts +0 -9
- package/dist/compiler/RawQuery.d.ts.map +0 -1
- package/dist/compiler/postgres/PostgreSqlMethodTransformer.d.ts +0 -4
- package/dist/compiler/postgres/PostgreSqlMethodTransformer.d.ts.map +0 -1
- package/dist/compiler/sql-server/SqlServerSqlMethodTransformer.d.ts +0 -4
- package/dist/compiler/sql-server/SqlServerSqlMethodTransformer.d.ts.map +0 -1
- package/dist/decorators/CheckConstraint.d.ts +0 -4
- package/dist/decorators/CheckConstraint.d.ts.map +0 -1
- package/dist/decorators/Column.d.ts +0 -10
- package/dist/decorators/Column.d.ts.map +0 -1
- package/dist/decorators/ForeignKey.d.ts +0 -10
- package/dist/decorators/ForeignKey.d.ts.map +0 -1
- package/dist/decorators/ICheckConstraint.d.ts +0 -5
- package/dist/decorators/ICheckConstraint.d.ts.map +0 -1
- package/dist/decorators/IClassOf.d.ts +0 -3
- package/dist/decorators/IClassOf.d.ts.map +0 -1
- package/dist/decorators/IColumn.d.ts +0 -87
- package/dist/decorators/IColumn.d.ts.map +0 -1
- package/dist/decorators/IForeignKeyConstraint.d.ts +0 -12
- package/dist/decorators/IForeignKeyConstraint.d.ts.map +0 -1
- package/dist/decorators/IIndex.d.ts +0 -30
- package/dist/decorators/IIndex.d.ts.map +0 -1
- package/dist/decorators/ISqlType.d.ts +0 -61
- package/dist/decorators/ISqlType.d.ts.map +0 -1
- package/dist/decorators/Index.d.ts +0 -4
- package/dist/decorators/Index.d.ts.map +0 -1
- package/dist/decorators/Relate.d.ts +0 -37
- package/dist/decorators/Relate.d.ts.map +0 -1
- package/dist/decorators/SchemaRegistry.d.ts +0 -9
- package/dist/decorators/SchemaRegistry.d.ts.map +0 -1
- package/dist/decorators/Table.d.ts +0 -9
- package/dist/decorators/Table.d.ts.map +0 -1
- package/dist/decorators/parser/NameParser.d.ts +0 -4
- package/dist/decorators/parser/NameParser.d.ts.map +0 -1
- package/dist/di/di.d.ts +0 -49
- package/dist/di/di.d.ts.map +0 -1
- package/dist/drivers/base/BaseDriver.d.ts +0 -134
- package/dist/drivers/base/BaseDriver.d.ts.map +0 -1
- package/dist/drivers/base/ExistingSchema.d.ts +0 -14
- package/dist/drivers/base/ExistingSchema.d.ts.map +0 -1
- package/dist/drivers/base/ReaderQueue.d.ts +0 -17
- package/dist/drivers/base/ReaderQueue.d.ts.map +0 -1
- package/dist/drivers/postgres/PostgreSqlDriver.d.ts +0 -29
- package/dist/drivers/postgres/PostgreSqlDriver.d.ts.map +0 -1
- package/dist/drivers/sql-server/ExpressionToSqlServer.d.ts +0 -14
- package/dist/drivers/sql-server/ExpressionToSqlServer.d.ts.map +0 -1
- package/dist/drivers/sql-server/SqlServerDriver.d.ts +0 -30
- package/dist/drivers/sql-server/SqlServerDriver.d.ts.map +0 -1
- package/dist/drivers/sql-server/SqlServerLiteral.d.ts +0 -5
- package/dist/drivers/sql-server/SqlServerLiteral.d.ts.map +0 -1
- package/dist/drivers/sql-server/SqlServerQueryCompiler.d.ts +0 -5
- package/dist/drivers/sql-server/SqlServerQueryCompiler.d.ts.map +0 -1
- package/dist/entity-query/EntityType.d.ts +0 -76
- package/dist/entity-query/EntityType.d.ts.map +0 -1
- package/dist/index.d.ts +0 -22
- package/dist/index.d.ts.map +0 -1
- package/dist/migrations/Migrations.d.ts +0 -44
- package/dist/migrations/Migrations.d.ts.map +0 -1
- package/dist/migrations/postgres/PostgresAutomaticMigrations.d.ts +0 -19
- package/dist/migrations/postgres/PostgresAutomaticMigrations.d.ts.map +0 -1
- package/dist/migrations/postgres/PostgresMigrations.d.ts +0 -11
- package/dist/migrations/postgres/PostgresMigrations.d.ts.map +0 -1
- package/dist/migrations/sql-server/SqlServerAutomaticMigrations.d.ts +0 -19
- package/dist/migrations/sql-server/SqlServerAutomaticMigrations.d.ts.map +0 -1
- package/dist/migrations/sql-server/SqlServerMigrations.d.ts +0 -12
- package/dist/migrations/sql-server/SqlServerMigrations.d.ts.map +0 -1
- package/dist/model/EntityContext.d.ts +0 -36
- package/dist/model/EntityContext.d.ts.map +0 -1
- package/dist/model/EntityModel.d.ts +0 -13
- package/dist/model/EntityModel.d.ts.map +0 -1
- package/dist/model/EntityQuery.d.ts +0 -63
- package/dist/model/EntityQuery.d.ts.map +0 -1
- package/dist/model/EntitySource.d.ts +0 -86
- package/dist/model/EntitySource.d.ts.map +0 -1
- package/dist/model/IFilterWithParameter.d.ts +0 -78
- package/dist/model/IFilterWithParameter.d.ts.map +0 -1
- package/dist/model/SourceExpression.d.ts +0 -2
- package/dist/model/SourceExpression.d.ts.map +0 -1
- package/dist/model/changes/ChangeEntry.d.ts +0 -61
- package/dist/model/changes/ChangeEntry.d.ts.map +0 -1
- package/dist/model/changes/ChangeSet.d.ts +0 -31
- package/dist/model/changes/ChangeSet.d.ts.map +0 -1
- package/dist/model/events/ContextEvents.d.ts +0 -11
- package/dist/model/events/ContextEvents.d.ts.map +0 -1
- package/dist/model/events/EntityEvents.d.ts +0 -39
- package/dist/model/events/EntityEvents.d.ts.map +0 -1
- package/dist/model/events/FilteredExpression.d.ts +0 -11
- package/dist/model/events/FilteredExpression.d.ts.map +0 -1
- package/dist/model/identity/IdentityMap.d.ts +0 -23
- package/dist/model/identity/IdentityMap.d.ts.map +0 -1
- package/dist/model/identity/IdentityService.d.ts +0 -5
- package/dist/model/identity/IdentityService.d.ts.map +0 -1
- package/dist/model/identity/RelationMapper.d.ts +0 -11
- package/dist/model/identity/RelationMapper.d.ts.map +0 -1
- package/dist/model/identity/SearchIndex.d.ts +0 -17
- package/dist/model/identity/SearchIndex.d.ts.map +0 -1
- package/dist/model/symbols.d.ts +0 -2
- package/dist/model/symbols.d.ts.map +0 -1
- package/dist/model/verification/VerificationSession.d.ts +0 -27
- package/dist/model/verification/VerificationSession.d.ts.map +0 -1
- package/dist/query/Query.d.ts +0 -29
- package/dist/query/Query.d.ts.map +0 -1
- package/dist/query/ast/DebugStringVisitor.d.ts +0 -40
- package/dist/query/ast/DebugStringVisitor.d.ts.map +0 -1
- package/dist/query/ast/ExpressionToSql.d.ts +0 -67
- package/dist/query/ast/ExpressionToSql.d.ts.map +0 -1
- package/dist/query/ast/Expressions.d.ts +0 -254
- package/dist/query/ast/Expressions.d.ts.map +0 -1
- package/dist/query/ast/IStringTransformer.d.ts +0 -27
- package/dist/query/ast/IStringTransformer.d.ts.map +0 -1
- package/dist/query/ast/ParameterScope.d.ts +0 -25
- package/dist/query/ast/ParameterScope.d.ts.map +0 -1
- package/dist/query/ast/ReplaceParameter.d.ts +0 -6
- package/dist/query/ast/ReplaceParameter.d.ts.map +0 -1
- package/dist/query/ast/SqlLiteral.d.ts +0 -4
- package/dist/query/ast/SqlLiteral.d.ts.map +0 -1
- package/dist/query/ast/Types.d.ts +0 -2
- package/dist/query/ast/Types.d.ts.map +0 -1
- package/dist/query/ast/Visitor.d.ts +0 -40
- package/dist/query/ast/Visitor.d.ts.map +0 -1
- package/dist/query/expander/QueryExpander.d.ts +0 -12
- package/dist/query/expander/QueryExpander.d.ts.map +0 -1
- package/dist/query/parser/ArrowToExpression.d.ts +0 -58
- package/dist/query/parser/ArrowToExpression.d.ts.map +0 -1
- package/dist/query/parser/BabelVisitor.d.ts +0 -24
- package/dist/query/parser/BabelVisitor.d.ts.map +0 -1
- package/dist/query/parser/NotSupportedError.d.ts +0 -5
- package/dist/query/parser/NotSupportedError.d.ts.map +0 -1
- package/dist/query/parser/Restructure.d.ts +0 -20
- package/dist/query/parser/Restructure.d.ts.map +0 -1
- package/dist/query/parser/TransformVisitor.d.ts +0 -25
- package/dist/query/parser/TransformVisitor.d.ts.map +0 -1
- package/dist/sql/ISql.d.ts +0 -160
- package/dist/sql/ISql.d.ts.map +0 -1
- package/dist/sql/Sql.d.ts +0 -4
- package/dist/sql/Sql.d.ts.map +0 -1
- package/dist/types/DateTime.d.ts +0 -168
- package/dist/types/DateTime.d.ts.map +0 -1
- package/dist/types/TimeSpan.d.ts +0 -40
- package/dist/types/TimeSpan.d.ts.map +0 -1
- package/dist/workflows/ActivitySuspendedError.d.ts +0 -6
- package/dist/workflows/ActivitySuspendedError.d.ts.map +0 -1
- package/dist/workflows/Waiter.d.ts +0 -10
- package/dist/workflows/Waiter.d.ts.map +0 -1
- package/dist/workflows/Workflow.d.ts +0 -47
- package/dist/workflows/Workflow.d.ts.map +0 -1
- package/dist/workflows/WorkflowClock.d.ts +0 -5
- package/dist/workflows/WorkflowClock.d.ts.map +0 -1
- package/dist/workflows/WorkflowContext.d.ts +0 -52
- package/dist/workflows/WorkflowContext.d.ts.map +0 -1
- package/dist/workflows/WorkflowDbContext.d.ts +0 -32
- package/dist/workflows/WorkflowDbContext.d.ts.map +0 -1
- package/dist/workflows/WorkflowRegistry.d.ts +0 -13
- package/dist/workflows/WorkflowRegistry.d.ts.map +0 -1
- package/dist/workflows/WorkflowStorage.d.ts +0 -72
- package/dist/workflows/WorkflowStorage.d.ts.map +0 -1
- package/dist/workflows/WorkflowTask.d.ts +0 -13
- package/dist/workflows/WorkflowTask.d.ts.map +0 -1
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { IClassOf } from "../../decorators/IClassOf.js";
|
|
2
|
-
import type EntityType from "../../entity-query/EntityType.js";
|
|
3
|
-
/**
|
|
4
|
-
* The reason we are using our own Expression type is to keep
|
|
5
|
-
* our expressions small and independent of JavaScript ESTree style.
|
|
6
|
-
*
|
|
7
|
-
* Reason is simple, our visitor pattern can be small and can stay
|
|
8
|
-
* independent of any other extra expression types.
|
|
9
|
-
*
|
|
10
|
-
* We will cache our expressions, to avoid parsing them multiple times.
|
|
11
|
-
* Our expressions do not need to store exact line numbers, comments,
|
|
12
|
-
* extra annotations. We can add some shortcut optimizations which might
|
|
13
|
-
* not be possible with outer libraries unless they support it.
|
|
14
|
-
*
|
|
15
|
-
* In future, we might make our own expression parser as we only need
|
|
16
|
-
* handful of features to keep it small and faster. Or we can swap some
|
|
17
|
-
* other JavaScript parser without affecting our code generation process.
|
|
18
|
-
*/
|
|
19
|
-
export declare abstract class Expression {
|
|
20
|
-
static callExpression(callee: string | Expression, ...args: Expression[]): CallExpression;
|
|
21
|
-
static array(elements: Expression[]): ArrayExpression;
|
|
22
|
-
static as(expression: Expression, alias: Identifier | string): ExpressionAs;
|
|
23
|
-
static templateLiteral(value: Expression[]): TemplateLiteral;
|
|
24
|
-
static constant(value: string): Constant;
|
|
25
|
-
static parameter(name: string, model?: EntityType): ParameterExpression;
|
|
26
|
-
static identifier(name: string): Identifier;
|
|
27
|
-
static quotedIdentifier(name: string): Identifier;
|
|
28
|
-
static logicalAnd(left: Expression, right: Expression): BinaryExpression;
|
|
29
|
-
static logicalOr(left: Expression, right: Expression): BinaryExpression;
|
|
30
|
-
static member(target: Expression, identifier: string | Expression): MemberExpression;
|
|
31
|
-
static equal(left: Expression, right: Expression): BinaryExpression;
|
|
32
|
-
static less(left: Expression, right: Expression): BinaryExpression;
|
|
33
|
-
static lessOrEqual(left: Expression, right: Expression): BinaryExpression;
|
|
34
|
-
static assign(left: Expression, right: Expression): BinaryExpression;
|
|
35
|
-
static union(...queries: Expression[]): UnionStatement;
|
|
36
|
-
static unionAll(...queries: Expression[]): UnionStatement;
|
|
37
|
-
static create<T extends Expression>(this: IClassOf<T>, p: Partial<Omit<T, "type">>): T;
|
|
38
|
-
static clone<T extends Expression>(expression: T): T;
|
|
39
|
-
readonly type: ExpressionType["type"];
|
|
40
|
-
}
|
|
41
|
-
export declare class ArrayExpression extends Expression {
|
|
42
|
-
readonly type = "ArrayExpression";
|
|
43
|
-
elements: Expression[];
|
|
44
|
-
}
|
|
45
|
-
export declare class BinaryExpression extends Expression {
|
|
46
|
-
readonly type = "BinaryExpression";
|
|
47
|
-
left: Expression;
|
|
48
|
-
right: Expression;
|
|
49
|
-
operator: string;
|
|
50
|
-
assign?: boolean;
|
|
51
|
-
}
|
|
52
|
-
export declare class CoalesceExpression extends Expression {
|
|
53
|
-
readonly type = "CoalesceExpression";
|
|
54
|
-
left: Expression;
|
|
55
|
-
right: Expression;
|
|
56
|
-
}
|
|
57
|
-
export declare class ValuesStatement extends Expression {
|
|
58
|
-
readonly type = "ValuesStatement";
|
|
59
|
-
as: Identifier;
|
|
60
|
-
fields: Identifier[];
|
|
61
|
-
values: Expression[][];
|
|
62
|
-
}
|
|
63
|
-
export declare class OrderByExpression extends Expression {
|
|
64
|
-
readonly type = "OrderByExpression";
|
|
65
|
-
target: Expression;
|
|
66
|
-
descending: boolean;
|
|
67
|
-
}
|
|
68
|
-
export declare class NotExits extends Expression {
|
|
69
|
-
readonly type = "NotExists";
|
|
70
|
-
target: Expression;
|
|
71
|
-
}
|
|
72
|
-
export declare class NotExpression extends Expression {
|
|
73
|
-
readonly type = "NotExpression";
|
|
74
|
-
expression: Expression;
|
|
75
|
-
}
|
|
76
|
-
export declare class NegateExpression extends Expression {
|
|
77
|
-
readonly type = "NegateExpression";
|
|
78
|
-
expression: Expression;
|
|
79
|
-
}
|
|
80
|
-
export declare class ExistsExpression extends Expression {
|
|
81
|
-
readonly type = "ExistsExpression";
|
|
82
|
-
target: Expression;
|
|
83
|
-
}
|
|
84
|
-
export declare class CallExpression extends Expression {
|
|
85
|
-
readonly type = "CallExpression";
|
|
86
|
-
callee: Expression;
|
|
87
|
-
arguments: Expression[];
|
|
88
|
-
collectionMethod: string;
|
|
89
|
-
castMethod: string;
|
|
90
|
-
}
|
|
91
|
-
export declare class BracketExpression extends Expression {
|
|
92
|
-
readonly type = "BracketExpression";
|
|
93
|
-
target: Expression;
|
|
94
|
-
}
|
|
95
|
-
export declare class ParameterExpression extends Expression {
|
|
96
|
-
readonly type = "ParameterExpression";
|
|
97
|
-
name: string;
|
|
98
|
-
/**
|
|
99
|
-
* Default value if any...
|
|
100
|
-
*/
|
|
101
|
-
value: any;
|
|
102
|
-
/**
|
|
103
|
-
* Entity Model representing the variable
|
|
104
|
-
*/
|
|
105
|
-
model: EntityType;
|
|
106
|
-
quotedLiteral: (x: string) => string;
|
|
107
|
-
get id(): any;
|
|
108
|
-
toString(): string;
|
|
109
|
-
}
|
|
110
|
-
export declare class MemberExpression extends Expression {
|
|
111
|
-
readonly type = "MemberExpression";
|
|
112
|
-
target: Expression;
|
|
113
|
-
property: Expression;
|
|
114
|
-
computed: boolean;
|
|
115
|
-
isCollectionMethod: boolean;
|
|
116
|
-
}
|
|
117
|
-
export declare class ArrowFunctionExpression extends Expression {
|
|
118
|
-
readonly type = "ArrowFunctionExpression";
|
|
119
|
-
params: ParameterExpression[];
|
|
120
|
-
body: Expression;
|
|
121
|
-
}
|
|
122
|
-
export type TableSource = SelectStatement | Identifier | ExpressionAs | TableLiteral;
|
|
123
|
-
export type Expand = {
|
|
124
|
-
[key: string]: string | Expand;
|
|
125
|
-
};
|
|
126
|
-
export declare class SelectStatement extends Expression {
|
|
127
|
-
readonly type = "SelectStatement";
|
|
128
|
-
preferLeftJoins: boolean;
|
|
129
|
-
source: TableSource | ValuesStatement;
|
|
130
|
-
sourceParameter: ParameterExpression;
|
|
131
|
-
fields: (Expression | Identifier | ExpressionAs)[];
|
|
132
|
-
where: Expression;
|
|
133
|
-
orderBy: OrderByExpression[];
|
|
134
|
-
joins: JoinExpression[];
|
|
135
|
-
limit: number;
|
|
136
|
-
offset: number;
|
|
137
|
-
model: EntityType;
|
|
138
|
-
}
|
|
139
|
-
export declare class NewObjectExpression extends Expression {
|
|
140
|
-
readonly type = "NewObjectExpression";
|
|
141
|
-
properties: ExpressionAs[];
|
|
142
|
-
}
|
|
143
|
-
export declare class ConditionalExpression extends Expression {
|
|
144
|
-
readonly type = "ConditionalExpression";
|
|
145
|
-
test: Expression;
|
|
146
|
-
consequent: Expression;
|
|
147
|
-
alternate: Expression;
|
|
148
|
-
}
|
|
149
|
-
export declare class JoinExpression extends Expression {
|
|
150
|
-
readonly type = "JoinExpression";
|
|
151
|
-
joinType: "LEFT" | "INNER";
|
|
152
|
-
forceJoinType: "LEFT" | "INNER";
|
|
153
|
-
source: SelectStatement | Identifier | ExpressionAs | TableLiteral;
|
|
154
|
-
as: Identifier | ParameterExpression;
|
|
155
|
-
where: Expression;
|
|
156
|
-
model: EntityType;
|
|
157
|
-
path: string;
|
|
158
|
-
}
|
|
159
|
-
export declare class ReturnUpdated extends Expression {
|
|
160
|
-
readonly type = "ReturnUpdated";
|
|
161
|
-
fields: Identifier[];
|
|
162
|
-
changes: "INSERTED" | "DELETED" | "UPDATED";
|
|
163
|
-
}
|
|
164
|
-
export declare class Constant extends Expression {
|
|
165
|
-
readonly type = "Constant";
|
|
166
|
-
value: any;
|
|
167
|
-
}
|
|
168
|
-
export declare class Identifier extends Expression {
|
|
169
|
-
readonly type = "Identifier";
|
|
170
|
-
value: string;
|
|
171
|
-
quoted: boolean;
|
|
172
|
-
}
|
|
173
|
-
export declare class NullExpression extends Expression {
|
|
174
|
-
readonly type = "NullExpression";
|
|
175
|
-
}
|
|
176
|
-
export declare class StringLiteral extends Expression {
|
|
177
|
-
readonly type = "StringLiteral";
|
|
178
|
-
value: string;
|
|
179
|
-
}
|
|
180
|
-
export declare class BooleanLiteral extends Expression {
|
|
181
|
-
readonly type = "BooleanLiteral";
|
|
182
|
-
value: boolean;
|
|
183
|
-
}
|
|
184
|
-
export declare class NumberLiteral extends Expression {
|
|
185
|
-
static one: NumberLiteral;
|
|
186
|
-
static zero: NumberLiteral;
|
|
187
|
-
readonly type = "NumberLiteral";
|
|
188
|
-
value: number;
|
|
189
|
-
}
|
|
190
|
-
export declare class BigIntLiteral extends Expression {
|
|
191
|
-
readonly type = "BigIntLiteral";
|
|
192
|
-
value: bigint;
|
|
193
|
-
}
|
|
194
|
-
export declare class TemplateElement extends Expression {
|
|
195
|
-
readonly type = "TemplateElement";
|
|
196
|
-
value: {
|
|
197
|
-
raw: string;
|
|
198
|
-
cooked: string;
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
export declare class TemplateLiteral extends Expression {
|
|
202
|
-
readonly type = "TemplateLiteral";
|
|
203
|
-
quasis: TemplateElement[];
|
|
204
|
-
value: Expression[];
|
|
205
|
-
}
|
|
206
|
-
export declare class ExpressionAs extends Expression {
|
|
207
|
-
readonly type = "ExpressionAs";
|
|
208
|
-
expression: Expression;
|
|
209
|
-
alias: Identifier;
|
|
210
|
-
}
|
|
211
|
-
export declare class TableLiteral extends Expression {
|
|
212
|
-
readonly type = "TableLiteral";
|
|
213
|
-
schema: Identifier;
|
|
214
|
-
name: Identifier;
|
|
215
|
-
}
|
|
216
|
-
export declare class InsertStatement extends Expression {
|
|
217
|
-
readonly type = "InsertStatement";
|
|
218
|
-
table: TableLiteral;
|
|
219
|
-
values: ValuesStatement | SelectStatement;
|
|
220
|
-
returnValues: ReturnUpdated;
|
|
221
|
-
}
|
|
222
|
-
export declare class UpdateStatement extends Expression {
|
|
223
|
-
readonly type = "UpdateStatement";
|
|
224
|
-
table: TableSource;
|
|
225
|
-
sourceParameter: ParameterExpression;
|
|
226
|
-
model: EntityType;
|
|
227
|
-
set: BinaryExpression[];
|
|
228
|
-
where: Expression;
|
|
229
|
-
join: JoinExpression;
|
|
230
|
-
returnUpdated: ExpressionAs[];
|
|
231
|
-
}
|
|
232
|
-
export declare class UpsertStatement extends Expression {
|
|
233
|
-
readonly type = "UpsertStatement";
|
|
234
|
-
table: TableLiteral | Identifier;
|
|
235
|
-
insert: BinaryExpression[];
|
|
236
|
-
update: BinaryExpression[];
|
|
237
|
-
keys: BinaryExpression[];
|
|
238
|
-
returnUpdated: ReturnUpdated;
|
|
239
|
-
}
|
|
240
|
-
export declare class UnionStatement extends Expression {
|
|
241
|
-
readonly type = "UnionStatement";
|
|
242
|
-
all: boolean;
|
|
243
|
-
queries: Expression[];
|
|
244
|
-
}
|
|
245
|
-
export declare class DeleteStatement extends Expression {
|
|
246
|
-
readonly type = "DeleteStatement";
|
|
247
|
-
table: TableSource;
|
|
248
|
-
model: EntityType;
|
|
249
|
-
where: Expression;
|
|
250
|
-
sourceParameter: ParameterExpression;
|
|
251
|
-
join: JoinExpression;
|
|
252
|
-
}
|
|
253
|
-
export type ExpressionType = BinaryExpression | ValuesStatement | SelectStatement | Constant | ExpressionAs | TableLiteral | InsertStatement | UpdateStatement | DeleteStatement | UpsertStatement | ReturnUpdated | OrderByExpression | JoinExpression | NullExpression | StringLiteral | NumberLiteral | BigIntLiteral | BooleanLiteral | TemplateLiteral | MemberExpression | CallExpression | CoalesceExpression | ExistsExpression | Identifier | ArrowFunctionExpression | ConditionalExpression | NewObjectExpression | ParameterExpression | ArrayExpression | NotExits | UnionStatement | NotExpression | NegateExpression | BracketExpression | TemplateElement;
|
|
254
|
-
//# sourceMappingURL=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AC;IAC3B,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;CAChC;AAED,qBAAa,cAAe,SAAQ,UAAU;IAC1C,QAAQ,CAAC,IAAI,oBAAoB;IACjC,GAAG,UAAS;IACZ,OAAO,EAAE,UAAU,EAAE,CAAC;CACzB;AAED,qBAAa,eAAgB,SAAQ,UAAU;IAC3C,QAAQ,CAAC,IAAI,qBAAqB;IAClC,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAElB,eAAe,EAAE,mBAAmB,CAAC;IACrC,IAAI,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,QAAQ,GAER,YAAY,GACZ,YAAY,GACZ,eAAe,GACf,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,GACb,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,aAAa,GACb,aAAa,GACb,aAAa,GACb,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,gBAAgB,GAChB,UAAU,GACV,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,GACf,QAAQ,GACR,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,CAClB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type QueryCompiler from "../../compiler/QueryCompiler.js";
|
|
2
|
-
export type ITextQueryFragment = string | ((p: any) => any) | {
|
|
3
|
-
toString(): string;
|
|
4
|
-
};
|
|
5
|
-
export type ITextQuery = ITextQueryFragment[];
|
|
6
|
-
export type IStringTransformer = (s: string) => string;
|
|
7
|
-
export type ISqlMethodTransformer = (compiler: QueryCompiler, method: string, args: string[]) => string;
|
|
8
|
-
export declare class QueryParameter {
|
|
9
|
-
name: () => string;
|
|
10
|
-
static create(name: () => string): QueryParameter;
|
|
11
|
-
constructor(name: () => string);
|
|
12
|
-
toString(): string;
|
|
13
|
-
}
|
|
14
|
-
export declare const expandParamArray: ({ sep, input, prefix, suffix, emptyResult, fx }: {
|
|
15
|
-
sep?: string;
|
|
16
|
-
input: any;
|
|
17
|
-
prefix?: any[];
|
|
18
|
-
suffix?: any[];
|
|
19
|
-
emptyResult?: string[];
|
|
20
|
-
fx?: (xi: any) => (() => any)[];
|
|
21
|
-
}) => any;
|
|
22
|
-
export declare const joinMap: (sep: string, input: any, a: any, fx?: ((item: any) => any)) => any[];
|
|
23
|
-
export declare const prepareAny: (a: TemplateStringsArray, ...p: any[]) => string[];
|
|
24
|
-
export declare const prepare: (a: TemplateStringsArray, ...p: (ITextQueryFragment | ITextQuery)[]) => ITextQuery;
|
|
25
|
-
export declare const prepareJoin: (a: (ITextQueryFragment | ITextQuery)[], sep?: string) => ITextQuery;
|
|
26
|
-
export declare const joinAny: (...a: any[]) => any;
|
|
27
|
-
//# sourceMappingURL=IStringTransformer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IStringTransformer.d.ts","sourceRoot":"","sources":["../../../src/query/ast/IStringTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,iCAAiC,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,GAAG;IAAE,QAAQ,IAAI,MAAM,CAAA;CAAE,CAAC;AACrF,MAAM,MAAM,UAAU,GAAG,kBAAkB,EAAE,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;AAExG,qBAAa,cAAc;IAMJ,IAAI,EAAE,MAAM,MAAM;IAJrC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,MAAM;gBAIb,IAAI,EAAE,MAAM,MAAM;IAErC,QAAQ;CAGX;AAED,eAAO,MAAM,gBAAgB,GAAI;;;;;;;CAOhC,KAqBK,GAAG,CAAC;AAGV,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,EAAE,UAAK,EAAE,GAAG,GAAG,EAAE,KAAI,CAAC,CAAC,IAAI,KAAA,KAAK,GAAG,CAAsB,UAe3F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,GAAG,oBAAoB,EAAE,GAAG,GAAI,GAAG,EAAE,KAAG,MAAM,EAexE,CAAC;AAyBF,eAAO,MAAM,OAAO,GAAI,GAAG,oBAAoB,EAAE,GAAG,GAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC,EAAE,KAAG,UAY7F,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,GAAG,CAAC,kBAAkB,GAAG,UAAU,CAAC,EAAE,EAAE,MAAK,MAAY,KAAG,UAavF,CAAC;AAEF,eAAO,MAAM,OAAO,EAAkB,CAAC,GAAI,CAAC,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type EntityType from "../../entity-query/EntityType.js";
|
|
2
|
-
import type { ParameterExpression, SelectStatement } from "./Expressions.js";
|
|
3
|
-
export interface IMappingModel {
|
|
4
|
-
parameter: ParameterExpression;
|
|
5
|
-
selectStatement?: SelectStatement;
|
|
6
|
-
name?: string;
|
|
7
|
-
model?: EntityType;
|
|
8
|
-
replace?: ParameterExpression;
|
|
9
|
-
isRuntimeParam?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* This class will provide scope for ever parameter along with type mapping, unique name and
|
|
13
|
-
* and replace parameter
|
|
14
|
-
*/
|
|
15
|
-
export default class ParameterScope {
|
|
16
|
-
private map;
|
|
17
|
-
private names;
|
|
18
|
-
get(p: ParameterExpression): IMappingModel;
|
|
19
|
-
nameOf(p: ParameterExpression): string;
|
|
20
|
-
alias(originalParameter: ParameterExpression, alias: ParameterExpression, selectStatement: SelectStatement): void;
|
|
21
|
-
create(model: IMappingModel): void;
|
|
22
|
-
createName(prefix: string, name?: string): string;
|
|
23
|
-
delete(param1: ParameterExpression): void;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=ParameterScope.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterScope.d.ts","sourceRoot":"","sources":["../../../src/query/ast/ParameterScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAG7E,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,mBAAmB,CAAC;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc;IAE/B,OAAO,CAAC,GAAG,CAAqD;IAEhE,OAAO,CAAC,KAAK,CAA0B;IAEhC,GAAG,CAAC,CAAC,EAAE,mBAAmB;IAK1B,MAAM,CAAC,CAAC,EAAE,mBAAmB;IAM7B,KAAK,CACR,iBAAiB,EAAE,mBAAmB,EACtC,KAAK,EAAE,mBAAmB,EAC1B,eAAe,EAAE,eAAe;IAWpC,MAAM,CAAC,KAAK,EAAE,aAAa;IAyB3B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAoBjD,MAAM,CAAC,MAAM,EAAE,mBAAmB;CAIrC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Expression } from "./Expressions.js";
|
|
2
|
-
export default class ReplaceParameter {
|
|
3
|
-
static replace<T>(tree: T, from: Expression, to: Expression): T;
|
|
4
|
-
static replace<T>(tree: T[], from: Expression, to: Expression): T[];
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=ReplaceParameter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReplaceParameter.d.ts","sourceRoot":"","sources":["../../../src/query/ast/ReplaceParameter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,gBAAgB;WAEnB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,GAAG,CAAC;WACxD,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,GAAG,CAAC,EAAE;CAqC7E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SqlLiteral.d.ts","sourceRoot":"","sources":["../../../src/query/ast/SqlLiteral.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM;CAuBnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../src/query/ast/Types.ts"],"names":[],"mappings":""}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ArrayExpression, ArrowFunctionExpression, BigIntLiteral, BinaryExpression, BooleanLiteral, CallExpression, CoalesceExpression, ConditionalExpression, Constant, DeleteStatement, ExistsExpression, Expression, ExpressionAs, Identifier, InsertStatement, JoinExpression, MemberExpression, UpsertStatement, NewObjectExpression, NotExits, NullExpression, NumberLiteral, OrderByExpression, ParameterExpression, ReturnUpdated, SelectStatement, StringLiteral, TableLiteral, TemplateElement, TemplateLiteral, UnionStatement, UpdateStatement, ValuesStatement, NotExpression, BracketExpression, NegateExpression } from "./Expressions.js";
|
|
2
|
-
export default abstract class Visitor<T = any> {
|
|
3
|
-
visit(e1: Expression): T;
|
|
4
|
-
visitNegateExpression(e: NegateExpression): T;
|
|
5
|
-
visitBracketExpression(e: BracketExpression): T;
|
|
6
|
-
visitNotExpression(e: NotExpression): T;
|
|
7
|
-
visitUpsertStatement(e: UpsertStatement): T;
|
|
8
|
-
visitUnionStatement(e: UnionStatement): T;
|
|
9
|
-
visitNotExists(e: NotExits): T;
|
|
10
|
-
visitArrayExpression(e: ArrayExpression): T;
|
|
11
|
-
visitParameterExpression(e: ParameterExpression): T;
|
|
12
|
-
visitTemplateElement(e: TemplateElement): T;
|
|
13
|
-
visitNewObjectExpression(e: NewObjectExpression): T;
|
|
14
|
-
visitConditionalExpression(e: ConditionalExpression): T;
|
|
15
|
-
visitArrowFunctionExpression(e: ArrowFunctionExpression): T;
|
|
16
|
-
visitExistsExpression(e: ExistsExpression): T;
|
|
17
|
-
visitCoalesceExpression(e: CoalesceExpression): T;
|
|
18
|
-
visitIdentifier(e: Identifier): T;
|
|
19
|
-
visitCallExpression(e: CallExpression): T;
|
|
20
|
-
visitMemberExpression(e: MemberExpression): T;
|
|
21
|
-
visitTemplateLiteral(e: TemplateLiteral): T;
|
|
22
|
-
visitStringLiteral(e: StringLiteral): T;
|
|
23
|
-
visitNumberLiteral(e: NumberLiteral): T;
|
|
24
|
-
visitBooleanLiteral(e: BooleanLiteral): T;
|
|
25
|
-
visitBigIntLiteral(e: BigIntLiteral): T;
|
|
26
|
-
visitNullExpression(e: NullExpression): T;
|
|
27
|
-
visitJoinExpression(e: JoinExpression): T;
|
|
28
|
-
visitOrderByExpression(e: OrderByExpression): T;
|
|
29
|
-
visitReturnUpdated(e: ReturnUpdated): T;
|
|
30
|
-
visitDeleteStatement(e: DeleteStatement): T;
|
|
31
|
-
visitUpdateStatement(e: UpdateStatement): T;
|
|
32
|
-
visitBinaryExpression(e: BinaryExpression): T;
|
|
33
|
-
visitValuesStatement(e: ValuesStatement): T;
|
|
34
|
-
visitTableLiteral(e: TableLiteral): T;
|
|
35
|
-
visitSelectStatement(e: SelectStatement): T;
|
|
36
|
-
visitExpressionAs(e: ExpressionAs): T;
|
|
37
|
-
visitConstant(e: Constant): T;
|
|
38
|
-
visitInsertStatement(e: InsertStatement): T;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=Visitor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Visitor.d.ts","sourceRoot":"","sources":["../../../src/query/ast/Visitor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAkB,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG1oB,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,OAAO,CAAC,CAAC,GAAG,GAAG;IAEzC,KAAK,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC;IAgFxB,qBAAqB,CAAC,CAAC,EAAE,gBAAgB,GAAG,CAAC;IAG7C,sBAAsB,CAAC,CAAC,EAAE,iBAAiB,GAAG,CAAC;IAG/C,kBA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a,GAAG,CAAC;IAIvC,oBAAoB,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC;IAI3C,oBAAoB,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC;IAI3C,qBAAqB,CAAC,CAAC,EAAE,gBAAgB,GAAG,CAAC;IAI7C,oBAAoB,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC;IAI3C,iBAAiB,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC;IAIrC,oBAAoB,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC;IAI3C,iBAAiB,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC;IAIrC,aAAa,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC;IAI7B,oBAAoB,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC;CAI9C"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import EntityType from "../../entity-query/EntityType.js";
|
|
2
|
-
import EntityContext from "../../model/EntityContext.js";
|
|
3
|
-
import { ExpressionType, SelectStatement } from "../ast/Expressions.js";
|
|
4
|
-
export declare class QueryExpander {
|
|
5
|
-
private context;
|
|
6
|
-
static expand(context: EntityContext, select: SelectStatement, p: any, filter: boolean): SelectStatement[];
|
|
7
|
-
private include;
|
|
8
|
-
private included;
|
|
9
|
-
constructor(context: EntityContext, select: SelectStatement, filter: boolean);
|
|
10
|
-
expandNode(key: string, parent: SelectStatement, model: EntityType, node: ExpressionType): [string, SelectStatement, EntityType];
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=QueryExpander.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryExpander.d.ts","sourceRoot":"","sources":["../../../src/query/expander/QueryExpander.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,OAAO,aAAa,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAuC,cAAc,EAAkB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7H,qBAAa,aAAa;IAalB,OAAO,CAAC,OAAO;IAZnB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,KAAA,EAAE,MAAM,EAAE,OAAO;IAOjF,OAAO,CAAC,OAAO,CAAyB;IAExC,OAAO,CAAC,QAAQ,CAA4D;gBAGhE,OAAO,EAAE,aAAa,EAC9B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,OAAO;IAKnB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,CAAC;CAsNnI"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { BinaryExpression, BooleanLiteral, CallExpression, CoalesceExpression, Constant, Expression, MemberExpression, NullExpression, NumberLiteral, ParameterExpression, StringLiteral, TemplateLiteral } from "../ast/Expressions.js";
|
|
2
|
-
import { BabelVisitor } from "./BabelVisitor.js";
|
|
3
|
-
import * as bpe from "@babel/types";
|
|
4
|
-
export default class ArrowToExpression extends BabelVisitor<Expression> {
|
|
5
|
-
private targetStack;
|
|
6
|
-
target: ParameterExpression;
|
|
7
|
-
/**
|
|
8
|
-
* Parses lambda expression function or string to set simple SQL ready AST which
|
|
9
|
-
* transforms basic && to AND etc.
|
|
10
|
-
* @param fx function code (usually lambda expression)
|
|
11
|
-
* @param target parameter target
|
|
12
|
-
* @returns Parsed expression
|
|
13
|
-
*/
|
|
14
|
-
static transform(fx: (x: any, p: any) => any, target?: ParameterExpression, outerParameter?: ParameterExpression): {
|
|
15
|
-
params: ParameterExpression[];
|
|
16
|
-
body: Expression;
|
|
17
|
-
target: ParameterExpression;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Since expression parsed as a different parameter in nested lambda (x, p) => x..,
|
|
21
|
-
* we need to replace x with provided target to bind x with respective ParameterExpression.
|
|
22
|
-
* As ParameterExpression contains the type and model associated with the table represented by `x`.
|
|
23
|
-
* @param node parsed node
|
|
24
|
-
* @param target parameter to replace
|
|
25
|
-
* @returns transformed node
|
|
26
|
-
*/
|
|
27
|
-
private static transformUncached;
|
|
28
|
-
readonly leftJoins: string[];
|
|
29
|
-
protected constructor(targetStack: Map<string, any>, target: ParameterExpression, targetName: string);
|
|
30
|
-
visitBigIntLiteral({ value }: bpe.BigIntLiteral): Constant;
|
|
31
|
-
visitBooleanLiteral({ value }: bpe.BooleanLiteral): BooleanLiteral;
|
|
32
|
-
visitDecimalLiteral({ value }: bpe.DecimalLiteral): Constant;
|
|
33
|
-
visitNullLiteral(node: bpe.NullLiteral): NullExpression;
|
|
34
|
-
visitStringLiteral({ value }: bpe.StringLiteral): StringLiteral;
|
|
35
|
-
visitNumericLiteral({ value }: bpe.NumericLiteral): NumberLiteral;
|
|
36
|
-
visitUnaryExpression(node: bpe.UnaryExpression): Expression;
|
|
37
|
-
visitTemplateLiteral(node: bpe.TemplateLiteral): StringLiteral | TemplateLiteral;
|
|
38
|
-
visitTemplateElement(node: bpe.TemplateElement): Expression;
|
|
39
|
-
visitLogicalExpression(node: bpe.LogicalExpression): Expression;
|
|
40
|
-
visitArrayExpression(node: bpe.ArrayExpression): Expression;
|
|
41
|
-
visitBinaryExpression(node: bpe.BinaryExpression): BinaryExpression;
|
|
42
|
-
visitCallExpression({ callee, arguments: args }: bpe.CallExpression): CallExpression | CoalesceExpression;
|
|
43
|
-
/**
|
|
44
|
-
* We need to change Sql.coll.sum(p.orders.map((o) => o.total)
|
|
45
|
-
* to
|
|
46
|
-
* p.orders.sum((o) => o.total) ?? 0
|
|
47
|
-
* @param ce
|
|
48
|
-
* @returns
|
|
49
|
-
*/
|
|
50
|
-
reAssignCollectionMethods(ce: CallExpression): CallExpression | CoalesceExpression;
|
|
51
|
-
visitIdentifier({ name: value }: bpe.Identifier): Expression;
|
|
52
|
-
visitMemberExpression({ object, property: key, computed }: bpe.MemberExpression): MemberExpression;
|
|
53
|
-
visitArrowFunctionExpression(node: bpe.ArrowFunctionExpression): Expression;
|
|
54
|
-
visitObjectExpression(node: bpe.ObjectExpression): Expression;
|
|
55
|
-
visitConditionalExpression(node: bpe.ConditionalExpression): Expression;
|
|
56
|
-
private sanitize;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=ArrowToExpression.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArrowToExpression.d.ts","sourceRoot":"","sources":["../../../src/query/parser/ArrowToExpression.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,gBAAgB,EAAE,cAAc,EAAqB,cAAc,EAAE,kBAAkB,EAAyB,QAAQ,EAAE,UAAU,EAA4B,gBAAgB,EAAwD,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5X,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAKpC,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,YAAY,CAAC,UAAU,CAAC;IA4G/D,OAAO,CAAC,WAAW;IACZ,MAAM,EAAE,mBAAmB;IA3GtC;;;;;;OAMG;WACW,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,GAAG,EAAE,MAAM,CAAC,EAAE,mBAAmB,EAAE,cAAc,CAAC,EAAE,mBAAmB;gBAeS,mBAAmB,EAAE;cAAQ,UAAU;gBAAU,mBAAmB;;IARpM;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IA+EhC,SAAgB,SAAS,EAAE,MAAM,EAAE,CAAM;IAIzC,SAAS,aACG,WAAW,EAAE,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,EAC7B,MAAM,EAAE,mBAAmB,EAClC,UAAU,EAAE,MAAM;IAYtB,kBAAk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G,CAAC,qBAAqB,GAAG,UAAU;IAQvE,OAAO,CAAC,QAAQ;CAqBnB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as bpe from "@babel/types";
|
|
2
|
-
export declare abstract class BabelVisitor<T> {
|
|
3
|
-
visit(node: bpe.Expression | bpe.Node): T;
|
|
4
|
-
visitArrayExpression(node: bpe.ArrayExpression): T;
|
|
5
|
-
abstract visitTemplateElement(node: bpe.TemplateElement): T;
|
|
6
|
-
visitObjectProperty(node: bpe.ObjectProperty): T;
|
|
7
|
-
abstract visitUnaryExpression(node: bpe.UnaryExpression): T;
|
|
8
|
-
abstract visitObjectExpression(node: bpe.ObjectExpression): T;
|
|
9
|
-
abstract visitMemberExpression(node: bpe.MemberExpression): T;
|
|
10
|
-
abstract visitLogicalExpression(node: bpe.LogicalExpression): T;
|
|
11
|
-
abstract visitIdentifier(node: bpe.Identifier): T;
|
|
12
|
-
abstract visitTemplateLiteral(node: bpe.TemplateLiteral): T;
|
|
13
|
-
abstract visitNumericLiteral(node: bpe.NumericLiteral): T;
|
|
14
|
-
abstract visitDecimalLiteral(node: bpe.DecimalLiteral): T;
|
|
15
|
-
abstract visitBooleanLiteral(node: bpe.BooleanLiteral): T;
|
|
16
|
-
abstract visitBigIntLiteral(node: bpe.BigIntLiteral): T;
|
|
17
|
-
abstract visitStringLiteral(node: bpe.StringLiteral): T;
|
|
18
|
-
abstract visitNullLiteral(node: bpe.NullLiteral): T;
|
|
19
|
-
abstract visitConditionalExpression(node: bpe.ConditionalExpression): T;
|
|
20
|
-
abstract visitArrowFunctionExpression(node: bpe.ArrowFunctionExpression): T;
|
|
21
|
-
abstract visitCallExpression(node: bpe.CallExpression): T;
|
|
22
|
-
abstract visitBinaryExpression(node: bpe.BinaryExpression): T;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=BabelVisitor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BabelVisitor.d.ts","sourceRoot":"","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CAAC,aAAa,GAAG,CAAC;IACvD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,WAAW,GAAG,CAAC;IACnD,QAAQ,CAAC,0BAA0B,CAAC,IAAI,EAAE,GAAG,CAAC,qBAAqB,GAAG,CAAC;IAEvE,QAAQ,CAAC,4BAA4B,CAAC,IAAI,EAAE,GAAG,CAAC,uBAAuB,GAAG,CAAC;IAE3E,QAAQ,CAAC,mBAAmB,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,GAAG,CAAC;IAEzD,QAAQ,CAAC,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,gBAAgB,GAAG,CAAC;CAChE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotSupportedError.d.ts","sourceRoot":"","sources":["../../../src/query/parser/NotSupportedError.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAElE,qBAAa,iBAAkB,SAAQ,iBAAiB;gBACxC,OAAO,CAAC,EAAE,MAAM;CAG/B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as bpe from "@babel/types";
|
|
2
|
-
import TransformVisitor from "./TransformVisitor.js";
|
|
3
|
-
/**
|
|
4
|
-
* This class will restructure code from
|
|
5
|
-
* 1. ({ a } => a) to (p => p.a)
|
|
6
|
-
* 2. Turning (Negate)(literal) to (-literal) .. changing sign
|
|
7
|
-
* 3. ((x) => (x.joinedTable.x ..) || (...)) to ((x) => (x.joinedTable?.x))
|
|
8
|
-
* `?.` will make join nullable and left join will be enforced.
|
|
9
|
-
*/
|
|
10
|
-
export default class Restructure extends TransformVisitor {
|
|
11
|
-
private map;
|
|
12
|
-
visitUnaryExpression(node: bpe.UnaryExpression): bpe.Node;
|
|
13
|
-
visitLogicalExpression(node: bpe.LogicalExpression): bpe.Node;
|
|
14
|
-
visitTemplateElement(node: bpe.TemplateElement): bpe.Node;
|
|
15
|
-
visitArrowFunctionExpression(node: bpe.ArrowFunctionExpression): bpe.Node;
|
|
16
|
-
visitIdentifier(node: bpe.Identifier): bpe.Node;
|
|
17
|
-
toIdentifier(x: bpe.Identifier | bpe.Pattern | bpe.RestElement): bpe.Identifier;
|
|
18
|
-
convertPattern(parentExp: bpe.Expression, x: bpe.ObjectPattern): void;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=Restructure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Restructure.d.ts","sourceRoot":"","sources":["../../../src/query/parser/Restructure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AAGrD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,gBAAgB;IAErD,OAAO,CAAC,GAAG,CAAoC;IAE/C,oBAAoB,CAAC,IAAI,EAAE,GAAG,CAAC,eAAe,GAAG,GAAG,CAAC,IAAI;IASzD,sBAAsB,CAAC,IAAI,EAAE,GAAG,CAAC,iBAAiB,GAAG,GAAG,CAAC,IAAI;IAQ7D,oBAAoB,CAAC,IAAI,EAAE,GAAG,CAAC,eAAe,GAAG,GAAG,CAAC,IAAI;IAIzD,4BAA4B,CAAC,IAAI,EAAE,GAAG,CAAC,uBAAuB,GAAG,GAAG,CAAC,IAAI;IAWzE,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,IAAI;IAI/C,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,UAAU;IAgB/E,cAAc,CAAC,SAAS,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,EAAE,GAAG,CAAC,aAAa;CAqBjE"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as bpe from "@babel/types";
|
|
2
|
-
import { BabelVisitor } from "./BabelVisitor.js";
|
|
3
|
-
export default class TransformVisitor extends BabelVisitor<bpe.Node> {
|
|
4
|
-
transform<T>(n: T): any;
|
|
5
|
-
visitTemplateElement(node: bpe.TemplateElement): bpe.Node;
|
|
6
|
-
visitObjectExpression(node: bpe.ObjectExpression): bpe.Node;
|
|
7
|
-
visitMemberExpression(node: bpe.MemberExpression): bpe.Node;
|
|
8
|
-
visitLogicalExpression(node: bpe.LogicalExpression): bpe.Node;
|
|
9
|
-
visitIdentifier(node: bpe.Identifier): bpe.Node;
|
|
10
|
-
visitTemplateLiteral(node: bpe.TemplateLiteral): bpe.Node;
|
|
11
|
-
visitNumericLiteral(node: bpe.NumericLiteral): bpe.Node;
|
|
12
|
-
visitDecimalLiteral(node: bpe.DecimalLiteral): bpe.Node;
|
|
13
|
-
visitBooleanLiteral(node: bpe.BooleanLiteral): bpe.Node;
|
|
14
|
-
visitBigIntLiteral(node: bpe.BigIntLiteral): bpe.Node;
|
|
15
|
-
visitStringLiteral(node: bpe.StringLiteral): bpe.Node;
|
|
16
|
-
visitNullLiteral(node: bpe.NullLiteral): bpe.Node;
|
|
17
|
-
visitConditionalExpression(node: bpe.ConditionalExpression): bpe.Node;
|
|
18
|
-
visitArrowFunctionExpression(node: bpe.ArrowFunctionExpression): bpe.Node;
|
|
19
|
-
visitCallExpression(node: bpe.CallExpression): bpe.Node;
|
|
20
|
-
visitBinaryExpression(node: bpe.BinaryExpression): bpe.Node;
|
|
21
|
-
visitUnaryExpression(node: bpe.UnaryExpression): bpe.Node;
|
|
22
|
-
visitObjectProperty(node: bpe.ObjectProperty): bpe.Node;
|
|
23
|
-
visitArrayExpression(node: bpe.ArrayExpression): bpe.Node;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=TransformVisitor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransformVisitor.d.ts","sourceRoot":"","sources":["../../../src/query/parser/TransformVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,KA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