data-finder-ts 0.1.0 → 0.1.4
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/README.md +17 -55
- package/dist/chunk-4JVW4TAB.js +180 -0
- package/dist/chunk-4JVW4TAB.js.map +1 -0
- package/dist/chunk-4LNZV6EN.js +500 -0
- package/dist/chunk-4LNZV6EN.js.map +1 -0
- package/dist/chunk-FJYA2ASS.js +136 -0
- package/dist/chunk-FJYA2ASS.js.map +1 -0
- package/dist/chunk-FLEIUDZZ.js +14 -0
- package/dist/chunk-FLEIUDZZ.js.map +1 -0
- package/dist/chunk-MH4XMYVB.js +696 -0
- package/dist/chunk-MH4XMYVB.js.map +1 -0
- package/dist/chunk-PMPLCEWQ.js +90 -0
- package/dist/chunk-PMPLCEWQ.js.map +1 -0
- package/dist/chunk-UYMOE6YU.js +509 -0
- package/dist/chunk-UYMOE6YU.js.map +1 -0
- package/dist/datafinder/attribute.cjs +320 -0
- package/dist/datafinder/attribute.cjs.map +1 -0
- package/dist/datafinder/attribute.d.cts +86 -0
- package/dist/datafinder/attribute.d.ts +86 -0
- package/dist/datafinder/attribute.js +8 -0
- package/dist/datafinder/attribute.js.map +1 -0
- package/dist/datafinder/finder-registry.cjs +39 -0
- package/dist/datafinder/finder-registry.cjs.map +1 -0
- package/dist/datafinder/finder-registry.d.cts +4 -0
- package/dist/datafinder/finder-registry.d.ts +4 -0
- package/dist/datafinder/finder-registry.js +9 -0
- package/dist/datafinder/finder-registry.js.map +1 -0
- package/dist/datafinder/runner.cjs +1595 -0
- package/dist/datafinder/runner.cjs.map +1 -0
- package/dist/datafinder/runner.d.cts +44 -0
- package/dist/datafinder/runner.d.ts +44 -0
- package/dist/datafinder/runner.js +26 -0
- package/dist/datafinder/runner.js.map +1 -0
- package/dist/datafinder/sql-generator.cjs +1467 -0
- package/dist/datafinder/sql-generator.cjs.map +1 -0
- package/dist/datafinder/sql-generator.d.cts +8 -0
- package/dist/datafinder/sql-generator.d.ts +8 -0
- package/dist/datafinder/sql-generator.js +15 -0
- package/dist/datafinder/sql-generator.js.map +1 -0
- package/dist/datafinder/typed-attributes.cjs +909 -0
- package/dist/datafinder/typed-attributes.cjs.map +1 -0
- package/dist/datafinder/typed-attributes.d.cts +242 -0
- package/dist/datafinder/typed-attributes.d.ts +242 -0
- package/dist/datafinder/typed-attributes.js +25 -0
- package/dist/datafinder/typed-attributes.js.map +1 -0
- package/dist/index.cjs +2153 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +28 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +199 -0
- package/dist/index.js.map +1 -0
- package/dist/model/milestoning.cjs +145 -0
- package/dist/model/milestoning.cjs.map +1 -0
- package/dist/model/milestoning.d.cts +40 -0
- package/dist/model/milestoning.d.ts +40 -0
- package/dist/model/milestoning.js +18 -0
- package/dist/model/milestoning.js.map +1 -0
- package/dist/model/relational.cjs +579 -0
- package/dist/model/relational.cjs.map +1 -0
- package/dist/model/relational.d.cts +291 -0
- package/dist/model/relational.d.ts +291 -0
- package/dist/model/relational.js +99 -0
- package/dist/model/relational.js.map +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
declare enum ComparisonOperator {
|
|
2
|
+
EQUAL = "EQUAL",
|
|
3
|
+
NOT_EQUAL = "NOT_EQUAL",
|
|
4
|
+
LESS_THAN = "LESS_THAN",
|
|
5
|
+
GREATER_THAN = "GREATER_THAN",
|
|
6
|
+
LESS_THAN_OR_EQUAL_TO = "LESS_THAN_OR_EQUAL_TO",
|
|
7
|
+
GREATER_THAN_OR_EQUAL_TO = "GREATER_THAN_OR_EQUAL_TO",
|
|
8
|
+
LIKE = "LIKE",
|
|
9
|
+
NOT_LIKE = "NOT_LIKE"
|
|
10
|
+
}
|
|
11
|
+
declare enum LogicalOperator {
|
|
12
|
+
AND = "AND",
|
|
13
|
+
OR = "OR"
|
|
14
|
+
}
|
|
15
|
+
declare enum AggregateOperator {
|
|
16
|
+
COUNT = "COUNT",
|
|
17
|
+
SUM = "SUM",
|
|
18
|
+
MIN = "MIN",
|
|
19
|
+
MAX = "MAX",
|
|
20
|
+
AVERAGE = "AVERAGE"
|
|
21
|
+
}
|
|
22
|
+
declare enum ScalarFunction {
|
|
23
|
+
ABS = "ABS",
|
|
24
|
+
CEILING = "CEILING",
|
|
25
|
+
FLOOR = "FLOOR",
|
|
26
|
+
MOD = "MOD",
|
|
27
|
+
POWER = "POWER",
|
|
28
|
+
SQRT = "SQRT",
|
|
29
|
+
ROUND = "ROUND",
|
|
30
|
+
UPPER = "UPPER",
|
|
31
|
+
LOWER = "LOWER",
|
|
32
|
+
TRIM = "TRIM",
|
|
33
|
+
LTRIM = "LTRIM",
|
|
34
|
+
RTRIM = "RTRIM",
|
|
35
|
+
LENGTH = "LENGTH",
|
|
36
|
+
REVERSE = "REVERSE",
|
|
37
|
+
LEFT = "LEFT",
|
|
38
|
+
RIGHT = "RIGHT",
|
|
39
|
+
REPEAT = "REPEAT",
|
|
40
|
+
REPLACE = "REPLACE",
|
|
41
|
+
SUBSTRING = "SUBSTRING"
|
|
42
|
+
}
|
|
43
|
+
declare enum DatePart {
|
|
44
|
+
YEAR = "YEAR",
|
|
45
|
+
MONTH = "MONTH",
|
|
46
|
+
DAY = "DAY",
|
|
47
|
+
HOUR = "HOUR",
|
|
48
|
+
MINUTE = "MINUTE",
|
|
49
|
+
SECOND = "SECOND",
|
|
50
|
+
QUARTER = "QUARTER",
|
|
51
|
+
WEEK = "WEEK",
|
|
52
|
+
DOW = "DOW"
|
|
53
|
+
}
|
|
54
|
+
declare enum SortDirection {
|
|
55
|
+
ASC = "ASC",
|
|
56
|
+
DESC = "DESC"
|
|
57
|
+
}
|
|
58
|
+
declare abstract class RelationalOperationElement {
|
|
59
|
+
}
|
|
60
|
+
declare abstract class Operation extends RelationalOperationElement {
|
|
61
|
+
andOp(other: RelationalOperationElement): Operation;
|
|
62
|
+
}
|
|
63
|
+
declare class NoOperation extends Operation {
|
|
64
|
+
andOp(other: RelationalOperationElement): Operation;
|
|
65
|
+
}
|
|
66
|
+
declare abstract class ConstantOperation extends RelationalOperationElement {
|
|
67
|
+
}
|
|
68
|
+
declare class IntegerConstantOperation extends ConstantOperation {
|
|
69
|
+
readonly value: number;
|
|
70
|
+
constructor(value: number);
|
|
71
|
+
}
|
|
72
|
+
declare class FloatConstantOperation extends ConstantOperation {
|
|
73
|
+
readonly value: number;
|
|
74
|
+
constructor(value: number);
|
|
75
|
+
}
|
|
76
|
+
declare class StringConstantOperation extends ConstantOperation {
|
|
77
|
+
readonly value: string;
|
|
78
|
+
constructor(value: string);
|
|
79
|
+
}
|
|
80
|
+
declare class DateConstantOperation extends ConstantOperation {
|
|
81
|
+
readonly value: Date;
|
|
82
|
+
constructor(value: Date);
|
|
83
|
+
}
|
|
84
|
+
declare class DateTimeConstantOperation extends ConstantOperation {
|
|
85
|
+
readonly value: Date;
|
|
86
|
+
constructor(value: Date);
|
|
87
|
+
}
|
|
88
|
+
declare class DecimalConstantOperation extends ConstantOperation {
|
|
89
|
+
readonly value: number;
|
|
90
|
+
constructor(value: number);
|
|
91
|
+
}
|
|
92
|
+
declare class BooleanConstantOperation extends ConstantOperation {
|
|
93
|
+
readonly value: boolean;
|
|
94
|
+
constructor(value: boolean);
|
|
95
|
+
}
|
|
96
|
+
declare abstract class UnaryOperation extends Operation {
|
|
97
|
+
readonly element: RelationalOperationElement;
|
|
98
|
+
constructor(element: RelationalOperationElement);
|
|
99
|
+
}
|
|
100
|
+
declare abstract class BinaryOperation extends Operation {
|
|
101
|
+
readonly left: RelationalOperationElement;
|
|
102
|
+
readonly right: RelationalOperationElement;
|
|
103
|
+
constructor(left: RelationalOperationElement, right: RelationalOperationElement);
|
|
104
|
+
}
|
|
105
|
+
declare class IsNullOperation extends UnaryOperation {
|
|
106
|
+
}
|
|
107
|
+
declare class IsNotNullOperation extends UnaryOperation {
|
|
108
|
+
}
|
|
109
|
+
declare class ComparisonOperation extends BinaryOperation {
|
|
110
|
+
readonly operator: ComparisonOperator;
|
|
111
|
+
constructor(left: RelationalOperationElement, operator: ComparisonOperator, right: RelationalOperationElement);
|
|
112
|
+
}
|
|
113
|
+
declare class LogicalOperation extends BinaryOperation {
|
|
114
|
+
readonly operator: LogicalOperator;
|
|
115
|
+
constructor(left: RelationalOperationElement, operator: LogicalOperator, right: RelationalOperationElement);
|
|
116
|
+
}
|
|
117
|
+
declare class WindowSpecification {
|
|
118
|
+
readonly partitionBy: RelationalOperationElement[];
|
|
119
|
+
readonly orderBy: SortOperation[];
|
|
120
|
+
constructor(partitionBy?: RelationalOperationElement[], orderBy?: SortOperation[]);
|
|
121
|
+
}
|
|
122
|
+
declare class AggregateOperation extends UnaryOperation {
|
|
123
|
+
readonly operator: AggregateOperator;
|
|
124
|
+
readonly displayName?: string | undefined;
|
|
125
|
+
readonly window?: WindowSpecification | undefined;
|
|
126
|
+
constructor(element: RelationalOperationElement, operator: AggregateOperator, displayName?: string | undefined, window?: WindowSpecification | undefined);
|
|
127
|
+
over(partitionBy?: RelationalOperationElement[], orderBy?: SortOperation[]): AggregateOperation;
|
|
128
|
+
}
|
|
129
|
+
declare enum WindowFunction {
|
|
130
|
+
ROW_NUMBER = "ROW_NUMBER",
|
|
131
|
+
RANK = "RANK",
|
|
132
|
+
DENSE_RANK = "DENSE_RANK",
|
|
133
|
+
NTILE = "NTILE",
|
|
134
|
+
LAG = "LAG",
|
|
135
|
+
LEAD = "LEAD",
|
|
136
|
+
FIRST_VALUE = "FIRST_VALUE",
|
|
137
|
+
LAST_VALUE = "LAST_VALUE",
|
|
138
|
+
CUME_DIST = "CUME_DIST",
|
|
139
|
+
PERCENT_RANK = "PERCENT_RANK"
|
|
140
|
+
}
|
|
141
|
+
declare class WindowFunctionOperation extends UnaryOperation {
|
|
142
|
+
readonly func: WindowFunction;
|
|
143
|
+
readonly displayName?: string | undefined;
|
|
144
|
+
readonly secondArg?: number | undefined;
|
|
145
|
+
readonly extraArgs: (string | number)[];
|
|
146
|
+
readonly window?: WindowSpecification | undefined;
|
|
147
|
+
constructor(element: RelationalOperationElement | null, func: WindowFunction, displayName?: string | undefined, secondArg?: number | undefined, extraArgs?: (string | number)[], window?: WindowSpecification | undefined);
|
|
148
|
+
over(partitionBy?: RelationalOperationElement[], orderBy?: SortOperation[]): WindowFunctionOperation;
|
|
149
|
+
}
|
|
150
|
+
declare class ScalarFunctionOperation extends UnaryOperation {
|
|
151
|
+
readonly func: ScalarFunction;
|
|
152
|
+
readonly displayName?: string | undefined;
|
|
153
|
+
readonly secondArg?: number | undefined;
|
|
154
|
+
readonly extraArgs: (string | number)[];
|
|
155
|
+
constructor(element: RelationalOperationElement, func: ScalarFunction, displayName?: string | undefined, secondArg?: number | undefined, extraArgs?: (string | number)[]);
|
|
156
|
+
}
|
|
157
|
+
declare class DateExtractOperation extends UnaryOperation {
|
|
158
|
+
readonly part: DatePart;
|
|
159
|
+
readonly displayName?: string | undefined;
|
|
160
|
+
constructor(element: RelationalOperationElement, part: DatePart, displayName?: string | undefined);
|
|
161
|
+
}
|
|
162
|
+
declare class DateArithmeticOperation extends UnaryOperation {
|
|
163
|
+
readonly n: number;
|
|
164
|
+
readonly unit: DatePart;
|
|
165
|
+
readonly isAdd: boolean;
|
|
166
|
+
readonly displayName?: string | undefined;
|
|
167
|
+
constructor(element: RelationalOperationElement, n: number, unit: DatePart, isAdd?: boolean, displayName?: string | undefined);
|
|
168
|
+
}
|
|
169
|
+
declare class DateDiffOperation extends UnaryOperation {
|
|
170
|
+
readonly other: Date;
|
|
171
|
+
readonly unit: DatePart;
|
|
172
|
+
readonly displayName?: string | undefined;
|
|
173
|
+
constructor(element: RelationalOperationElement, other: Date, unit: DatePart, displayName?: string | undefined);
|
|
174
|
+
}
|
|
175
|
+
declare class Column extends RelationalOperationElement {
|
|
176
|
+
readonly name: string;
|
|
177
|
+
readonly type: string;
|
|
178
|
+
readonly owner?: string | undefined;
|
|
179
|
+
readonly primaryKey: boolean;
|
|
180
|
+
table?: Table;
|
|
181
|
+
constructor(name: string, type: string, owner?: string | undefined, primaryKey?: boolean);
|
|
182
|
+
}
|
|
183
|
+
declare class ForeignKey {
|
|
184
|
+
readonly column: Column;
|
|
185
|
+
readonly references: Column;
|
|
186
|
+
constructor(column: Column, references: Column);
|
|
187
|
+
}
|
|
188
|
+
declare abstract class DataStore {
|
|
189
|
+
readonly name: string;
|
|
190
|
+
readonly schemas: Schema[];
|
|
191
|
+
constructor(name: string);
|
|
192
|
+
abstract namespace(schemaName: string): string;
|
|
193
|
+
}
|
|
194
|
+
declare class Database extends DataStore {
|
|
195
|
+
readonly location?: string | undefined;
|
|
196
|
+
constructor(name: string, location?: string | undefined);
|
|
197
|
+
namespace(schemaName: string): string;
|
|
198
|
+
}
|
|
199
|
+
declare class DataCatalog extends DataStore {
|
|
200
|
+
constructor(name: string);
|
|
201
|
+
namespace(schemaName: string): string;
|
|
202
|
+
}
|
|
203
|
+
declare class Schema {
|
|
204
|
+
readonly name: string;
|
|
205
|
+
readonly datastore?: DataStore | undefined;
|
|
206
|
+
readonly tables: Table[];
|
|
207
|
+
constructor(name: string, datastore?: DataStore | undefined);
|
|
208
|
+
}
|
|
209
|
+
declare class Table {
|
|
210
|
+
readonly name: string;
|
|
211
|
+
readonly schema?: Schema | undefined;
|
|
212
|
+
private readonly _columnsByName;
|
|
213
|
+
readonly foreignKeys: ForeignKey[];
|
|
214
|
+
constructor(name: string, columns: Column[], schema?: Schema | undefined);
|
|
215
|
+
get columns(): Column[];
|
|
216
|
+
get qualifiedName(): string;
|
|
217
|
+
}
|
|
218
|
+
declare class JoinOperation {
|
|
219
|
+
readonly name: string;
|
|
220
|
+
readonly target: Table;
|
|
221
|
+
readonly left: Column;
|
|
222
|
+
readonly right: Column;
|
|
223
|
+
filter?: RelationalOperationElement;
|
|
224
|
+
/** Property-equality filters on the join target (property id -> value), set by a related finder given a filter. */
|
|
225
|
+
filterKwargs: Record<string, unknown>;
|
|
226
|
+
/** Maps property ids to [column, type, table] for `filterKwargs`. */
|
|
227
|
+
filterColumnMap: Record<string, [string, string, string]>;
|
|
228
|
+
constructor(name: string, target: Table, left: Column, right: Column, filter?: RelationalOperationElement);
|
|
229
|
+
}
|
|
230
|
+
declare class JoinTreeNodeOperation {
|
|
231
|
+
readonly join: JoinOperation;
|
|
232
|
+
readonly parent?: JoinTreeNodeOperation | undefined;
|
|
233
|
+
constructor(join: JoinOperation, parent?: JoinTreeNodeOperation | undefined);
|
|
234
|
+
}
|
|
235
|
+
declare class ColumnWithJoin extends RelationalOperationElement {
|
|
236
|
+
readonly column: Column;
|
|
237
|
+
readonly parent?: JoinTreeNodeOperation | undefined;
|
|
238
|
+
readonly embedded?: ColumnWithJoin | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* `embedded` is an alternate reference to a flat (denormalized) column on the owning table that
|
|
241
|
+
* holds the same value without the join; the SQL generator uses it when the join can be elided.
|
|
242
|
+
*/
|
|
243
|
+
constructor(column: Column, parent?: JoinTreeNodeOperation | undefined, embedded?: ColumnWithJoin | undefined);
|
|
244
|
+
}
|
|
245
|
+
declare class SortOperation {
|
|
246
|
+
readonly column: ColumnWithJoin;
|
|
247
|
+
readonly direction: SortDirection;
|
|
248
|
+
constructor(column: ColumnWithJoin, direction: SortDirection);
|
|
249
|
+
}
|
|
250
|
+
declare class CountAllOperation extends RelationalOperationElement {
|
|
251
|
+
readonly table: string;
|
|
252
|
+
constructor(table: string);
|
|
253
|
+
}
|
|
254
|
+
declare class Alias extends RelationalOperationElement {
|
|
255
|
+
readonly element: RelationalOperationElement;
|
|
256
|
+
readonly name: string;
|
|
257
|
+
constructor(element: RelationalOperationElement, name: string);
|
|
258
|
+
}
|
|
259
|
+
/** Returned by `RelatedFinder.exists()`. A backend translates it to a join-presence check. */
|
|
260
|
+
declare class ExistsOperation extends RelationalOperationElement {
|
|
261
|
+
readonly node: JoinTreeNodeOperation;
|
|
262
|
+
constructor(node: JoinTreeNodeOperation);
|
|
263
|
+
andOp(other: RelationalOperationElement): LogicalOperation;
|
|
264
|
+
}
|
|
265
|
+
/** Returned by `RelatedFinder.notExists()`. A backend translates it to a join-absence check. */
|
|
266
|
+
declare class NotExistsOperation extends RelationalOperationElement {
|
|
267
|
+
readonly node: JoinTreeNodeOperation;
|
|
268
|
+
constructor(node: JoinTreeNodeOperation);
|
|
269
|
+
andOp(other: RelationalOperationElement): LogicalOperation;
|
|
270
|
+
}
|
|
271
|
+
declare class SelectOperation {
|
|
272
|
+
readonly display: RelationalOperationElement[];
|
|
273
|
+
readonly filter: RelationalOperationElement;
|
|
274
|
+
readonly orderBy: SortOperation[];
|
|
275
|
+
readonly groupBy: RelationalOperationElement[];
|
|
276
|
+
readonly limit?: number | undefined;
|
|
277
|
+
readonly table?: Table | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* Extra ON conditions for this query's joins (milestoning and property filters), keyed by join node.
|
|
280
|
+
* Held here rather than on the shared JoinOperation, so queries that use the same node can't affect each other.
|
|
281
|
+
*/
|
|
282
|
+
readonly joinFilters: ReadonlyMap<JoinTreeNodeOperation, Operation>;
|
|
283
|
+
constructor(display: RelationalOperationElement[], filter: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: RelationalOperationElement[], limit?: number | undefined, table?: Table | undefined,
|
|
284
|
+
/**
|
|
285
|
+
* Extra ON conditions for this query's joins (milestoning and property filters), keyed by join node.
|
|
286
|
+
* Held here rather than on the shared JoinOperation, so queries that use the same node can't affect each other.
|
|
287
|
+
*/
|
|
288
|
+
joinFilters?: ReadonlyMap<JoinTreeNodeOperation, Operation>);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export { AggregateOperation, AggregateOperator, Alias, BinaryOperation, BooleanConstantOperation, Column, ColumnWithJoin, ComparisonOperation, ComparisonOperator, ConstantOperation, CountAllOperation, DataCatalog, DataStore, Database, DateArithmeticOperation, DateConstantOperation, DateDiffOperation, DateExtractOperation, DatePart, DateTimeConstantOperation, DecimalConstantOperation, ExistsOperation, FloatConstantOperation, ForeignKey, IntegerConstantOperation, IsNotNullOperation, IsNullOperation, JoinOperation, JoinTreeNodeOperation, LogicalOperation, LogicalOperator, NoOperation, NotExistsOperation, Operation, RelationalOperationElement, ScalarFunction, ScalarFunctionOperation, Schema, SelectOperation, SortDirection, SortOperation, StringConstantOperation, Table, UnaryOperation, WindowFunction, WindowFunctionOperation, WindowSpecification };
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
declare enum ComparisonOperator {
|
|
2
|
+
EQUAL = "EQUAL",
|
|
3
|
+
NOT_EQUAL = "NOT_EQUAL",
|
|
4
|
+
LESS_THAN = "LESS_THAN",
|
|
5
|
+
GREATER_THAN = "GREATER_THAN",
|
|
6
|
+
LESS_THAN_OR_EQUAL_TO = "LESS_THAN_OR_EQUAL_TO",
|
|
7
|
+
GREATER_THAN_OR_EQUAL_TO = "GREATER_THAN_OR_EQUAL_TO",
|
|
8
|
+
LIKE = "LIKE",
|
|
9
|
+
NOT_LIKE = "NOT_LIKE"
|
|
10
|
+
}
|
|
11
|
+
declare enum LogicalOperator {
|
|
12
|
+
AND = "AND",
|
|
13
|
+
OR = "OR"
|
|
14
|
+
}
|
|
15
|
+
declare enum AggregateOperator {
|
|
16
|
+
COUNT = "COUNT",
|
|
17
|
+
SUM = "SUM",
|
|
18
|
+
MIN = "MIN",
|
|
19
|
+
MAX = "MAX",
|
|
20
|
+
AVERAGE = "AVERAGE"
|
|
21
|
+
}
|
|
22
|
+
declare enum ScalarFunction {
|
|
23
|
+
ABS = "ABS",
|
|
24
|
+
CEILING = "CEILING",
|
|
25
|
+
FLOOR = "FLOOR",
|
|
26
|
+
MOD = "MOD",
|
|
27
|
+
POWER = "POWER",
|
|
28
|
+
SQRT = "SQRT",
|
|
29
|
+
ROUND = "ROUND",
|
|
30
|
+
UPPER = "UPPER",
|
|
31
|
+
LOWER = "LOWER",
|
|
32
|
+
TRIM = "TRIM",
|
|
33
|
+
LTRIM = "LTRIM",
|
|
34
|
+
RTRIM = "RTRIM",
|
|
35
|
+
LENGTH = "LENGTH",
|
|
36
|
+
REVERSE = "REVERSE",
|
|
37
|
+
LEFT = "LEFT",
|
|
38
|
+
RIGHT = "RIGHT",
|
|
39
|
+
REPEAT = "REPEAT",
|
|
40
|
+
REPLACE = "REPLACE",
|
|
41
|
+
SUBSTRING = "SUBSTRING"
|
|
42
|
+
}
|
|
43
|
+
declare enum DatePart {
|
|
44
|
+
YEAR = "YEAR",
|
|
45
|
+
MONTH = "MONTH",
|
|
46
|
+
DAY = "DAY",
|
|
47
|
+
HOUR = "HOUR",
|
|
48
|
+
MINUTE = "MINUTE",
|
|
49
|
+
SECOND = "SECOND",
|
|
50
|
+
QUARTER = "QUARTER",
|
|
51
|
+
WEEK = "WEEK",
|
|
52
|
+
DOW = "DOW"
|
|
53
|
+
}
|
|
54
|
+
declare enum SortDirection {
|
|
55
|
+
ASC = "ASC",
|
|
56
|
+
DESC = "DESC"
|
|
57
|
+
}
|
|
58
|
+
declare abstract class RelationalOperationElement {
|
|
59
|
+
}
|
|
60
|
+
declare abstract class Operation extends RelationalOperationElement {
|
|
61
|
+
andOp(other: RelationalOperationElement): Operation;
|
|
62
|
+
}
|
|
63
|
+
declare class NoOperation extends Operation {
|
|
64
|
+
andOp(other: RelationalOperationElement): Operation;
|
|
65
|
+
}
|
|
66
|
+
declare abstract class ConstantOperation extends RelationalOperationElement {
|
|
67
|
+
}
|
|
68
|
+
declare class IntegerConstantOperation extends ConstantOperation {
|
|
69
|
+
readonly value: number;
|
|
70
|
+
constructor(value: number);
|
|
71
|
+
}
|
|
72
|
+
declare class FloatConstantOperation extends ConstantOperation {
|
|
73
|
+
readonly value: number;
|
|
74
|
+
constructor(value: number);
|
|
75
|
+
}
|
|
76
|
+
declare class StringConstantOperation extends ConstantOperation {
|
|
77
|
+
readonly value: string;
|
|
78
|
+
constructor(value: string);
|
|
79
|
+
}
|
|
80
|
+
declare class DateConstantOperation extends ConstantOperation {
|
|
81
|
+
readonly value: Date;
|
|
82
|
+
constructor(value: Date);
|
|
83
|
+
}
|
|
84
|
+
declare class DateTimeConstantOperation extends ConstantOperation {
|
|
85
|
+
readonly value: Date;
|
|
86
|
+
constructor(value: Date);
|
|
87
|
+
}
|
|
88
|
+
declare class DecimalConstantOperation extends ConstantOperation {
|
|
89
|
+
readonly value: number;
|
|
90
|
+
constructor(value: number);
|
|
91
|
+
}
|
|
92
|
+
declare class BooleanConstantOperation extends ConstantOperation {
|
|
93
|
+
readonly value: boolean;
|
|
94
|
+
constructor(value: boolean);
|
|
95
|
+
}
|
|
96
|
+
declare abstract class UnaryOperation extends Operation {
|
|
97
|
+
readonly element: RelationalOperationElement;
|
|
98
|
+
constructor(element: RelationalOperationElement);
|
|
99
|
+
}
|
|
100
|
+
declare abstract class BinaryOperation extends Operation {
|
|
101
|
+
readonly left: RelationalOperationElement;
|
|
102
|
+
readonly right: RelationalOperationElement;
|
|
103
|
+
constructor(left: RelationalOperationElement, right: RelationalOperationElement);
|
|
104
|
+
}
|
|
105
|
+
declare class IsNullOperation extends UnaryOperation {
|
|
106
|
+
}
|
|
107
|
+
declare class IsNotNullOperation extends UnaryOperation {
|
|
108
|
+
}
|
|
109
|
+
declare class ComparisonOperation extends BinaryOperation {
|
|
110
|
+
readonly operator: ComparisonOperator;
|
|
111
|
+
constructor(left: RelationalOperationElement, operator: ComparisonOperator, right: RelationalOperationElement);
|
|
112
|
+
}
|
|
113
|
+
declare class LogicalOperation extends BinaryOperation {
|
|
114
|
+
readonly operator: LogicalOperator;
|
|
115
|
+
constructor(left: RelationalOperationElement, operator: LogicalOperator, right: RelationalOperationElement);
|
|
116
|
+
}
|
|
117
|
+
declare class WindowSpecification {
|
|
118
|
+
readonly partitionBy: RelationalOperationElement[];
|
|
119
|
+
readonly orderBy: SortOperation[];
|
|
120
|
+
constructor(partitionBy?: RelationalOperationElement[], orderBy?: SortOperation[]);
|
|
121
|
+
}
|
|
122
|
+
declare class AggregateOperation extends UnaryOperation {
|
|
123
|
+
readonly operator: AggregateOperator;
|
|
124
|
+
readonly displayName?: string | undefined;
|
|
125
|
+
readonly window?: WindowSpecification | undefined;
|
|
126
|
+
constructor(element: RelationalOperationElement, operator: AggregateOperator, displayName?: string | undefined, window?: WindowSpecification | undefined);
|
|
127
|
+
over(partitionBy?: RelationalOperationElement[], orderBy?: SortOperation[]): AggregateOperation;
|
|
128
|
+
}
|
|
129
|
+
declare enum WindowFunction {
|
|
130
|
+
ROW_NUMBER = "ROW_NUMBER",
|
|
131
|
+
RANK = "RANK",
|
|
132
|
+
DENSE_RANK = "DENSE_RANK",
|
|
133
|
+
NTILE = "NTILE",
|
|
134
|
+
LAG = "LAG",
|
|
135
|
+
LEAD = "LEAD",
|
|
136
|
+
FIRST_VALUE = "FIRST_VALUE",
|
|
137
|
+
LAST_VALUE = "LAST_VALUE",
|
|
138
|
+
CUME_DIST = "CUME_DIST",
|
|
139
|
+
PERCENT_RANK = "PERCENT_RANK"
|
|
140
|
+
}
|
|
141
|
+
declare class WindowFunctionOperation extends UnaryOperation {
|
|
142
|
+
readonly func: WindowFunction;
|
|
143
|
+
readonly displayName?: string | undefined;
|
|
144
|
+
readonly secondArg?: number | undefined;
|
|
145
|
+
readonly extraArgs: (string | number)[];
|
|
146
|
+
readonly window?: WindowSpecification | undefined;
|
|
147
|
+
constructor(element: RelationalOperationElement | null, func: WindowFunction, displayName?: string | undefined, secondArg?: number | undefined, extraArgs?: (string | number)[], window?: WindowSpecification | undefined);
|
|
148
|
+
over(partitionBy?: RelationalOperationElement[], orderBy?: SortOperation[]): WindowFunctionOperation;
|
|
149
|
+
}
|
|
150
|
+
declare class ScalarFunctionOperation extends UnaryOperation {
|
|
151
|
+
readonly func: ScalarFunction;
|
|
152
|
+
readonly displayName?: string | undefined;
|
|
153
|
+
readonly secondArg?: number | undefined;
|
|
154
|
+
readonly extraArgs: (string | number)[];
|
|
155
|
+
constructor(element: RelationalOperationElement, func: ScalarFunction, displayName?: string | undefined, secondArg?: number | undefined, extraArgs?: (string | number)[]);
|
|
156
|
+
}
|
|
157
|
+
declare class DateExtractOperation extends UnaryOperation {
|
|
158
|
+
readonly part: DatePart;
|
|
159
|
+
readonly displayName?: string | undefined;
|
|
160
|
+
constructor(element: RelationalOperationElement, part: DatePart, displayName?: string | undefined);
|
|
161
|
+
}
|
|
162
|
+
declare class DateArithmeticOperation extends UnaryOperation {
|
|
163
|
+
readonly n: number;
|
|
164
|
+
readonly unit: DatePart;
|
|
165
|
+
readonly isAdd: boolean;
|
|
166
|
+
readonly displayName?: string | undefined;
|
|
167
|
+
constructor(element: RelationalOperationElement, n: number, unit: DatePart, isAdd?: boolean, displayName?: string | undefined);
|
|
168
|
+
}
|
|
169
|
+
declare class DateDiffOperation extends UnaryOperation {
|
|
170
|
+
readonly other: Date;
|
|
171
|
+
readonly unit: DatePart;
|
|
172
|
+
readonly displayName?: string | undefined;
|
|
173
|
+
constructor(element: RelationalOperationElement, other: Date, unit: DatePart, displayName?: string | undefined);
|
|
174
|
+
}
|
|
175
|
+
declare class Column extends RelationalOperationElement {
|
|
176
|
+
readonly name: string;
|
|
177
|
+
readonly type: string;
|
|
178
|
+
readonly owner?: string | undefined;
|
|
179
|
+
readonly primaryKey: boolean;
|
|
180
|
+
table?: Table;
|
|
181
|
+
constructor(name: string, type: string, owner?: string | undefined, primaryKey?: boolean);
|
|
182
|
+
}
|
|
183
|
+
declare class ForeignKey {
|
|
184
|
+
readonly column: Column;
|
|
185
|
+
readonly references: Column;
|
|
186
|
+
constructor(column: Column, references: Column);
|
|
187
|
+
}
|
|
188
|
+
declare abstract class DataStore {
|
|
189
|
+
readonly name: string;
|
|
190
|
+
readonly schemas: Schema[];
|
|
191
|
+
constructor(name: string);
|
|
192
|
+
abstract namespace(schemaName: string): string;
|
|
193
|
+
}
|
|
194
|
+
declare class Database extends DataStore {
|
|
195
|
+
readonly location?: string | undefined;
|
|
196
|
+
constructor(name: string, location?: string | undefined);
|
|
197
|
+
namespace(schemaName: string): string;
|
|
198
|
+
}
|
|
199
|
+
declare class DataCatalog extends DataStore {
|
|
200
|
+
constructor(name: string);
|
|
201
|
+
namespace(schemaName: string): string;
|
|
202
|
+
}
|
|
203
|
+
declare class Schema {
|
|
204
|
+
readonly name: string;
|
|
205
|
+
readonly datastore?: DataStore | undefined;
|
|
206
|
+
readonly tables: Table[];
|
|
207
|
+
constructor(name: string, datastore?: DataStore | undefined);
|
|
208
|
+
}
|
|
209
|
+
declare class Table {
|
|
210
|
+
readonly name: string;
|
|
211
|
+
readonly schema?: Schema | undefined;
|
|
212
|
+
private readonly _columnsByName;
|
|
213
|
+
readonly foreignKeys: ForeignKey[];
|
|
214
|
+
constructor(name: string, columns: Column[], schema?: Schema | undefined);
|
|
215
|
+
get columns(): Column[];
|
|
216
|
+
get qualifiedName(): string;
|
|
217
|
+
}
|
|
218
|
+
declare class JoinOperation {
|
|
219
|
+
readonly name: string;
|
|
220
|
+
readonly target: Table;
|
|
221
|
+
readonly left: Column;
|
|
222
|
+
readonly right: Column;
|
|
223
|
+
filter?: RelationalOperationElement;
|
|
224
|
+
/** Property-equality filters on the join target (property id -> value), set by a related finder given a filter. */
|
|
225
|
+
filterKwargs: Record<string, unknown>;
|
|
226
|
+
/** Maps property ids to [column, type, table] for `filterKwargs`. */
|
|
227
|
+
filterColumnMap: Record<string, [string, string, string]>;
|
|
228
|
+
constructor(name: string, target: Table, left: Column, right: Column, filter?: RelationalOperationElement);
|
|
229
|
+
}
|
|
230
|
+
declare class JoinTreeNodeOperation {
|
|
231
|
+
readonly join: JoinOperation;
|
|
232
|
+
readonly parent?: JoinTreeNodeOperation | undefined;
|
|
233
|
+
constructor(join: JoinOperation, parent?: JoinTreeNodeOperation | undefined);
|
|
234
|
+
}
|
|
235
|
+
declare class ColumnWithJoin extends RelationalOperationElement {
|
|
236
|
+
readonly column: Column;
|
|
237
|
+
readonly parent?: JoinTreeNodeOperation | undefined;
|
|
238
|
+
readonly embedded?: ColumnWithJoin | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* `embedded` is an alternate reference to a flat (denormalized) column on the owning table that
|
|
241
|
+
* holds the same value without the join; the SQL generator uses it when the join can be elided.
|
|
242
|
+
*/
|
|
243
|
+
constructor(column: Column, parent?: JoinTreeNodeOperation | undefined, embedded?: ColumnWithJoin | undefined);
|
|
244
|
+
}
|
|
245
|
+
declare class SortOperation {
|
|
246
|
+
readonly column: ColumnWithJoin;
|
|
247
|
+
readonly direction: SortDirection;
|
|
248
|
+
constructor(column: ColumnWithJoin, direction: SortDirection);
|
|
249
|
+
}
|
|
250
|
+
declare class CountAllOperation extends RelationalOperationElement {
|
|
251
|
+
readonly table: string;
|
|
252
|
+
constructor(table: string);
|
|
253
|
+
}
|
|
254
|
+
declare class Alias extends RelationalOperationElement {
|
|
255
|
+
readonly element: RelationalOperationElement;
|
|
256
|
+
readonly name: string;
|
|
257
|
+
constructor(element: RelationalOperationElement, name: string);
|
|
258
|
+
}
|
|
259
|
+
/** Returned by `RelatedFinder.exists()`. A backend translates it to a join-presence check. */
|
|
260
|
+
declare class ExistsOperation extends RelationalOperationElement {
|
|
261
|
+
readonly node: JoinTreeNodeOperation;
|
|
262
|
+
constructor(node: JoinTreeNodeOperation);
|
|
263
|
+
andOp(other: RelationalOperationElement): LogicalOperation;
|
|
264
|
+
}
|
|
265
|
+
/** Returned by `RelatedFinder.notExists()`. A backend translates it to a join-absence check. */
|
|
266
|
+
declare class NotExistsOperation extends RelationalOperationElement {
|
|
267
|
+
readonly node: JoinTreeNodeOperation;
|
|
268
|
+
constructor(node: JoinTreeNodeOperation);
|
|
269
|
+
andOp(other: RelationalOperationElement): LogicalOperation;
|
|
270
|
+
}
|
|
271
|
+
declare class SelectOperation {
|
|
272
|
+
readonly display: RelationalOperationElement[];
|
|
273
|
+
readonly filter: RelationalOperationElement;
|
|
274
|
+
readonly orderBy: SortOperation[];
|
|
275
|
+
readonly groupBy: RelationalOperationElement[];
|
|
276
|
+
readonly limit?: number | undefined;
|
|
277
|
+
readonly table?: Table | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* Extra ON conditions for this query's joins (milestoning and property filters), keyed by join node.
|
|
280
|
+
* Held here rather than on the shared JoinOperation, so queries that use the same node can't affect each other.
|
|
281
|
+
*/
|
|
282
|
+
readonly joinFilters: ReadonlyMap<JoinTreeNodeOperation, Operation>;
|
|
283
|
+
constructor(display: RelationalOperationElement[], filter: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: RelationalOperationElement[], limit?: number | undefined, table?: Table | undefined,
|
|
284
|
+
/**
|
|
285
|
+
* Extra ON conditions for this query's joins (milestoning and property filters), keyed by join node.
|
|
286
|
+
* Held here rather than on the shared JoinOperation, so queries that use the same node can't affect each other.
|
|
287
|
+
*/
|
|
288
|
+
joinFilters?: ReadonlyMap<JoinTreeNodeOperation, Operation>);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export { AggregateOperation, AggregateOperator, Alias, BinaryOperation, BooleanConstantOperation, Column, ColumnWithJoin, ComparisonOperation, ComparisonOperator, ConstantOperation, CountAllOperation, DataCatalog, DataStore, Database, DateArithmeticOperation, DateConstantOperation, DateDiffOperation, DateExtractOperation, DatePart, DateTimeConstantOperation, DecimalConstantOperation, ExistsOperation, FloatConstantOperation, ForeignKey, IntegerConstantOperation, IsNotNullOperation, IsNullOperation, JoinOperation, JoinTreeNodeOperation, LogicalOperation, LogicalOperator, NoOperation, NotExistsOperation, Operation, RelationalOperationElement, ScalarFunction, ScalarFunctionOperation, Schema, SelectOperation, SortDirection, SortOperation, StringConstantOperation, Table, UnaryOperation, WindowFunction, WindowFunctionOperation, WindowSpecification };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AggregateOperation,
|
|
3
|
+
AggregateOperator,
|
|
4
|
+
Alias,
|
|
5
|
+
BinaryOperation,
|
|
6
|
+
BooleanConstantOperation,
|
|
7
|
+
Column,
|
|
8
|
+
ColumnWithJoin,
|
|
9
|
+
ComparisonOperation,
|
|
10
|
+
ComparisonOperator,
|
|
11
|
+
ConstantOperation,
|
|
12
|
+
CountAllOperation,
|
|
13
|
+
DataCatalog,
|
|
14
|
+
DataStore,
|
|
15
|
+
Database,
|
|
16
|
+
DateArithmeticOperation,
|
|
17
|
+
DateConstantOperation,
|
|
18
|
+
DateDiffOperation,
|
|
19
|
+
DateExtractOperation,
|
|
20
|
+
DatePart,
|
|
21
|
+
DateTimeConstantOperation,
|
|
22
|
+
DecimalConstantOperation,
|
|
23
|
+
ExistsOperation,
|
|
24
|
+
FloatConstantOperation,
|
|
25
|
+
ForeignKey,
|
|
26
|
+
IntegerConstantOperation,
|
|
27
|
+
IsNotNullOperation,
|
|
28
|
+
IsNullOperation,
|
|
29
|
+
JoinOperation,
|
|
30
|
+
JoinTreeNodeOperation,
|
|
31
|
+
LogicalOperation,
|
|
32
|
+
LogicalOperator,
|
|
33
|
+
NoOperation,
|
|
34
|
+
NotExistsOperation,
|
|
35
|
+
Operation,
|
|
36
|
+
RelationalOperationElement,
|
|
37
|
+
ScalarFunction,
|
|
38
|
+
ScalarFunctionOperation,
|
|
39
|
+
Schema,
|
|
40
|
+
SelectOperation,
|
|
41
|
+
SortDirection,
|
|
42
|
+
SortOperation,
|
|
43
|
+
StringConstantOperation,
|
|
44
|
+
Table,
|
|
45
|
+
UnaryOperation,
|
|
46
|
+
WindowFunction,
|
|
47
|
+
WindowFunctionOperation,
|
|
48
|
+
WindowSpecification
|
|
49
|
+
} from "../chunk-UYMOE6YU.js";
|
|
50
|
+
export {
|
|
51
|
+
AggregateOperation,
|
|
52
|
+
AggregateOperator,
|
|
53
|
+
Alias,
|
|
54
|
+
BinaryOperation,
|
|
55
|
+
BooleanConstantOperation,
|
|
56
|
+
Column,
|
|
57
|
+
ColumnWithJoin,
|
|
58
|
+
ComparisonOperation,
|
|
59
|
+
ComparisonOperator,
|
|
60
|
+
ConstantOperation,
|
|
61
|
+
CountAllOperation,
|
|
62
|
+
DataCatalog,
|
|
63
|
+
DataStore,
|
|
64
|
+
Database,
|
|
65
|
+
DateArithmeticOperation,
|
|
66
|
+
DateConstantOperation,
|
|
67
|
+
DateDiffOperation,
|
|
68
|
+
DateExtractOperation,
|
|
69
|
+
DatePart,
|
|
70
|
+
DateTimeConstantOperation,
|
|
71
|
+
DecimalConstantOperation,
|
|
72
|
+
ExistsOperation,
|
|
73
|
+
FloatConstantOperation,
|
|
74
|
+
ForeignKey,
|
|
75
|
+
IntegerConstantOperation,
|
|
76
|
+
IsNotNullOperation,
|
|
77
|
+
IsNullOperation,
|
|
78
|
+
JoinOperation,
|
|
79
|
+
JoinTreeNodeOperation,
|
|
80
|
+
LogicalOperation,
|
|
81
|
+
LogicalOperator,
|
|
82
|
+
NoOperation,
|
|
83
|
+
NotExistsOperation,
|
|
84
|
+
Operation,
|
|
85
|
+
RelationalOperationElement,
|
|
86
|
+
ScalarFunction,
|
|
87
|
+
ScalarFunctionOperation,
|
|
88
|
+
Schema,
|
|
89
|
+
SelectOperation,
|
|
90
|
+
SortDirection,
|
|
91
|
+
SortOperation,
|
|
92
|
+
StringConstantOperation,
|
|
93
|
+
Table,
|
|
94
|
+
UnaryOperation,
|
|
95
|
+
WindowFunction,
|
|
96
|
+
WindowFunctionOperation,
|
|
97
|
+
WindowSpecification
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=relational.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|