sqlparser-rs 0.60.0-rc1
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/cjs/dialects.js +191 -0
- package/dist/cjs/dialects.js.map +1 -0
- package/dist/cjs/index.js +81 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/parser.js +264 -0
- package/dist/cjs/parser.js.map +1 -0
- package/dist/cjs/types/ast.js +10 -0
- package/dist/cjs/types/ast.js.map +1 -0
- package/dist/cjs/types/errors.js +49 -0
- package/dist/cjs/types/errors.js.map +1 -0
- package/dist/cjs/types/index.js +19 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/esm/dialects.js +174 -0
- package/dist/esm/dialects.js.map +1 -0
- package/dist/esm/index.js +47 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/parser.js +226 -0
- package/dist/esm/parser.js.map +1 -0
- package/dist/esm/types/ast.js +9 -0
- package/dist/esm/types/ast.js.map +1 -0
- package/dist/esm/types/errors.js +44 -0
- package/dist/esm/types/errors.js.map +1 -0
- package/dist/esm/types/index.js +3 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/types/dialects.d.ts +112 -0
- package/dist/types/dialects.d.ts.map +1 -0
- package/dist/types/index.d.ts +46 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/parser.d.ts +130 -0
- package/dist/types/parser.d.ts.map +1 -0
- package/dist/types/types/ast.d.ts +1097 -0
- package/dist/types/types/ast.d.ts.map +1 -0
- package/dist/types/types/errors.d.ts +25 -0
- package/dist/types/types/errors.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,1097 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript type definitions for sqlparser-rs AST
|
|
3
|
+
*
|
|
4
|
+
* These types mirror the Rust AST structure from the sqlparser crate.
|
|
5
|
+
* The AST is serialized as JSON from Rust, so these types represent
|
|
6
|
+
* the JSON structure.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* An identifier (table name, column name, etc.)
|
|
10
|
+
*/
|
|
11
|
+
export interface Ident {
|
|
12
|
+
value: string;
|
|
13
|
+
quoteStyle?: string | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A compound identifier like schema.table.column
|
|
17
|
+
*/
|
|
18
|
+
export type ObjectName = Ident[];
|
|
19
|
+
/**
|
|
20
|
+
* Binary operators
|
|
21
|
+
*/
|
|
22
|
+
export type BinaryOperator = 'Plus' | 'Minus' | 'Multiply' | 'Divide' | 'Modulo' | 'StringConcat' | 'Gt' | 'Lt' | 'GtEq' | 'LtEq' | 'Spaceship' | 'Eq' | 'NotEq' | 'And' | 'Or' | 'Xor' | 'BitwiseOr' | 'BitwiseAnd' | 'BitwiseXor' | 'PGBitwiseXor' | 'PGBitwiseShiftLeft' | 'PGBitwiseShiftRight' | 'PGRegexMatch' | 'PGRegexIMatch' | 'PGRegexNotMatch' | 'PGRegexNotIMatch';
|
|
23
|
+
/**
|
|
24
|
+
* Unary operators
|
|
25
|
+
*/
|
|
26
|
+
export type UnaryOperator = 'Plus' | 'Minus' | 'Not' | 'PGBitwiseNot' | 'PGSquareRoot' | 'PGCubeRoot' | 'PGPostfixFactorial' | 'PGPrefixFactorial' | 'PGAbs';
|
|
27
|
+
/**
|
|
28
|
+
* SQL Value types
|
|
29
|
+
*/
|
|
30
|
+
export type Value = {
|
|
31
|
+
Number: [string, boolean];
|
|
32
|
+
} | {
|
|
33
|
+
SingleQuotedString: string;
|
|
34
|
+
} | {
|
|
35
|
+
DoubleQuotedString: string;
|
|
36
|
+
} | {
|
|
37
|
+
DollarQuotedString: {
|
|
38
|
+
value: string;
|
|
39
|
+
tag?: string;
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
42
|
+
EscapedStringLiteral: string;
|
|
43
|
+
} | {
|
|
44
|
+
NationalStringLiteral: string;
|
|
45
|
+
} | {
|
|
46
|
+
HexStringLiteral: string;
|
|
47
|
+
} | {
|
|
48
|
+
Boolean: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
Null: null;
|
|
51
|
+
} | {
|
|
52
|
+
Placeholder: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* SQL Expression
|
|
56
|
+
*/
|
|
57
|
+
export type Expr = {
|
|
58
|
+
Identifier: Ident;
|
|
59
|
+
} | {
|
|
60
|
+
CompoundIdentifier: Ident[];
|
|
61
|
+
} | {
|
|
62
|
+
Value: Value;
|
|
63
|
+
} | {
|
|
64
|
+
BinaryOp: {
|
|
65
|
+
left: Expr;
|
|
66
|
+
op: BinaryOperator;
|
|
67
|
+
right: Expr;
|
|
68
|
+
};
|
|
69
|
+
} | {
|
|
70
|
+
UnaryOp: {
|
|
71
|
+
op: UnaryOperator;
|
|
72
|
+
expr: Expr;
|
|
73
|
+
};
|
|
74
|
+
} | {
|
|
75
|
+
Nested: Expr;
|
|
76
|
+
} | {
|
|
77
|
+
IsNull: Expr;
|
|
78
|
+
} | {
|
|
79
|
+
IsNotNull: Expr;
|
|
80
|
+
} | {
|
|
81
|
+
IsTrue: Expr;
|
|
82
|
+
} | {
|
|
83
|
+
IsFalse: Expr;
|
|
84
|
+
} | {
|
|
85
|
+
IsUnknown: Expr;
|
|
86
|
+
} | {
|
|
87
|
+
IsNotTrue: Expr;
|
|
88
|
+
} | {
|
|
89
|
+
IsNotFalse: Expr;
|
|
90
|
+
} | {
|
|
91
|
+
IsNotUnknown: Expr;
|
|
92
|
+
} | {
|
|
93
|
+
InList: {
|
|
94
|
+
expr: Expr;
|
|
95
|
+
list: Expr[];
|
|
96
|
+
negated: boolean;
|
|
97
|
+
};
|
|
98
|
+
} | {
|
|
99
|
+
InSubquery: {
|
|
100
|
+
expr: Expr;
|
|
101
|
+
subquery: Query;
|
|
102
|
+
negated: boolean;
|
|
103
|
+
};
|
|
104
|
+
} | {
|
|
105
|
+
Between: {
|
|
106
|
+
expr: Expr;
|
|
107
|
+
negated: boolean;
|
|
108
|
+
low: Expr;
|
|
109
|
+
high: Expr;
|
|
110
|
+
};
|
|
111
|
+
} | {
|
|
112
|
+
Like: {
|
|
113
|
+
expr: Expr;
|
|
114
|
+
negated: boolean;
|
|
115
|
+
pattern: Expr;
|
|
116
|
+
escapeChar?: string;
|
|
117
|
+
};
|
|
118
|
+
} | {
|
|
119
|
+
ILike: {
|
|
120
|
+
expr: Expr;
|
|
121
|
+
negated: boolean;
|
|
122
|
+
pattern: Expr;
|
|
123
|
+
escapeChar?: string;
|
|
124
|
+
};
|
|
125
|
+
} | {
|
|
126
|
+
SimilarTo: {
|
|
127
|
+
expr: Expr;
|
|
128
|
+
negated: boolean;
|
|
129
|
+
pattern: Expr;
|
|
130
|
+
escapeChar?: string;
|
|
131
|
+
};
|
|
132
|
+
} | {
|
|
133
|
+
Case: {
|
|
134
|
+
operand?: Expr;
|
|
135
|
+
conditions: Expr[];
|
|
136
|
+
results: Expr[];
|
|
137
|
+
elseResult?: Expr;
|
|
138
|
+
};
|
|
139
|
+
} | {
|
|
140
|
+
Cast: {
|
|
141
|
+
expr: Expr;
|
|
142
|
+
dataType: DataType;
|
|
143
|
+
};
|
|
144
|
+
} | {
|
|
145
|
+
TryCast: {
|
|
146
|
+
expr: Expr;
|
|
147
|
+
dataType: DataType;
|
|
148
|
+
};
|
|
149
|
+
} | {
|
|
150
|
+
SafeCast: {
|
|
151
|
+
expr: Expr;
|
|
152
|
+
dataType: DataType;
|
|
153
|
+
};
|
|
154
|
+
} | {
|
|
155
|
+
Extract: {
|
|
156
|
+
field: DateTimeField;
|
|
157
|
+
expr: Expr;
|
|
158
|
+
};
|
|
159
|
+
} | {
|
|
160
|
+
Substring: {
|
|
161
|
+
expr: Expr;
|
|
162
|
+
substringFrom?: Expr;
|
|
163
|
+
substringFor?: Expr;
|
|
164
|
+
};
|
|
165
|
+
} | {
|
|
166
|
+
Trim: {
|
|
167
|
+
expr: Expr;
|
|
168
|
+
trimWhere?: TrimWhereField;
|
|
169
|
+
trimWhat?: Expr;
|
|
170
|
+
};
|
|
171
|
+
} | {
|
|
172
|
+
Collate: {
|
|
173
|
+
expr: Expr;
|
|
174
|
+
collation: ObjectName;
|
|
175
|
+
};
|
|
176
|
+
} | {
|
|
177
|
+
Function: FunctionExpr;
|
|
178
|
+
} | {
|
|
179
|
+
Subquery: Query;
|
|
180
|
+
} | {
|
|
181
|
+
Exists: {
|
|
182
|
+
subquery: Query;
|
|
183
|
+
negated: boolean;
|
|
184
|
+
};
|
|
185
|
+
} | {
|
|
186
|
+
Wildcard: null;
|
|
187
|
+
} | {
|
|
188
|
+
QualifiedWildcard: ObjectName;
|
|
189
|
+
} | {
|
|
190
|
+
Tuple: Expr[];
|
|
191
|
+
} | {
|
|
192
|
+
Array: {
|
|
193
|
+
elem: Expr[];
|
|
194
|
+
named: boolean;
|
|
195
|
+
};
|
|
196
|
+
} | {
|
|
197
|
+
MapAccess: {
|
|
198
|
+
column: Expr;
|
|
199
|
+
keys: Expr[];
|
|
200
|
+
};
|
|
201
|
+
} | {
|
|
202
|
+
CompositeAccess: {
|
|
203
|
+
expr: Expr;
|
|
204
|
+
key: Ident;
|
|
205
|
+
};
|
|
206
|
+
} | {
|
|
207
|
+
TypedString: {
|
|
208
|
+
dataType: DataType;
|
|
209
|
+
value: string;
|
|
210
|
+
};
|
|
211
|
+
} | {
|
|
212
|
+
AtTimeZone: {
|
|
213
|
+
timestamp: Expr;
|
|
214
|
+
timeZone: string;
|
|
215
|
+
};
|
|
216
|
+
} | {
|
|
217
|
+
Interval: IntervalExpr;
|
|
218
|
+
} | 'Wildcard';
|
|
219
|
+
/**
|
|
220
|
+
* Function expression
|
|
221
|
+
*/
|
|
222
|
+
export interface FunctionExpr {
|
|
223
|
+
name: ObjectName;
|
|
224
|
+
args: FunctionArg[];
|
|
225
|
+
over?: WindowSpec;
|
|
226
|
+
distinct: boolean;
|
|
227
|
+
special: boolean;
|
|
228
|
+
orderBy: OrderByExpr[];
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Function argument
|
|
232
|
+
*/
|
|
233
|
+
export type FunctionArg = {
|
|
234
|
+
Unnamed: FunctionArgExpr;
|
|
235
|
+
} | {
|
|
236
|
+
Named: {
|
|
237
|
+
name: Ident;
|
|
238
|
+
arg: FunctionArgExpr;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
export type FunctionArgExpr = {
|
|
242
|
+
Expr: Expr;
|
|
243
|
+
} | {
|
|
244
|
+
QualifiedWildcard: ObjectName;
|
|
245
|
+
} | 'Wildcard';
|
|
246
|
+
/**
|
|
247
|
+
* Interval expression
|
|
248
|
+
*/
|
|
249
|
+
export interface IntervalExpr {
|
|
250
|
+
value: Expr;
|
|
251
|
+
leadingField?: DateTimeField;
|
|
252
|
+
leadingPrecision?: number;
|
|
253
|
+
lastField?: DateTimeField;
|
|
254
|
+
fractionalSecondsPrecision?: number;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Date/time field for EXTRACT
|
|
258
|
+
*/
|
|
259
|
+
export type DateTimeField = 'Year' | 'Month' | 'Week' | 'Day' | 'Hour' | 'Minute' | 'Second' | 'Millisecond' | 'Microsecond' | 'Nanosecond' | 'Century' | 'Decade' | 'Dow' | 'Doy' | 'Epoch' | 'Isodow' | 'Isoyear' | 'Julian' | 'Quarter' | 'Timezone' | 'TimezoneHour' | 'TimezoneMinute';
|
|
260
|
+
/**
|
|
261
|
+
* Trim where field
|
|
262
|
+
*/
|
|
263
|
+
export type TrimWhereField = 'Both' | 'Leading' | 'Trailing';
|
|
264
|
+
/**
|
|
265
|
+
* SQL Data types
|
|
266
|
+
*/
|
|
267
|
+
export type DataType = 'Boolean' | 'TinyInt' | 'SmallInt' | 'Int' | 'Integer' | 'BigInt' | {
|
|
268
|
+
Float: number | null;
|
|
269
|
+
} | 'Real' | 'Double' | {
|
|
270
|
+
Decimal: [number | null, number | null];
|
|
271
|
+
} | {
|
|
272
|
+
Numeric: [number | null, number | null];
|
|
273
|
+
} | {
|
|
274
|
+
Varchar: number | null;
|
|
275
|
+
} | {
|
|
276
|
+
Char: number | null;
|
|
277
|
+
} | 'Text' | 'Uuid' | 'Date' | {
|
|
278
|
+
Time: [number | null, boolean];
|
|
279
|
+
} | {
|
|
280
|
+
Timestamp: [number | null, boolean];
|
|
281
|
+
} | 'Interval' | 'Binary' | {
|
|
282
|
+
Varbinary: number | null;
|
|
283
|
+
} | 'Blob' | 'Bytes' | 'Json' | 'Jsonb' | {
|
|
284
|
+
Array: DataType;
|
|
285
|
+
} | {
|
|
286
|
+
Custom: [ObjectName, string[]];
|
|
287
|
+
} | 'Regclass' | 'String';
|
|
288
|
+
/**
|
|
289
|
+
* Window specification
|
|
290
|
+
*/
|
|
291
|
+
export interface WindowSpec {
|
|
292
|
+
partitionBy: Expr[];
|
|
293
|
+
orderBy: OrderByExpr[];
|
|
294
|
+
windowFrame?: WindowFrame;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Window frame
|
|
298
|
+
*/
|
|
299
|
+
export interface WindowFrame {
|
|
300
|
+
units: WindowFrameUnits;
|
|
301
|
+
startBound: WindowFrameBound;
|
|
302
|
+
endBound?: WindowFrameBound;
|
|
303
|
+
}
|
|
304
|
+
export type WindowFrameUnits = 'Rows' | 'Range' | 'Groups';
|
|
305
|
+
export type WindowFrameBound = 'CurrentRow' | 'UnboundedPreceding' | 'UnboundedFollowing' | {
|
|
306
|
+
Preceding: Expr | null;
|
|
307
|
+
} | {
|
|
308
|
+
Following: Expr | null;
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* ORDER BY expression
|
|
312
|
+
*/
|
|
313
|
+
export interface OrderByExpr {
|
|
314
|
+
expr: Expr;
|
|
315
|
+
asc?: boolean;
|
|
316
|
+
nullsFirst?: boolean;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* SELECT item
|
|
320
|
+
*/
|
|
321
|
+
export type SelectItem = 'UnnamedExpr' | {
|
|
322
|
+
UnnamedExpr: Expr;
|
|
323
|
+
} | {
|
|
324
|
+
ExprWithAlias: {
|
|
325
|
+
expr: Expr;
|
|
326
|
+
alias: Ident;
|
|
327
|
+
};
|
|
328
|
+
} | {
|
|
329
|
+
QualifiedWildcard: [ObjectName, WildcardAdditionalOptions];
|
|
330
|
+
} | {
|
|
331
|
+
Wildcard: WildcardAdditionalOptions;
|
|
332
|
+
};
|
|
333
|
+
export interface WildcardAdditionalOptions {
|
|
334
|
+
optExclude?: ExcludeSelectItem;
|
|
335
|
+
optExcept?: ExceptSelectItem;
|
|
336
|
+
optRename?: RenameSelectItem;
|
|
337
|
+
optReplace?: ReplaceSelectItem;
|
|
338
|
+
}
|
|
339
|
+
export interface ExcludeSelectItem {
|
|
340
|
+
items: Ident[];
|
|
341
|
+
}
|
|
342
|
+
export interface ExceptSelectItem {
|
|
343
|
+
firstElement: Ident;
|
|
344
|
+
additionalElements: Ident[];
|
|
345
|
+
}
|
|
346
|
+
export interface RenameSelectItem {
|
|
347
|
+
items: IdentWithAlias[];
|
|
348
|
+
}
|
|
349
|
+
export interface ReplaceSelectItem {
|
|
350
|
+
items: ReplaceSelectElement[];
|
|
351
|
+
}
|
|
352
|
+
export interface IdentWithAlias {
|
|
353
|
+
ident: Ident;
|
|
354
|
+
alias: Ident;
|
|
355
|
+
}
|
|
356
|
+
export interface ReplaceSelectElement {
|
|
357
|
+
expr: Expr;
|
|
358
|
+
columnName: Ident;
|
|
359
|
+
asKeyword: boolean;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* FROM clause table reference
|
|
363
|
+
*/
|
|
364
|
+
export type TableFactor = {
|
|
365
|
+
Table: {
|
|
366
|
+
name: ObjectName;
|
|
367
|
+
alias?: TableAlias;
|
|
368
|
+
args?: FunctionArg[];
|
|
369
|
+
withHints: Expr[];
|
|
370
|
+
};
|
|
371
|
+
} | {
|
|
372
|
+
Derived: {
|
|
373
|
+
lateral: boolean;
|
|
374
|
+
subquery: Query;
|
|
375
|
+
alias?: TableAlias;
|
|
376
|
+
};
|
|
377
|
+
} | {
|
|
378
|
+
TableFunction: {
|
|
379
|
+
expr: Expr;
|
|
380
|
+
alias?: TableAlias;
|
|
381
|
+
};
|
|
382
|
+
} | {
|
|
383
|
+
NestedJoin: {
|
|
384
|
+
tableWithJoins: TableWithJoins;
|
|
385
|
+
alias?: TableAlias;
|
|
386
|
+
};
|
|
387
|
+
} | {
|
|
388
|
+
UNNEST: {
|
|
389
|
+
alias?: TableAlias;
|
|
390
|
+
arrayExprs: Expr[];
|
|
391
|
+
withOffset: boolean;
|
|
392
|
+
withOffsetAlias?: Ident;
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* Table alias
|
|
397
|
+
*/
|
|
398
|
+
export interface TableAlias {
|
|
399
|
+
name: Ident;
|
|
400
|
+
columns: Ident[];
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Table with joins
|
|
404
|
+
*/
|
|
405
|
+
export interface TableWithJoins {
|
|
406
|
+
relation: TableFactor;
|
|
407
|
+
joins: Join[];
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* JOIN clause
|
|
411
|
+
*/
|
|
412
|
+
export interface Join {
|
|
413
|
+
relation: TableFactor;
|
|
414
|
+
joinOperator: JoinOperator;
|
|
415
|
+
}
|
|
416
|
+
export type JoinOperator = {
|
|
417
|
+
Inner: JoinConstraint;
|
|
418
|
+
} | {
|
|
419
|
+
LeftOuter: JoinConstraint;
|
|
420
|
+
} | {
|
|
421
|
+
RightOuter: JoinConstraint;
|
|
422
|
+
} | {
|
|
423
|
+
FullOuter: JoinConstraint;
|
|
424
|
+
} | 'CrossJoin' | {
|
|
425
|
+
LeftSemi: JoinConstraint;
|
|
426
|
+
} | {
|
|
427
|
+
RightSemi: JoinConstraint;
|
|
428
|
+
} | {
|
|
429
|
+
LeftAnti: JoinConstraint;
|
|
430
|
+
} | {
|
|
431
|
+
RightAnti: JoinConstraint;
|
|
432
|
+
} | 'CrossApply' | 'OuterApply';
|
|
433
|
+
export type JoinConstraint = {
|
|
434
|
+
On: Expr;
|
|
435
|
+
} | {
|
|
436
|
+
Using: Ident[];
|
|
437
|
+
} | 'Natural' | 'None';
|
|
438
|
+
/**
|
|
439
|
+
* SELECT statement
|
|
440
|
+
*/
|
|
441
|
+
export interface Select {
|
|
442
|
+
distinct?: Distinct;
|
|
443
|
+
top?: Top;
|
|
444
|
+
projection: SelectItem[];
|
|
445
|
+
into?: SelectInto;
|
|
446
|
+
from: TableWithJoins[];
|
|
447
|
+
lateralViews: LateralView[];
|
|
448
|
+
selection?: Expr;
|
|
449
|
+
groupBy: GroupByExpr;
|
|
450
|
+
clusterBy: Expr[];
|
|
451
|
+
distributeBy: Expr[];
|
|
452
|
+
sortBy: Expr[];
|
|
453
|
+
having?: Expr;
|
|
454
|
+
namedWindow: NamedWindowDefinition[];
|
|
455
|
+
qualify?: Expr;
|
|
456
|
+
}
|
|
457
|
+
export type Distinct = boolean | {
|
|
458
|
+
On: Expr[];
|
|
459
|
+
};
|
|
460
|
+
export interface Top {
|
|
461
|
+
withTies: boolean;
|
|
462
|
+
percent: boolean;
|
|
463
|
+
quantity?: Expr;
|
|
464
|
+
}
|
|
465
|
+
export interface SelectInto {
|
|
466
|
+
temporary: boolean;
|
|
467
|
+
unlogged: boolean;
|
|
468
|
+
table: boolean;
|
|
469
|
+
name: ObjectName;
|
|
470
|
+
}
|
|
471
|
+
export interface LateralView {
|
|
472
|
+
lateralViewExpr: Expr;
|
|
473
|
+
lateralViewName: ObjectName;
|
|
474
|
+
lateralColAlias: Ident[];
|
|
475
|
+
outer: boolean;
|
|
476
|
+
}
|
|
477
|
+
export type GroupByExpr = {
|
|
478
|
+
Expressions: Expr[];
|
|
479
|
+
} | 'All';
|
|
480
|
+
export interface NamedWindowDefinition {
|
|
481
|
+
name: Ident;
|
|
482
|
+
windowSpec: WindowSpec;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Set expression (UNION, INTERSECT, EXCEPT)
|
|
486
|
+
*/
|
|
487
|
+
export type SetExpr = {
|
|
488
|
+
Select: Select;
|
|
489
|
+
} | {
|
|
490
|
+
Query: Query;
|
|
491
|
+
} | {
|
|
492
|
+
SetOperation: {
|
|
493
|
+
op: SetOperator;
|
|
494
|
+
setQuantifier: SetQuantifier;
|
|
495
|
+
left: SetExpr;
|
|
496
|
+
right: SetExpr;
|
|
497
|
+
};
|
|
498
|
+
} | {
|
|
499
|
+
Values: Values;
|
|
500
|
+
} | {
|
|
501
|
+
Insert: Statement;
|
|
502
|
+
};
|
|
503
|
+
export type SetOperator = 'Union' | 'Except' | 'Intersect';
|
|
504
|
+
export type SetQuantifier = 'All' | 'Distinct' | 'None';
|
|
505
|
+
export interface Values {
|
|
506
|
+
explicit_row: boolean;
|
|
507
|
+
rows: Expr[][];
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* WITH clause (CTE)
|
|
511
|
+
*/
|
|
512
|
+
export interface With {
|
|
513
|
+
recursive: boolean;
|
|
514
|
+
cteTables: Cte[];
|
|
515
|
+
}
|
|
516
|
+
export interface Cte {
|
|
517
|
+
alias: TableAlias;
|
|
518
|
+
query: Query;
|
|
519
|
+
from?: Ident;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Query (top-level SELECT)
|
|
523
|
+
*/
|
|
524
|
+
export interface Query {
|
|
525
|
+
with?: With;
|
|
526
|
+
body: SetExpr;
|
|
527
|
+
orderBy: OrderByExpr[];
|
|
528
|
+
limit?: Expr;
|
|
529
|
+
offset?: Offset;
|
|
530
|
+
fetch?: Fetch;
|
|
531
|
+
locks: LockClause[];
|
|
532
|
+
}
|
|
533
|
+
export interface Offset {
|
|
534
|
+
value: Expr;
|
|
535
|
+
rows: OffsetRows;
|
|
536
|
+
}
|
|
537
|
+
export type OffsetRows = 'None' | 'Row' | 'Rows';
|
|
538
|
+
export interface Fetch {
|
|
539
|
+
withTies: boolean;
|
|
540
|
+
percent: boolean;
|
|
541
|
+
quantity?: Expr;
|
|
542
|
+
}
|
|
543
|
+
export interface LockClause {
|
|
544
|
+
lockType: LockType;
|
|
545
|
+
of?: ObjectName;
|
|
546
|
+
nonblock?: NonBlock;
|
|
547
|
+
}
|
|
548
|
+
export type LockType = 'Share' | 'Update';
|
|
549
|
+
export type NonBlock = 'Wait' | 'Nowait' | 'SkipLocked';
|
|
550
|
+
/**
|
|
551
|
+
* Column definition for CREATE TABLE
|
|
552
|
+
*/
|
|
553
|
+
export interface ColumnDef {
|
|
554
|
+
name: Ident;
|
|
555
|
+
dataType: DataType;
|
|
556
|
+
collation?: ObjectName;
|
|
557
|
+
options: ColumnOptionDef[];
|
|
558
|
+
}
|
|
559
|
+
export interface ColumnOptionDef {
|
|
560
|
+
name?: Ident;
|
|
561
|
+
option: ColumnOption;
|
|
562
|
+
}
|
|
563
|
+
export type ColumnOption = 'Null' | 'NotNull' | {
|
|
564
|
+
Default: Expr;
|
|
565
|
+
} | {
|
|
566
|
+
Unique: {
|
|
567
|
+
isPrimary: boolean;
|
|
568
|
+
};
|
|
569
|
+
} | {
|
|
570
|
+
ForeignKey: ForeignKeyOption;
|
|
571
|
+
} | {
|
|
572
|
+
Check: Expr;
|
|
573
|
+
} | 'AutoIncrement' | {
|
|
574
|
+
OnUpdate: Expr;
|
|
575
|
+
} | {
|
|
576
|
+
Generated: GeneratedAs;
|
|
577
|
+
} | {
|
|
578
|
+
Comment: string;
|
|
579
|
+
};
|
|
580
|
+
export interface ForeignKeyOption {
|
|
581
|
+
foreignTable: ObjectName;
|
|
582
|
+
referredColumns: Ident[];
|
|
583
|
+
onDelete?: ReferentialAction;
|
|
584
|
+
onUpdate?: ReferentialAction;
|
|
585
|
+
}
|
|
586
|
+
export type ReferentialAction = 'Restrict' | 'Cascade' | 'SetNull' | 'NoAction' | 'SetDefault';
|
|
587
|
+
export interface GeneratedAs {
|
|
588
|
+
generationType?: GeneratedExpressionMode;
|
|
589
|
+
expr: Expr;
|
|
590
|
+
}
|
|
591
|
+
export type GeneratedExpressionMode = 'Virtual' | 'Stored';
|
|
592
|
+
/**
|
|
593
|
+
* Table constraint
|
|
594
|
+
*/
|
|
595
|
+
export type TableConstraint = {
|
|
596
|
+
Unique: {
|
|
597
|
+
name?: Ident;
|
|
598
|
+
columns: Ident[];
|
|
599
|
+
isPrimary: boolean;
|
|
600
|
+
};
|
|
601
|
+
} | {
|
|
602
|
+
ForeignKey: {
|
|
603
|
+
name?: Ident;
|
|
604
|
+
columns: Ident[];
|
|
605
|
+
foreignTable: ObjectName;
|
|
606
|
+
referredColumns: Ident[];
|
|
607
|
+
onDelete?: ReferentialAction;
|
|
608
|
+
onUpdate?: ReferentialAction;
|
|
609
|
+
};
|
|
610
|
+
} | {
|
|
611
|
+
Check: {
|
|
612
|
+
name?: Ident;
|
|
613
|
+
expr: Expr;
|
|
614
|
+
};
|
|
615
|
+
} | {
|
|
616
|
+
Index: {
|
|
617
|
+
displayAsKey: boolean;
|
|
618
|
+
name?: Ident;
|
|
619
|
+
indexType?: IndexType;
|
|
620
|
+
columns: Ident[];
|
|
621
|
+
};
|
|
622
|
+
};
|
|
623
|
+
export type IndexType = 'BTree' | 'Hash';
|
|
624
|
+
/**
|
|
625
|
+
* All SQL statement types
|
|
626
|
+
*/
|
|
627
|
+
export type Statement = {
|
|
628
|
+
Query: Query;
|
|
629
|
+
} | {
|
|
630
|
+
Insert: {
|
|
631
|
+
orConflict?: SqliteOnConflict;
|
|
632
|
+
into: boolean;
|
|
633
|
+
tableName: ObjectName;
|
|
634
|
+
columns: Ident[];
|
|
635
|
+
overwrite: boolean;
|
|
636
|
+
source: Query;
|
|
637
|
+
partitioned?: Expr[];
|
|
638
|
+
afterColumns: Ident[];
|
|
639
|
+
table: boolean;
|
|
640
|
+
on?: OnInsert;
|
|
641
|
+
returning?: SelectItem[];
|
|
642
|
+
};
|
|
643
|
+
} | {
|
|
644
|
+
Update: {
|
|
645
|
+
table: TableWithJoins;
|
|
646
|
+
assignments: Assignment[];
|
|
647
|
+
from?: TableWithJoins;
|
|
648
|
+
selection?: Expr;
|
|
649
|
+
returning?: SelectItem[];
|
|
650
|
+
};
|
|
651
|
+
} | {
|
|
652
|
+
Delete: {
|
|
653
|
+
tables: ObjectName[];
|
|
654
|
+
from: TableWithJoins[];
|
|
655
|
+
using?: TableWithJoins[];
|
|
656
|
+
selection?: Expr;
|
|
657
|
+
returning?: SelectItem[];
|
|
658
|
+
};
|
|
659
|
+
} | {
|
|
660
|
+
CreateTable: {
|
|
661
|
+
orReplace: boolean;
|
|
662
|
+
temporary: boolean;
|
|
663
|
+
external: boolean;
|
|
664
|
+
global?: boolean;
|
|
665
|
+
ifNotExists: boolean;
|
|
666
|
+
transient: boolean;
|
|
667
|
+
name: ObjectName;
|
|
668
|
+
columns: ColumnDef[];
|
|
669
|
+
constraints: TableConstraint[];
|
|
670
|
+
hiveDistribution: HiveDistributionStyle;
|
|
671
|
+
hiveFormats?: HiveFormat;
|
|
672
|
+
tableProperties: SqlOption[];
|
|
673
|
+
withOptions: SqlOption[];
|
|
674
|
+
fileFormat?: FileFormat;
|
|
675
|
+
location?: string;
|
|
676
|
+
query?: Query;
|
|
677
|
+
withoutRowid: boolean;
|
|
678
|
+
like?: ObjectName;
|
|
679
|
+
cloneClause?: ObjectName;
|
|
680
|
+
engine?: string;
|
|
681
|
+
defaultCharset?: string;
|
|
682
|
+
collation?: string;
|
|
683
|
+
onCommit?: OnCommit;
|
|
684
|
+
onCluster?: string;
|
|
685
|
+
orderBy?: Ident[];
|
|
686
|
+
strict: boolean;
|
|
687
|
+
};
|
|
688
|
+
} | {
|
|
689
|
+
CreateView: {
|
|
690
|
+
orReplace: boolean;
|
|
691
|
+
materialized: boolean;
|
|
692
|
+
name: ObjectName;
|
|
693
|
+
columns: Ident[];
|
|
694
|
+
query: Query;
|
|
695
|
+
withOptions: SqlOption[];
|
|
696
|
+
clusterBy: Ident[];
|
|
697
|
+
};
|
|
698
|
+
} | {
|
|
699
|
+
CreateIndex: {
|
|
700
|
+
name?: ObjectName;
|
|
701
|
+
tableName: ObjectName;
|
|
702
|
+
using?: Ident;
|
|
703
|
+
columns: OrderByExpr[];
|
|
704
|
+
unique: boolean;
|
|
705
|
+
concurrently: boolean;
|
|
706
|
+
ifNotExists: boolean;
|
|
707
|
+
include: Ident[];
|
|
708
|
+
nullsDistinct?: boolean;
|
|
709
|
+
predicate?: Expr;
|
|
710
|
+
};
|
|
711
|
+
} | {
|
|
712
|
+
AlterTable: {
|
|
713
|
+
name: ObjectName;
|
|
714
|
+
ifExists: boolean;
|
|
715
|
+
only: boolean;
|
|
716
|
+
operations: AlterTableOperation[];
|
|
717
|
+
};
|
|
718
|
+
} | {
|
|
719
|
+
Drop: DropStatement;
|
|
720
|
+
} | {
|
|
721
|
+
Truncate: {
|
|
722
|
+
tableName: ObjectName;
|
|
723
|
+
partitions?: Expr[];
|
|
724
|
+
table: boolean;
|
|
725
|
+
};
|
|
726
|
+
} | {
|
|
727
|
+
SetVariable: {
|
|
728
|
+
local: boolean;
|
|
729
|
+
hivevar: boolean;
|
|
730
|
+
variable: ObjectName;
|
|
731
|
+
value: Expr[];
|
|
732
|
+
};
|
|
733
|
+
} | {
|
|
734
|
+
ShowVariable: {
|
|
735
|
+
variable: Ident[];
|
|
736
|
+
};
|
|
737
|
+
} | {
|
|
738
|
+
ShowCreate: {
|
|
739
|
+
objType: ShowCreateObject;
|
|
740
|
+
objName: ObjectName;
|
|
741
|
+
};
|
|
742
|
+
} | {
|
|
743
|
+
ShowTables: {
|
|
744
|
+
extended: boolean;
|
|
745
|
+
full: boolean;
|
|
746
|
+
dbName?: Ident;
|
|
747
|
+
filter?: ShowStatementFilter;
|
|
748
|
+
};
|
|
749
|
+
} | {
|
|
750
|
+
ShowColumns: {
|
|
751
|
+
extended: boolean;
|
|
752
|
+
full: boolean;
|
|
753
|
+
tableName: ObjectName;
|
|
754
|
+
filter?: ShowStatementFilter;
|
|
755
|
+
};
|
|
756
|
+
} | {
|
|
757
|
+
StartTransaction: {
|
|
758
|
+
modes: TransactionMode[];
|
|
759
|
+
begin: boolean;
|
|
760
|
+
};
|
|
761
|
+
} | {
|
|
762
|
+
Commit: {
|
|
763
|
+
chain: boolean;
|
|
764
|
+
};
|
|
765
|
+
} | {
|
|
766
|
+
Rollback: {
|
|
767
|
+
chain: boolean;
|
|
768
|
+
savepoint?: Ident;
|
|
769
|
+
};
|
|
770
|
+
} | {
|
|
771
|
+
Savepoint: {
|
|
772
|
+
name: Ident;
|
|
773
|
+
};
|
|
774
|
+
} | {
|
|
775
|
+
ReleaseSavepoint: {
|
|
776
|
+
name: Ident;
|
|
777
|
+
};
|
|
778
|
+
} | {
|
|
779
|
+
CreateSchema: {
|
|
780
|
+
schemaName: SchemaName;
|
|
781
|
+
ifNotExists: boolean;
|
|
782
|
+
};
|
|
783
|
+
} | {
|
|
784
|
+
CreateDatabase: {
|
|
785
|
+
dbName: ObjectName;
|
|
786
|
+
ifNotExists: boolean;
|
|
787
|
+
location?: string;
|
|
788
|
+
managedLocation?: string;
|
|
789
|
+
};
|
|
790
|
+
} | {
|
|
791
|
+
Grant: {
|
|
792
|
+
privileges: Privileges;
|
|
793
|
+
objects: GrantObjects;
|
|
794
|
+
grantees: Ident[];
|
|
795
|
+
withGrantOption: boolean;
|
|
796
|
+
grantedBy?: Ident;
|
|
797
|
+
};
|
|
798
|
+
} | {
|
|
799
|
+
Revoke: {
|
|
800
|
+
privileges: Privileges;
|
|
801
|
+
objects: GrantObjects;
|
|
802
|
+
grantees: Ident[];
|
|
803
|
+
grantedBy?: Ident;
|
|
804
|
+
cascade: boolean;
|
|
805
|
+
};
|
|
806
|
+
} | {
|
|
807
|
+
Explain: {
|
|
808
|
+
describeAlias: DescribeAlias;
|
|
809
|
+
analyze: boolean;
|
|
810
|
+
verbose: boolean;
|
|
811
|
+
statement: Statement;
|
|
812
|
+
};
|
|
813
|
+
} | {
|
|
814
|
+
Copy: {
|
|
815
|
+
source: CopySource;
|
|
816
|
+
to: boolean;
|
|
817
|
+
target: CopyTarget;
|
|
818
|
+
options: CopyOption[];
|
|
819
|
+
legacyOptions: CopyLegacyOption[];
|
|
820
|
+
values: string[][];
|
|
821
|
+
};
|
|
822
|
+
} | {
|
|
823
|
+
Close: {
|
|
824
|
+
cursor: CloseCursor;
|
|
825
|
+
};
|
|
826
|
+
} | {
|
|
827
|
+
Declare: {
|
|
828
|
+
name: Ident;
|
|
829
|
+
binary: boolean;
|
|
830
|
+
sensitive?: boolean;
|
|
831
|
+
scroll?: boolean;
|
|
832
|
+
hold?: boolean;
|
|
833
|
+
query: Query;
|
|
834
|
+
};
|
|
835
|
+
} | {
|
|
836
|
+
Fetch: {
|
|
837
|
+
name: Ident;
|
|
838
|
+
direction: FetchDirection;
|
|
839
|
+
into?: ObjectName;
|
|
840
|
+
};
|
|
841
|
+
} | {
|
|
842
|
+
Discard: {
|
|
843
|
+
objectType: DiscardObject;
|
|
844
|
+
};
|
|
845
|
+
} | 'ExplainTable' | {
|
|
846
|
+
Analyze: {
|
|
847
|
+
tableName: ObjectName;
|
|
848
|
+
partitions?: Expr[];
|
|
849
|
+
forColumns: boolean;
|
|
850
|
+
columns: Ident[];
|
|
851
|
+
cacheMetadata: boolean;
|
|
852
|
+
noscan: boolean;
|
|
853
|
+
computeStatistics: boolean;
|
|
854
|
+
};
|
|
855
|
+
} | {
|
|
856
|
+
Merge: {
|
|
857
|
+
into: boolean;
|
|
858
|
+
table: TableFactor;
|
|
859
|
+
source: TableFactor;
|
|
860
|
+
on: Expr;
|
|
861
|
+
clauses: MergeClause[];
|
|
862
|
+
};
|
|
863
|
+
} | {
|
|
864
|
+
Execute: {
|
|
865
|
+
name: ObjectName;
|
|
866
|
+
parameters: Expr[];
|
|
867
|
+
};
|
|
868
|
+
} | {
|
|
869
|
+
Prepare: {
|
|
870
|
+
name: Ident;
|
|
871
|
+
dataTypes: DataType[];
|
|
872
|
+
statement: Statement;
|
|
873
|
+
};
|
|
874
|
+
} | {
|
|
875
|
+
Deallocate: {
|
|
876
|
+
name: Ident;
|
|
877
|
+
prepare: boolean;
|
|
878
|
+
};
|
|
879
|
+
} | {
|
|
880
|
+
Comment: {
|
|
881
|
+
objectType: CommentObject;
|
|
882
|
+
objectName: ObjectName;
|
|
883
|
+
comment?: string;
|
|
884
|
+
ifExists: boolean;
|
|
885
|
+
};
|
|
886
|
+
} | {
|
|
887
|
+
Assert: {
|
|
888
|
+
condition: Expr;
|
|
889
|
+
message?: Expr;
|
|
890
|
+
};
|
|
891
|
+
} | 'Kill' | 'Use';
|
|
892
|
+
export type SqliteOnConflict = 'Rollback' | 'Abort' | 'Fail' | 'Ignore' | 'Replace';
|
|
893
|
+
export type OnInsert = {
|
|
894
|
+
DoUpdate: DoUpdate;
|
|
895
|
+
} | 'DoNothing';
|
|
896
|
+
export interface DoUpdate {
|
|
897
|
+
assignments: Assignment[];
|
|
898
|
+
selection?: Expr;
|
|
899
|
+
}
|
|
900
|
+
export interface Assignment {
|
|
901
|
+
id: Ident[];
|
|
902
|
+
value: Expr;
|
|
903
|
+
}
|
|
904
|
+
export type HiveDistributionStyle = 'PARTITIONED' | 'CLUSTERED' | 'SKEWED' | 'NONE';
|
|
905
|
+
export interface HiveFormat {
|
|
906
|
+
rowFormat?: HiveRowFormat;
|
|
907
|
+
storage?: HiveIOFormat;
|
|
908
|
+
location?: string;
|
|
909
|
+
}
|
|
910
|
+
export type HiveRowFormat = {
|
|
911
|
+
Serde: {
|
|
912
|
+
class: string;
|
|
913
|
+
};
|
|
914
|
+
} | {
|
|
915
|
+
Delimited: null;
|
|
916
|
+
};
|
|
917
|
+
export interface HiveIOFormat {
|
|
918
|
+
inputFormat: string;
|
|
919
|
+
outputFormat: string;
|
|
920
|
+
}
|
|
921
|
+
export interface SqlOption {
|
|
922
|
+
name: Ident;
|
|
923
|
+
value: Value;
|
|
924
|
+
}
|
|
925
|
+
export type FileFormat = 'TEXTFILE' | 'SEQUENCEFILE' | 'ORC' | 'PARQUET' | 'AVRO' | 'RCFILE' | 'JSONFILE';
|
|
926
|
+
export type OnCommit = 'DeleteRows' | 'PreserveRows' | 'Drop';
|
|
927
|
+
export type AlterTableOperation = {
|
|
928
|
+
AddConstraint: TableConstraint;
|
|
929
|
+
} | {
|
|
930
|
+
AddColumn: {
|
|
931
|
+
columnKeyword: boolean;
|
|
932
|
+
ifNotExists: boolean;
|
|
933
|
+
columnDef: ColumnDef;
|
|
934
|
+
};
|
|
935
|
+
} | {
|
|
936
|
+
DropConstraint: {
|
|
937
|
+
ifExists: boolean;
|
|
938
|
+
name: Ident;
|
|
939
|
+
cascade: boolean;
|
|
940
|
+
};
|
|
941
|
+
} | {
|
|
942
|
+
DropColumn: {
|
|
943
|
+
columnName: Ident;
|
|
944
|
+
ifExists: boolean;
|
|
945
|
+
cascade: boolean;
|
|
946
|
+
};
|
|
947
|
+
} | {
|
|
948
|
+
RenameColumn: {
|
|
949
|
+
oldColumnName: Ident;
|
|
950
|
+
newColumnName: Ident;
|
|
951
|
+
};
|
|
952
|
+
} | {
|
|
953
|
+
RenameTable: {
|
|
954
|
+
tableName: ObjectName;
|
|
955
|
+
};
|
|
956
|
+
} | {
|
|
957
|
+
ChangeColumn: {
|
|
958
|
+
oldName: Ident;
|
|
959
|
+
newName: Ident;
|
|
960
|
+
dataType: DataType;
|
|
961
|
+
options: ColumnOption[];
|
|
962
|
+
};
|
|
963
|
+
} | {
|
|
964
|
+
AlterColumn: {
|
|
965
|
+
columnName: Ident;
|
|
966
|
+
op: AlterColumnOperation;
|
|
967
|
+
};
|
|
968
|
+
} | {
|
|
969
|
+
RenameConstraint: {
|
|
970
|
+
oldName: Ident;
|
|
971
|
+
newName: Ident;
|
|
972
|
+
};
|
|
973
|
+
};
|
|
974
|
+
export type AlterColumnOperation = {
|
|
975
|
+
SetNotNull: null;
|
|
976
|
+
} | {
|
|
977
|
+
DropNotNull: null;
|
|
978
|
+
} | {
|
|
979
|
+
SetDefault: Expr;
|
|
980
|
+
} | {
|
|
981
|
+
DropDefault: null;
|
|
982
|
+
} | {
|
|
983
|
+
SetDataType: DataType;
|
|
984
|
+
};
|
|
985
|
+
export interface DropStatement {
|
|
986
|
+
objectType: ObjectType;
|
|
987
|
+
ifExists: boolean;
|
|
988
|
+
names: ObjectName[];
|
|
989
|
+
cascade: boolean;
|
|
990
|
+
restrict: boolean;
|
|
991
|
+
purge: boolean;
|
|
992
|
+
}
|
|
993
|
+
export type ObjectType = 'Table' | 'View' | 'Index' | 'Schema' | 'Role' | 'Sequence' | 'Stage';
|
|
994
|
+
export type ShowCreateObject = 'Event' | 'Function' | 'Procedure' | 'Table' | 'Trigger' | 'View';
|
|
995
|
+
export type ShowStatementFilter = {
|
|
996
|
+
Like: string;
|
|
997
|
+
} | {
|
|
998
|
+
ILike: string;
|
|
999
|
+
} | {
|
|
1000
|
+
Where: Expr;
|
|
1001
|
+
};
|
|
1002
|
+
export type TransactionMode = {
|
|
1003
|
+
AccessMode: TransactionAccessMode;
|
|
1004
|
+
} | {
|
|
1005
|
+
IsolationLevel: TransactionIsolationLevel;
|
|
1006
|
+
};
|
|
1007
|
+
export type TransactionAccessMode = 'ReadOnly' | 'ReadWrite';
|
|
1008
|
+
export type TransactionIsolationLevel = 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable';
|
|
1009
|
+
export type SchemaName = {
|
|
1010
|
+
Simple: ObjectName;
|
|
1011
|
+
} | {
|
|
1012
|
+
UnnamedAuthorization: Ident;
|
|
1013
|
+
} | {
|
|
1014
|
+
NamedAuthorization: [ObjectName, Ident];
|
|
1015
|
+
};
|
|
1016
|
+
export type Privileges = {
|
|
1017
|
+
Actions: Action[];
|
|
1018
|
+
} | 'All';
|
|
1019
|
+
export type Action = 'Select' | {
|
|
1020
|
+
Select: Ident[];
|
|
1021
|
+
} | 'Insert' | {
|
|
1022
|
+
Insert: Ident[];
|
|
1023
|
+
} | 'Update' | {
|
|
1024
|
+
Update: Ident[];
|
|
1025
|
+
} | 'Delete' | 'Truncate' | 'References' | {
|
|
1026
|
+
References: Ident[];
|
|
1027
|
+
} | 'Trigger' | 'Connect' | 'Create' | 'Execute' | 'Temporary' | 'Usage';
|
|
1028
|
+
export type GrantObjects = {
|
|
1029
|
+
AllSequencesInSchema: ObjectName[];
|
|
1030
|
+
} | {
|
|
1031
|
+
AllTablesInSchema: ObjectName[];
|
|
1032
|
+
} | {
|
|
1033
|
+
Schemas: ObjectName[];
|
|
1034
|
+
} | {
|
|
1035
|
+
Sequences: ObjectName[];
|
|
1036
|
+
} | {
|
|
1037
|
+
Tables: ObjectName[];
|
|
1038
|
+
};
|
|
1039
|
+
export type DescribeAlias = 'Describe' | 'Explain' | 'Desc';
|
|
1040
|
+
export type CopySource = {
|
|
1041
|
+
Table: ObjectName;
|
|
1042
|
+
columns: Ident[];
|
|
1043
|
+
} | {
|
|
1044
|
+
Query: Query;
|
|
1045
|
+
};
|
|
1046
|
+
export type CopyTarget = {
|
|
1047
|
+
File: {
|
|
1048
|
+
filename: string;
|
|
1049
|
+
};
|
|
1050
|
+
} | {
|
|
1051
|
+
Program: {
|
|
1052
|
+
command: string;
|
|
1053
|
+
};
|
|
1054
|
+
} | 'Stdout' | 'Stdin';
|
|
1055
|
+
export interface CopyOption {
|
|
1056
|
+
key: string;
|
|
1057
|
+
value?: string;
|
|
1058
|
+
}
|
|
1059
|
+
export interface CopyLegacyOption {
|
|
1060
|
+
key: string;
|
|
1061
|
+
value?: string;
|
|
1062
|
+
}
|
|
1063
|
+
export type CloseCursor = 'All' | {
|
|
1064
|
+
Specific: {
|
|
1065
|
+
name: Ident;
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
export type FetchDirection = {
|
|
1069
|
+
Count: Expr;
|
|
1070
|
+
} | 'Next' | 'Prior' | 'First' | 'Last' | 'Absolute' | 'Relative' | {
|
|
1071
|
+
Absolute: Expr;
|
|
1072
|
+
} | {
|
|
1073
|
+
Relative: Expr;
|
|
1074
|
+
} | 'All' | 'Forward' | {
|
|
1075
|
+
Forward: Expr;
|
|
1076
|
+
} | 'ForwardAll' | 'Backward' | {
|
|
1077
|
+
Backward: Expr;
|
|
1078
|
+
} | 'BackwardAll';
|
|
1079
|
+
export type DiscardObject = 'All' | 'Plans' | 'Sequences' | 'Temp';
|
|
1080
|
+
export type MergeClause = {
|
|
1081
|
+
MatchedUpdate: {
|
|
1082
|
+
predicate?: Expr;
|
|
1083
|
+
assignments: Assignment[];
|
|
1084
|
+
};
|
|
1085
|
+
} | {
|
|
1086
|
+
MatchedDelete: {
|
|
1087
|
+
predicate?: Expr;
|
|
1088
|
+
};
|
|
1089
|
+
} | {
|
|
1090
|
+
NotMatched: {
|
|
1091
|
+
predicate?: Expr;
|
|
1092
|
+
columns: Ident[];
|
|
1093
|
+
values: Values;
|
|
1094
|
+
};
|
|
1095
|
+
};
|
|
1096
|
+
export type CommentObject = 'Column' | 'Table';
|
|
1097
|
+
//# sourceMappingURL=ast.d.ts.map
|