@hdnax/sqlingo.js 0.0.5 → 0.1.0
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/CHANGELOG.md +6 -0
- package/README.repo.md +1 -2
- package/dist/chunk-2YNOERAO.cjs +2 -0
- package/dist/chunk-2YNOERAO.cjs.map +1 -0
- package/dist/chunk-2Z3O2CFM.cjs +19 -0
- package/dist/chunk-2Z3O2CFM.cjs.map +1 -0
- package/dist/chunk-4ZMKB6PV.cjs +2 -0
- package/dist/chunk-4ZMKB6PV.cjs.map +1 -0
- package/dist/chunk-53OWF4GG.js +2 -0
- package/dist/chunk-53OWF4GG.js.map +1 -0
- package/dist/chunk-C4CLTVOW.cjs +2 -0
- package/dist/chunk-C4CLTVOW.cjs.map +1 -0
- package/dist/chunk-DOKMTZYO.cjs +4 -0
- package/dist/chunk-DOKMTZYO.cjs.map +1 -0
- package/dist/chunk-FCGUTI7Y.js +2 -0
- package/dist/chunk-FCGUTI7Y.js.map +1 -0
- package/dist/chunk-IPCIXWCY.js +2 -0
- package/dist/chunk-IPCIXWCY.js.map +1 -0
- package/dist/chunk-KCNOE4DZ.js +19 -0
- package/dist/chunk-KCNOE4DZ.js.map +1 -0
- package/dist/chunk-NRJHX2GZ.js +2 -0
- package/dist/chunk-NRJHX2GZ.js.map +1 -0
- package/dist/chunk-O2J5RKBN.js +2 -0
- package/dist/chunk-O2J5RKBN.js.map +1 -0
- package/dist/chunk-PXUASP5I.js +2 -0
- package/dist/chunk-PXUASP5I.js.map +1 -0
- package/dist/chunk-R7C3ZHVK.cjs +2 -0
- package/dist/chunk-R7C3ZHVK.cjs.map +1 -0
- package/dist/chunk-UHWHUDLE.cjs +2 -0
- package/dist/chunk-UHWHUDLE.cjs.map +1 -0
- package/dist/chunk-WRNYJ54A.cjs +2 -0
- package/dist/chunk-WRNYJ54A.cjs.map +1 -0
- package/dist/chunk-XZQFOICX.cjs +3 -0
- package/dist/chunk-XZQFOICX.cjs.map +1 -0
- package/dist/chunk-YLOQRUXC.js +2 -0
- package/dist/chunk-YLOQRUXC.js.map +1 -0
- package/dist/chunk-YSS2WVCM.cjs +2 -0
- package/dist/chunk-YSS2WVCM.cjs.map +1 -0
- package/dist/chunk-Z5V6VOIN.js +3 -0
- package/dist/chunk-Z5V6VOIN.js.map +1 -0
- package/dist/chunk-ZBFGQPJR.js +4 -0
- package/dist/chunk-ZBFGQPJR.js.map +1 -0
- package/dist/dialects/athena.cjs +2 -0
- package/dist/dialects/athena.cjs.map +1 -0
- package/dist/dialects/athena.d.cts +66 -0
- package/dist/dialects/athena.d.ts +66 -0
- package/dist/dialects/athena.js +2 -0
- package/dist/dialects/athena.js.map +1 -0
- package/dist/dialects/bigquery.cjs +3 -0
- package/dist/dialects/bigquery.cjs.map +1 -0
- package/dist/dialects/bigquery.d.cts +651 -0
- package/dist/dialects/bigquery.d.ts +651 -0
- package/dist/dialects/bigquery.js +3 -0
- package/dist/dialects/bigquery.js.map +1 -0
- package/dist/dialects/clickhouse.cjs +2 -0
- package/dist/dialects/clickhouse.cjs.map +1 -0
- package/dist/dialects/clickhouse.d.cts +634 -0
- package/dist/dialects/clickhouse.d.ts +634 -0
- package/dist/dialects/clickhouse.js +2 -0
- package/dist/dialects/clickhouse.js.map +1 -0
- package/dist/dialects/databricks.cjs +2 -0
- package/dist/dialects/databricks.cjs.map +1 -0
- package/dist/dialects/databricks.d.cts +484 -0
- package/dist/dialects/databricks.d.ts +484 -0
- package/dist/dialects/databricks.js +2 -0
- package/dist/dialects/databricks.js.map +1 -0
- package/dist/dialects/doris.cjs +2 -0
- package/dist/dialects/doris.cjs.map +1 -0
- package/dist/dialects/doris.d.cts +484 -0
- package/dist/dialects/doris.d.ts +484 -0
- package/dist/dialects/doris.js +2 -0
- package/dist/dialects/doris.js.map +1 -0
- package/dist/dialects/dremio.cjs +2 -0
- package/dist/dialects/dremio.cjs.map +1 -0
- package/dist/dialects/dremio.d.cts +522 -0
- package/dist/dialects/dremio.d.ts +522 -0
- package/dist/dialects/dremio.js +2 -0
- package/dist/dialects/dremio.js.map +1 -0
- package/dist/dialects/drill.cjs +2 -0
- package/dist/dialects/drill.cjs.map +1 -0
- package/dist/dialects/drill.d.cts +512 -0
- package/dist/dialects/drill.d.ts +512 -0
- package/dist/dialects/drill.js +2 -0
- package/dist/dialects/drill.js.map +1 -0
- package/dist/dialects/druid.cjs +2 -0
- package/dist/dialects/druid.cjs.map +1 -0
- package/dist/dialects/druid.d.cts +17 -0
- package/dist/dialects/druid.d.ts +17 -0
- package/dist/dialects/druid.js +2 -0
- package/dist/dialects/druid.js.map +1 -0
- package/dist/dialects/duckdb.cjs +86 -0
- package/dist/dialects/duckdb.cjs.map +1 -0
- package/dist/dialects/duckdb.d.cts +756 -0
- package/dist/dialects/duckdb.d.ts +756 -0
- package/dist/dialects/duckdb.js +86 -0
- package/dist/dialects/duckdb.js.map +1 -0
- package/dist/dialects/dune.cjs +2 -0
- package/dist/dialects/dune.cjs.map +1 -0
- package/dist/dialects/dune.d.cts +21 -0
- package/dist/dialects/dune.d.ts +21 -0
- package/dist/dialects/dune.js +2 -0
- package/dist/dialects/dune.js.map +1 -0
- package/dist/dialects/exasol.cjs +2 -0
- package/dist/dialects/exasol.cjs.map +1 -0
- package/dist/dialects/exasol.d.cts +507 -0
- package/dist/dialects/exasol.d.ts +507 -0
- package/dist/dialects/exasol.js +2 -0
- package/dist/dialects/exasol.js.map +1 -0
- package/dist/dialects/fabric.cjs +2 -0
- package/dist/dialects/fabric.cjs.map +1 -0
- package/dist/dialects/fabric.d.cts +463 -0
- package/dist/dialects/fabric.d.ts +463 -0
- package/dist/dialects/fabric.js +2 -0
- package/dist/dialects/fabric.js.map +1 -0
- package/dist/dialects/hive.cjs +2 -0
- package/dist/dialects/hive.cjs.map +1 -0
- package/dist/dialects/hive.d.cts +585 -0
- package/dist/dialects/hive.d.ts +585 -0
- package/dist/dialects/hive.js +2 -0
- package/dist/dialects/hive.js.map +1 -0
- package/dist/dialects/materialize.cjs +2 -0
- package/dist/dialects/materialize.cjs.map +1 -0
- package/dist/dialects/materialize.d.cts +890 -0
- package/dist/dialects/materialize.d.ts +890 -0
- package/dist/dialects/materialize.js +2 -0
- package/dist/dialects/materialize.js.map +1 -0
- package/dist/dialects/mysql.cjs +2 -0
- package/dist/dialects/mysql.cjs.map +1 -0
- package/dist/dialects/mysql.d.cts +292 -0
- package/dist/dialects/mysql.d.ts +292 -0
- package/dist/dialects/mysql.js +2 -0
- package/dist/dialects/mysql.js.map +1 -0
- package/dist/dialects/oracle.cjs +2 -0
- package/dist/dialects/oracle.cjs.map +1 -0
- package/dist/dialects/oracle.d.cts +539 -0
- package/dist/dialects/oracle.d.ts +539 -0
- package/dist/dialects/oracle.js +2 -0
- package/dist/dialects/oracle.js.map +1 -0
- package/dist/dialects/postgres.cjs +2 -0
- package/dist/dialects/postgres.cjs.map +1 -0
- package/dist/dialects/postgres.d.cts +587 -0
- package/dist/dialects/postgres.d.ts +587 -0
- package/dist/dialects/postgres.js +2 -0
- package/dist/dialects/postgres.js.map +1 -0
- package/dist/dialects/presto.cjs +2 -0
- package/dist/dialects/presto.cjs.map +1 -0
- package/dist/dialects/presto.d.cts +173 -0
- package/dist/dialects/presto.d.ts +173 -0
- package/dist/dialects/presto.js +2 -0
- package/dist/dialects/presto.js.map +1 -0
- package/dist/dialects/prql.cjs +2 -0
- package/dist/dialects/prql.cjs.map +1 -0
- package/dist/dialects/prql.d.cts +496 -0
- package/dist/dialects/prql.d.ts +496 -0
- package/dist/dialects/prql.js +2 -0
- package/dist/dialects/prql.js.map +1 -0
- package/dist/dialects/redshift.cjs +2 -0
- package/dist/dialects/redshift.cjs.map +1 -0
- package/dist/dialects/redshift.d.cts +132 -0
- package/dist/dialects/redshift.d.ts +132 -0
- package/dist/dialects/redshift.js +2 -0
- package/dist/dialects/redshift.js.map +1 -0
- package/dist/dialects/risingwave.cjs +2 -0
- package/dist/dialects/risingwave.cjs.map +1 -0
- package/dist/dialects/risingwave.d.cts +478 -0
- package/dist/dialects/risingwave.d.ts +478 -0
- package/dist/dialects/risingwave.js +2 -0
- package/dist/dialects/risingwave.js.map +1 -0
- package/dist/dialects/singlestore.cjs +2 -0
- package/dist/dialects/singlestore.cjs.map +1 -0
- package/dist/dialects/singlestore.d.cts +73 -0
- package/dist/dialects/singlestore.d.ts +73 -0
- package/dist/dialects/singlestore.js +2 -0
- package/dist/dialects/singlestore.js.map +1 -0
- package/dist/dialects/snowflake.cjs +3 -0
- package/dist/dialects/snowflake.cjs.map +1 -0
- package/dist/dialects/snowflake.d.cts +320 -0
- package/dist/dialects/snowflake.d.ts +320 -0
- package/dist/dialects/snowflake.js +3 -0
- package/dist/dialects/snowflake.js.map +1 -0
- package/dist/dialects/solr.cjs +2 -0
- package/dist/dialects/solr.cjs.map +1 -0
- package/dist/dialects/solr.d.cts +458 -0
- package/dist/dialects/solr.d.ts +458 -0
- package/dist/dialects/solr.js +2 -0
- package/dist/dialects/solr.js.map +1 -0
- package/dist/dialects/spark.cjs +2 -0
- package/dist/dialects/spark.cjs.map +1 -0
- package/dist/dialects/spark.d.cts +484 -0
- package/dist/dialects/spark.d.ts +484 -0
- package/dist/dialects/spark.js +2 -0
- package/dist/dialects/spark.js.map +1 -0
- package/dist/dialects/spark2.cjs +2 -0
- package/dist/dialects/spark2.cjs.map +1 -0
- package/dist/dialects/spark2.d.cts +486 -0
- package/dist/dialects/spark2.d.ts +486 -0
- package/dist/dialects/spark2.js +2 -0
- package/dist/dialects/spark2.js.map +1 -0
- package/dist/dialects/sqlite.cjs +2 -0
- package/dist/dialects/sqlite.cjs.map +1 -0
- package/dist/dialects/sqlite.d.cts +510 -0
- package/dist/dialects/sqlite.d.ts +510 -0
- package/dist/dialects/sqlite.js +2 -0
- package/dist/dialects/sqlite.js.map +1 -0
- package/dist/dialects/starrocks.cjs +2 -0
- package/dist/dialects/starrocks.cjs.map +1 -0
- package/dist/dialects/starrocks.d.cts +518 -0
- package/dist/dialects/starrocks.d.ts +518 -0
- package/dist/dialects/starrocks.js +2 -0
- package/dist/dialects/starrocks.js.map +1 -0
- package/dist/dialects/tableau.cjs +2 -0
- package/dist/dialects/tableau.cjs.map +1 -0
- package/dist/dialects/tableau.d.cts +466 -0
- package/dist/dialects/tableau.d.ts +466 -0
- package/dist/dialects/tableau.js +2 -0
- package/dist/dialects/tableau.js.map +1 -0
- package/dist/dialects/teradata.cjs +2 -0
- package/dist/dialects/teradata.cjs.map +1 -0
- package/dist/dialects/teradata.d.cts +539 -0
- package/dist/dialects/teradata.d.ts +539 -0
- package/dist/dialects/teradata.js +2 -0
- package/dist/dialects/teradata.js.map +1 -0
- package/dist/dialects/trino.cjs +2 -0
- package/dist/dialects/trino.cjs.map +1 -0
- package/dist/dialects/trino.d.cts +465 -0
- package/dist/dialects/trino.d.ts +465 -0
- package/dist/dialects/trino.js +2 -0
- package/dist/dialects/trino.js.map +1 -0
- package/dist/dialects/tsql.cjs +2 -0
- package/dist/dialects/tsql.cjs.map +1 -0
- package/dist/dialects/tsql.d.cts +703 -0
- package/dist/dialects/tsql.d.ts +703 -0
- package/dist/dialects/tsql.js +2 -0
- package/dist/dialects/tsql.js.map +1 -0
- package/dist/index.cjs +5 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -14178
- package/dist/index.d.ts +3 -14178
- package/dist/index.js +5 -25
- package/dist/index.js.map +1 -1
- package/dist/tokens-VcMD09XM.d.cts +15805 -0
- package/dist/tokens-VcMD09XM.d.ts +15805 -0
- package/package.json +171 -5
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import { c as Dialect, d as Dialects, E as Expression, bo as TypeAnnotator, $ as DataTypeExprKind, a0 as NormalizationStrategy, m as Tokenizer, l as TokenType, i as Parser, dH as TransformExpr, dI as QueryTransformExpr, aT as QuantileExpr, co as ApproxQuantileExpr, dJ as ParameterExpr, G as Generator, dK as SubqueryExpr, cO as SelectExpr, dL as SetOperationExpr, dM as InsertExpr, aj as PropertiesLocation, ag as UnnestExpr, dN as JsonPathKeyExpr, dO as SchemaExpr, dP as ConstraintExpr, dQ as RowFormatSerdePropertyExpr, dA as ArrayAggExpr, bN as TruncExpr, b5 as DataTypeExpr, ar as VersionExpr, dw as StructExpr, bf as ColumnDefExpr, de as AlterColumnExpr, cR as AlterSetExpr, dR as SerdePropertiesExpr, dS as ExistsExpr, am as TimeToStrExpr, dm as FileFormatPropertyExpr } from '../tokens-VcMD09XM.js';
|
|
2
|
+
|
|
3
|
+
declare function buildWithIgnoreNulls(ExpClass: typeof Expression): (args: Expression[]) => Expression;
|
|
4
|
+
declare class HiveTokenizer extends Tokenizer {
|
|
5
|
+
static get QUOTES(): string[];
|
|
6
|
+
static get IDENTIFIERS(): string[];
|
|
7
|
+
static get STRING_ESCAPES(): string[];
|
|
8
|
+
static get SINGLE_TOKENS(): {
|
|
9
|
+
$: TokenType;
|
|
10
|
+
};
|
|
11
|
+
static get ORIGINAL_KEYWORDS(): Record<string, TokenType>;
|
|
12
|
+
static get NUMERIC_LITERALS(): {
|
|
13
|
+
L: string;
|
|
14
|
+
S: string;
|
|
15
|
+
Y: string;
|
|
16
|
+
D: string;
|
|
17
|
+
F: string;
|
|
18
|
+
BD: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
declare class HiveParser extends Parser {
|
|
22
|
+
static get ID_VAR_TOKENS(): Set<TokenType>;
|
|
23
|
+
static get NO_PAREN_FUNCTIONS(): {
|
|
24
|
+
lParen?: typeof Expression | undefined;
|
|
25
|
+
rParen?: typeof Expression | undefined;
|
|
26
|
+
lBracket?: typeof Expression | undefined;
|
|
27
|
+
rBracket?: typeof Expression | undefined;
|
|
28
|
+
lBrace?: typeof Expression | undefined;
|
|
29
|
+
rBrace?: typeof Expression | undefined;
|
|
30
|
+
comma?: typeof Expression | undefined;
|
|
31
|
+
dot?: typeof Expression | undefined;
|
|
32
|
+
dash?: typeof Expression | undefined;
|
|
33
|
+
plus?: typeof Expression | undefined;
|
|
34
|
+
colon?: typeof Expression | undefined;
|
|
35
|
+
dotcolon?: typeof Expression | undefined;
|
|
36
|
+
dcolon?: typeof Expression | undefined;
|
|
37
|
+
dcolondollar?: typeof Expression | undefined;
|
|
38
|
+
dcolonpercent?: typeof Expression | undefined;
|
|
39
|
+
dcolonqmark?: typeof Expression | undefined;
|
|
40
|
+
dqmark?: typeof Expression | undefined;
|
|
41
|
+
semicolon?: typeof Expression | undefined;
|
|
42
|
+
star?: typeof Expression | undefined;
|
|
43
|
+
backslash?: typeof Expression | undefined;
|
|
44
|
+
slash?: typeof Expression | undefined;
|
|
45
|
+
lt?: typeof Expression | undefined;
|
|
46
|
+
lte?: typeof Expression | undefined;
|
|
47
|
+
gt?: typeof Expression | undefined;
|
|
48
|
+
gte?: typeof Expression | undefined;
|
|
49
|
+
not?: typeof Expression | undefined;
|
|
50
|
+
eq?: typeof Expression | undefined;
|
|
51
|
+
neq?: typeof Expression | undefined;
|
|
52
|
+
nullsafeEq?: typeof Expression | undefined;
|
|
53
|
+
colonEq?: typeof Expression | undefined;
|
|
54
|
+
colonGt?: typeof Expression | undefined;
|
|
55
|
+
ncolonGt?: typeof Expression | undefined;
|
|
56
|
+
and?: typeof Expression | undefined;
|
|
57
|
+
or?: typeof Expression | undefined;
|
|
58
|
+
amp?: typeof Expression | undefined;
|
|
59
|
+
dpipe?: typeof Expression | undefined;
|
|
60
|
+
pipeGt?: typeof Expression | undefined;
|
|
61
|
+
pipe?: typeof Expression | undefined;
|
|
62
|
+
pipeSlash?: typeof Expression | undefined;
|
|
63
|
+
dpipeSlash?: typeof Expression | undefined;
|
|
64
|
+
caret?: typeof Expression | undefined;
|
|
65
|
+
caretAt?: typeof Expression | undefined;
|
|
66
|
+
tilde?: typeof Expression | undefined;
|
|
67
|
+
arrow?: typeof Expression | undefined;
|
|
68
|
+
darrow?: typeof Expression | undefined;
|
|
69
|
+
farrow?: typeof Expression | undefined;
|
|
70
|
+
hash?: typeof Expression | undefined;
|
|
71
|
+
hashArrow?: typeof Expression | undefined;
|
|
72
|
+
dhashArrow?: typeof Expression | undefined;
|
|
73
|
+
lrArrow?: typeof Expression | undefined;
|
|
74
|
+
dat?: typeof Expression | undefined;
|
|
75
|
+
ltAt?: typeof Expression | undefined;
|
|
76
|
+
atGt?: typeof Expression | undefined;
|
|
77
|
+
dollar?: typeof Expression | undefined;
|
|
78
|
+
parameter?: typeof Expression | undefined;
|
|
79
|
+
session?: typeof Expression | undefined;
|
|
80
|
+
sessionParameter?: typeof Expression | undefined;
|
|
81
|
+
sessionUser?: typeof Expression | undefined;
|
|
82
|
+
damp?: typeof Expression | undefined;
|
|
83
|
+
ampLt?: typeof Expression | undefined;
|
|
84
|
+
ampGt?: typeof Expression | undefined;
|
|
85
|
+
adjacent?: typeof Expression | undefined;
|
|
86
|
+
xor?: typeof Expression | undefined;
|
|
87
|
+
dstar?: typeof Expression | undefined;
|
|
88
|
+
qmarkAmp?: typeof Expression | undefined;
|
|
89
|
+
qmarkPipe?: typeof Expression | undefined;
|
|
90
|
+
hashDash?: typeof Expression | undefined;
|
|
91
|
+
exclamation?: typeof Expression | undefined;
|
|
92
|
+
uriStart?: typeof Expression | undefined;
|
|
93
|
+
blockStart?: typeof Expression | undefined;
|
|
94
|
+
blockEnd?: typeof Expression | undefined;
|
|
95
|
+
space?: typeof Expression | undefined;
|
|
96
|
+
break?: typeof Expression | undefined;
|
|
97
|
+
string?: typeof Expression | undefined;
|
|
98
|
+
number?: typeof Expression | undefined;
|
|
99
|
+
identifier?: typeof Expression | undefined;
|
|
100
|
+
database?: typeof Expression | undefined;
|
|
101
|
+
column?: typeof Expression | undefined;
|
|
102
|
+
columnDef?: typeof Expression | undefined;
|
|
103
|
+
schema?: typeof Expression | undefined;
|
|
104
|
+
table?: typeof Expression | undefined;
|
|
105
|
+
warehouse?: typeof Expression | undefined;
|
|
106
|
+
stage?: typeof Expression | undefined;
|
|
107
|
+
streamlit?: typeof Expression | undefined;
|
|
108
|
+
var?: typeof Expression | undefined;
|
|
109
|
+
bitString?: typeof Expression | undefined;
|
|
110
|
+
hexString?: typeof Expression | undefined;
|
|
111
|
+
byteString?: typeof Expression | undefined;
|
|
112
|
+
nationalString?: typeof Expression | undefined;
|
|
113
|
+
rawString?: typeof Expression | undefined;
|
|
114
|
+
heredocString?: typeof Expression | undefined;
|
|
115
|
+
unicodeString?: typeof Expression | undefined;
|
|
116
|
+
bit?: typeof Expression | undefined;
|
|
117
|
+
boolean?: typeof Expression | undefined;
|
|
118
|
+
tinyint?: typeof Expression | undefined;
|
|
119
|
+
utinyint?: typeof Expression | undefined;
|
|
120
|
+
smallint?: typeof Expression | undefined;
|
|
121
|
+
usmallint?: typeof Expression | undefined;
|
|
122
|
+
mediumint?: typeof Expression | undefined;
|
|
123
|
+
umediumint?: typeof Expression | undefined;
|
|
124
|
+
int?: typeof Expression | undefined;
|
|
125
|
+
uint?: typeof Expression | undefined;
|
|
126
|
+
bigint?: typeof Expression | undefined;
|
|
127
|
+
ubigint?: typeof Expression | undefined;
|
|
128
|
+
bignum?: typeof Expression | undefined;
|
|
129
|
+
int128?: typeof Expression | undefined;
|
|
130
|
+
uint128?: typeof Expression | undefined;
|
|
131
|
+
int256?: typeof Expression | undefined;
|
|
132
|
+
uint256?: typeof Expression | undefined;
|
|
133
|
+
float?: typeof Expression | undefined;
|
|
134
|
+
double?: typeof Expression | undefined;
|
|
135
|
+
udouble?: typeof Expression | undefined;
|
|
136
|
+
decimal?: typeof Expression | undefined;
|
|
137
|
+
decimal32?: typeof Expression | undefined;
|
|
138
|
+
decimal64?: typeof Expression | undefined;
|
|
139
|
+
decimal128?: typeof Expression | undefined;
|
|
140
|
+
decimal256?: typeof Expression | undefined;
|
|
141
|
+
decfloat?: typeof Expression | undefined;
|
|
142
|
+
udecimal?: typeof Expression | undefined;
|
|
143
|
+
bigdecimal?: typeof Expression | undefined;
|
|
144
|
+
char?: typeof Expression | undefined;
|
|
145
|
+
nchar?: typeof Expression | undefined;
|
|
146
|
+
varchar?: typeof Expression | undefined;
|
|
147
|
+
nvarchar?: typeof Expression | undefined;
|
|
148
|
+
bpchar?: typeof Expression | undefined;
|
|
149
|
+
text?: typeof Expression | undefined;
|
|
150
|
+
mediumtext?: typeof Expression | undefined;
|
|
151
|
+
longtext?: typeof Expression | undefined;
|
|
152
|
+
blob?: typeof Expression | undefined;
|
|
153
|
+
mediumblob?: typeof Expression | undefined;
|
|
154
|
+
longblob?: typeof Expression | undefined;
|
|
155
|
+
tinyblob?: typeof Expression | undefined;
|
|
156
|
+
tinytext?: typeof Expression | undefined;
|
|
157
|
+
name?: typeof Expression | undefined;
|
|
158
|
+
binary?: typeof Expression | undefined;
|
|
159
|
+
varbinary?: typeof Expression | undefined;
|
|
160
|
+
json?: typeof Expression | undefined;
|
|
161
|
+
jsonb?: typeof Expression | undefined;
|
|
162
|
+
time?: typeof Expression | undefined;
|
|
163
|
+
timetz?: typeof Expression | undefined;
|
|
164
|
+
timeNs?: typeof Expression | undefined;
|
|
165
|
+
timestamp?: typeof Expression | undefined;
|
|
166
|
+
timestamptz?: typeof Expression | undefined;
|
|
167
|
+
timestampltz?: typeof Expression | undefined;
|
|
168
|
+
timestampntz?: typeof Expression | undefined;
|
|
169
|
+
timestampS?: typeof Expression | undefined;
|
|
170
|
+
timestampMs?: typeof Expression | undefined;
|
|
171
|
+
timestampNs?: typeof Expression | undefined;
|
|
172
|
+
datetime?: typeof Expression | undefined;
|
|
173
|
+
datetime2?: typeof Expression | undefined;
|
|
174
|
+
datetime64?: typeof Expression | undefined;
|
|
175
|
+
smalldatetime?: typeof Expression | undefined;
|
|
176
|
+
date?: typeof Expression | undefined;
|
|
177
|
+
date32?: typeof Expression | undefined;
|
|
178
|
+
int4range?: typeof Expression | undefined;
|
|
179
|
+
int4multirange?: typeof Expression | undefined;
|
|
180
|
+
int8range?: typeof Expression | undefined;
|
|
181
|
+
int8multirange?: typeof Expression | undefined;
|
|
182
|
+
numrange?: typeof Expression | undefined;
|
|
183
|
+
nummultirange?: typeof Expression | undefined;
|
|
184
|
+
tsrange?: typeof Expression | undefined;
|
|
185
|
+
tsmultirange?: typeof Expression | undefined;
|
|
186
|
+
tstzrange?: typeof Expression | undefined;
|
|
187
|
+
tstzmultirange?: typeof Expression | undefined;
|
|
188
|
+
daterange?: typeof Expression | undefined;
|
|
189
|
+
datemultirange?: typeof Expression | undefined;
|
|
190
|
+
uuid?: typeof Expression | undefined;
|
|
191
|
+
geography?: typeof Expression | undefined;
|
|
192
|
+
geographypoint?: typeof Expression | undefined;
|
|
193
|
+
nullable?: typeof Expression | undefined;
|
|
194
|
+
geometry?: typeof Expression | undefined;
|
|
195
|
+
point?: typeof Expression | undefined;
|
|
196
|
+
ring?: typeof Expression | undefined;
|
|
197
|
+
linestring?: typeof Expression | undefined;
|
|
198
|
+
localtime?: typeof Expression | undefined;
|
|
199
|
+
localtimestamp?: typeof Expression | undefined;
|
|
200
|
+
systimestamp?: typeof Expression | undefined;
|
|
201
|
+
multilinestring?: typeof Expression | undefined;
|
|
202
|
+
polygon?: typeof Expression | undefined;
|
|
203
|
+
multipolygon?: typeof Expression | undefined;
|
|
204
|
+
hllsketch?: typeof Expression | undefined;
|
|
205
|
+
hstore?: typeof Expression | undefined;
|
|
206
|
+
super?: typeof Expression | undefined;
|
|
207
|
+
serial?: typeof Expression | undefined;
|
|
208
|
+
smallserial?: typeof Expression | undefined;
|
|
209
|
+
bigserial?: typeof Expression | undefined;
|
|
210
|
+
xml?: typeof Expression | undefined;
|
|
211
|
+
year?: typeof Expression | undefined;
|
|
212
|
+
userdefined?: typeof Expression | undefined;
|
|
213
|
+
money?: typeof Expression | undefined;
|
|
214
|
+
smallmoney?: typeof Expression | undefined;
|
|
215
|
+
rowversion?: typeof Expression | undefined;
|
|
216
|
+
image?: typeof Expression | undefined;
|
|
217
|
+
variant?: typeof Expression | undefined;
|
|
218
|
+
object?: typeof Expression | undefined;
|
|
219
|
+
inet?: typeof Expression | undefined;
|
|
220
|
+
ipaddress?: typeof Expression | undefined;
|
|
221
|
+
ipprefix?: typeof Expression | undefined;
|
|
222
|
+
ipv4?: typeof Expression | undefined;
|
|
223
|
+
ipv6?: typeof Expression | undefined;
|
|
224
|
+
enum?: typeof Expression | undefined;
|
|
225
|
+
enum8?: typeof Expression | undefined;
|
|
226
|
+
enum16?: typeof Expression | undefined;
|
|
227
|
+
fixedstring?: typeof Expression | undefined;
|
|
228
|
+
lowcardinality?: typeof Expression | undefined;
|
|
229
|
+
nested?: typeof Expression | undefined;
|
|
230
|
+
aggregatefunction?: typeof Expression | undefined;
|
|
231
|
+
simpleaggregatefunction?: typeof Expression | undefined;
|
|
232
|
+
tdigest?: typeof Expression | undefined;
|
|
233
|
+
unknown?: typeof Expression | undefined;
|
|
234
|
+
vector?: typeof Expression | undefined;
|
|
235
|
+
dynamic?: typeof Expression | undefined;
|
|
236
|
+
void?: typeof Expression | undefined;
|
|
237
|
+
alias?: typeof Expression | undefined;
|
|
238
|
+
alter?: typeof Expression | undefined;
|
|
239
|
+
all?: typeof Expression | undefined;
|
|
240
|
+
anti?: typeof Expression | undefined;
|
|
241
|
+
any?: typeof Expression | undefined;
|
|
242
|
+
apply?: typeof Expression | undefined;
|
|
243
|
+
array?: typeof Expression | undefined;
|
|
244
|
+
asc?: typeof Expression | undefined;
|
|
245
|
+
asof?: typeof Expression | undefined;
|
|
246
|
+
attach?: typeof Expression | undefined;
|
|
247
|
+
autoIncrement?: typeof Expression | undefined;
|
|
248
|
+
begin?: typeof Expression | undefined;
|
|
249
|
+
between?: typeof Expression | undefined;
|
|
250
|
+
bulkCollectInto?: typeof Expression | undefined;
|
|
251
|
+
cache?: typeof Expression | undefined;
|
|
252
|
+
case?: typeof Expression | undefined;
|
|
253
|
+
characterSet?: typeof Expression | undefined;
|
|
254
|
+
clusterBy?: typeof Expression | undefined;
|
|
255
|
+
collate?: typeof Expression | undefined;
|
|
256
|
+
command?: typeof Expression | undefined;
|
|
257
|
+
comment?: typeof Expression | undefined;
|
|
258
|
+
commit?: typeof Expression | undefined;
|
|
259
|
+
connectBy?: typeof Expression | undefined;
|
|
260
|
+
constraint?: typeof Expression | undefined;
|
|
261
|
+
copy?: typeof Expression | undefined;
|
|
262
|
+
create?: typeof Expression | undefined;
|
|
263
|
+
cross?: typeof Expression | undefined;
|
|
264
|
+
cube?: typeof Expression | undefined;
|
|
265
|
+
currentDate?: typeof Expression | undefined;
|
|
266
|
+
currentDatetime?: typeof Expression | undefined;
|
|
267
|
+
currentSchema?: typeof Expression | undefined;
|
|
268
|
+
currentTime?: typeof Expression | undefined;
|
|
269
|
+
currentTimestamp?: typeof Expression | undefined;
|
|
270
|
+
currentUser?: typeof Expression | undefined;
|
|
271
|
+
currentRole?: typeof Expression | undefined;
|
|
272
|
+
currentCatalog?: typeof Expression | undefined;
|
|
273
|
+
declare?: typeof Expression | undefined;
|
|
274
|
+
default?: typeof Expression | undefined;
|
|
275
|
+
delete?: typeof Expression | undefined;
|
|
276
|
+
desc?: typeof Expression | undefined;
|
|
277
|
+
describe?: typeof Expression | undefined;
|
|
278
|
+
detach?: typeof Expression | undefined;
|
|
279
|
+
dictionary?: typeof Expression | undefined;
|
|
280
|
+
distinct?: typeof Expression | undefined;
|
|
281
|
+
distributeBy?: typeof Expression | undefined;
|
|
282
|
+
div?: typeof Expression | undefined;
|
|
283
|
+
drop?: typeof Expression | undefined;
|
|
284
|
+
else?: typeof Expression | undefined;
|
|
285
|
+
end?: typeof Expression | undefined;
|
|
286
|
+
escape?: typeof Expression | undefined;
|
|
287
|
+
except?: typeof Expression | undefined;
|
|
288
|
+
execute?: typeof Expression | undefined;
|
|
289
|
+
exists?: typeof Expression | undefined;
|
|
290
|
+
false?: typeof Expression | undefined;
|
|
291
|
+
fetch?: typeof Expression | undefined;
|
|
292
|
+
file?: typeof Expression | undefined;
|
|
293
|
+
fileFormat?: typeof Expression | undefined;
|
|
294
|
+
filter?: typeof Expression | undefined;
|
|
295
|
+
final?: typeof Expression | undefined;
|
|
296
|
+
first?: typeof Expression | undefined;
|
|
297
|
+
for?: typeof Expression | undefined;
|
|
298
|
+
force?: typeof Expression | undefined;
|
|
299
|
+
foreignKey?: typeof Expression | undefined;
|
|
300
|
+
format?: typeof Expression | undefined;
|
|
301
|
+
from?: typeof Expression | undefined;
|
|
302
|
+
full?: typeof Expression | undefined;
|
|
303
|
+
function?: typeof Expression | undefined;
|
|
304
|
+
get?: typeof Expression | undefined;
|
|
305
|
+
glob?: typeof Expression | undefined;
|
|
306
|
+
global?: typeof Expression | undefined;
|
|
307
|
+
grant?: typeof Expression | undefined;
|
|
308
|
+
groupBy?: typeof Expression | undefined;
|
|
309
|
+
groupingSets?: typeof Expression | undefined;
|
|
310
|
+
having?: typeof Expression | undefined;
|
|
311
|
+
hint?: typeof Expression | undefined;
|
|
312
|
+
ignore?: typeof Expression | undefined;
|
|
313
|
+
ilike?: typeof Expression | undefined;
|
|
314
|
+
in?: typeof Expression | undefined;
|
|
315
|
+
index?: typeof Expression | undefined;
|
|
316
|
+
indexedBy?: typeof Expression | undefined;
|
|
317
|
+
inner?: typeof Expression | undefined;
|
|
318
|
+
insert?: typeof Expression | undefined;
|
|
319
|
+
install?: typeof Expression | undefined;
|
|
320
|
+
intersect?: typeof Expression | undefined;
|
|
321
|
+
interval?: typeof Expression | undefined;
|
|
322
|
+
into?: typeof Expression | undefined;
|
|
323
|
+
introducer?: typeof Expression | undefined;
|
|
324
|
+
irlike?: typeof Expression | undefined;
|
|
325
|
+
is?: typeof Expression | undefined;
|
|
326
|
+
isnull?: typeof Expression | undefined;
|
|
327
|
+
join?: typeof Expression | undefined;
|
|
328
|
+
joinMarker?: typeof Expression | undefined;
|
|
329
|
+
keep?: typeof Expression | undefined;
|
|
330
|
+
key?: typeof Expression | undefined;
|
|
331
|
+
kill?: typeof Expression | undefined;
|
|
332
|
+
language?: typeof Expression | undefined;
|
|
333
|
+
lateral?: typeof Expression | undefined;
|
|
334
|
+
left?: typeof Expression | undefined;
|
|
335
|
+
like?: typeof Expression | undefined;
|
|
336
|
+
limit?: typeof Expression | undefined;
|
|
337
|
+
list?: typeof Expression | undefined;
|
|
338
|
+
load?: typeof Expression | undefined;
|
|
339
|
+
lock?: typeof Expression | undefined;
|
|
340
|
+
map?: typeof Expression | undefined;
|
|
341
|
+
match?: typeof Expression | undefined;
|
|
342
|
+
matchCondition?: typeof Expression | undefined;
|
|
343
|
+
matchRecognize?: typeof Expression | undefined;
|
|
344
|
+
memberOf?: typeof Expression | undefined;
|
|
345
|
+
merge?: typeof Expression | undefined;
|
|
346
|
+
mod?: typeof Expression | undefined;
|
|
347
|
+
model?: typeof Expression | undefined;
|
|
348
|
+
natural?: typeof Expression | undefined;
|
|
349
|
+
next?: typeof Expression | undefined;
|
|
350
|
+
nothing?: typeof Expression | undefined;
|
|
351
|
+
notnull?: typeof Expression | undefined;
|
|
352
|
+
null?: typeof Expression | undefined;
|
|
353
|
+
objectIdentifier?: typeof Expression | undefined;
|
|
354
|
+
offset?: typeof Expression | undefined;
|
|
355
|
+
on?: typeof Expression | undefined;
|
|
356
|
+
only?: typeof Expression | undefined;
|
|
357
|
+
operator?: typeof Expression | undefined;
|
|
358
|
+
orderBy?: typeof Expression | undefined;
|
|
359
|
+
orderSiblingsBy?: typeof Expression | undefined;
|
|
360
|
+
ordered?: typeof Expression | undefined;
|
|
361
|
+
ordinality?: typeof Expression | undefined;
|
|
362
|
+
out?: typeof Expression | undefined;
|
|
363
|
+
inout?: typeof Expression | undefined;
|
|
364
|
+
outer?: typeof Expression | undefined;
|
|
365
|
+
over?: typeof Expression | undefined;
|
|
366
|
+
overlaps?: typeof Expression | undefined;
|
|
367
|
+
overwrite?: typeof Expression | undefined;
|
|
368
|
+
partition?: typeof Expression | undefined;
|
|
369
|
+
partitionBy?: typeof Expression | undefined;
|
|
370
|
+
percent?: typeof Expression | undefined;
|
|
371
|
+
pivot?: typeof Expression | undefined;
|
|
372
|
+
placeholder?: typeof Expression | undefined;
|
|
373
|
+
positional?: typeof Expression | undefined;
|
|
374
|
+
pragma?: typeof Expression | undefined;
|
|
375
|
+
prewhere?: typeof Expression | undefined;
|
|
376
|
+
primaryKey?: typeof Expression | undefined;
|
|
377
|
+
procedure?: typeof Expression | undefined;
|
|
378
|
+
properties?: typeof Expression | undefined;
|
|
379
|
+
pseudoType?: typeof Expression | undefined;
|
|
380
|
+
put?: typeof Expression | undefined;
|
|
381
|
+
qualify?: typeof Expression | undefined;
|
|
382
|
+
quote?: typeof Expression | undefined;
|
|
383
|
+
qdcolon?: typeof Expression | undefined;
|
|
384
|
+
range?: typeof Expression | undefined;
|
|
385
|
+
recursive?: typeof Expression | undefined;
|
|
386
|
+
refresh?: typeof Expression | undefined;
|
|
387
|
+
rename?: typeof Expression | undefined;
|
|
388
|
+
replace?: typeof Expression | undefined;
|
|
389
|
+
returning?: typeof Expression | undefined;
|
|
390
|
+
revoke?: typeof Expression | undefined;
|
|
391
|
+
references?: typeof Expression | undefined;
|
|
392
|
+
right?: typeof Expression | undefined;
|
|
393
|
+
rlike?: typeof Expression | undefined;
|
|
394
|
+
rollback?: typeof Expression | undefined;
|
|
395
|
+
rollup?: typeof Expression | undefined;
|
|
396
|
+
row?: typeof Expression | undefined;
|
|
397
|
+
rows?: typeof Expression | undefined;
|
|
398
|
+
select?: typeof Expression | undefined;
|
|
399
|
+
semi?: typeof Expression | undefined;
|
|
400
|
+
separator?: typeof Expression | undefined;
|
|
401
|
+
sequence?: typeof Expression | undefined;
|
|
402
|
+
serdeProperties?: typeof Expression | undefined;
|
|
403
|
+
set?: typeof Expression | undefined;
|
|
404
|
+
settings?: typeof Expression | undefined;
|
|
405
|
+
show?: typeof Expression | undefined;
|
|
406
|
+
similarTo?: typeof Expression | undefined;
|
|
407
|
+
some?: typeof Expression | undefined;
|
|
408
|
+
sortBy?: typeof Expression | undefined;
|
|
409
|
+
soundsLike?: typeof Expression | undefined;
|
|
410
|
+
startWith?: typeof Expression | undefined;
|
|
411
|
+
storageIntegration?: typeof Expression | undefined;
|
|
412
|
+
straightJoin?: typeof Expression | undefined;
|
|
413
|
+
struct?: typeof Expression | undefined;
|
|
414
|
+
summarize?: typeof Expression | undefined;
|
|
415
|
+
tableSample?: typeof Expression | undefined;
|
|
416
|
+
tag?: typeof Expression | undefined;
|
|
417
|
+
temporary?: typeof Expression | undefined;
|
|
418
|
+
top?: typeof Expression | undefined;
|
|
419
|
+
then?: typeof Expression | undefined;
|
|
420
|
+
true?: typeof Expression | undefined;
|
|
421
|
+
truncate?: typeof Expression | undefined;
|
|
422
|
+
uncache?: typeof Expression | undefined;
|
|
423
|
+
union?: typeof Expression | undefined;
|
|
424
|
+
unnest?: typeof Expression | undefined;
|
|
425
|
+
unpivot?: typeof Expression | undefined;
|
|
426
|
+
update?: typeof Expression | undefined;
|
|
427
|
+
use?: typeof Expression | undefined;
|
|
428
|
+
using?: typeof Expression | undefined;
|
|
429
|
+
values?: typeof Expression | undefined;
|
|
430
|
+
variadic?: typeof Expression | undefined;
|
|
431
|
+
view?: typeof Expression | undefined;
|
|
432
|
+
semanticView?: typeof Expression | undefined;
|
|
433
|
+
volatile?: typeof Expression | undefined;
|
|
434
|
+
when?: typeof Expression | undefined;
|
|
435
|
+
where?: typeof Expression | undefined;
|
|
436
|
+
window?: typeof Expression | undefined;
|
|
437
|
+
with?: typeof Expression | undefined;
|
|
438
|
+
unique?: typeof Expression | undefined;
|
|
439
|
+
utcDate?: typeof Expression | undefined;
|
|
440
|
+
utcTime?: typeof Expression | undefined;
|
|
441
|
+
utcTimestamp?: typeof Expression | undefined;
|
|
442
|
+
versionSnapshot?: typeof Expression | undefined;
|
|
443
|
+
timestampSnapshot?: typeof Expression | undefined;
|
|
444
|
+
option?: typeof Expression | undefined;
|
|
445
|
+
sink?: typeof Expression | undefined;
|
|
446
|
+
source?: typeof Expression | undefined;
|
|
447
|
+
analyze?: typeof Expression | undefined;
|
|
448
|
+
namespace?: typeof Expression | undefined;
|
|
449
|
+
export?: typeof Expression | undefined;
|
|
450
|
+
hiveTokenStream?: typeof Expression | undefined;
|
|
451
|
+
};
|
|
452
|
+
static LOG_DEFAULTS_TO_LN: boolean;
|
|
453
|
+
static STRICT_CAST: boolean;
|
|
454
|
+
static VALUES_FOLLOWED_BY_PAREN: boolean;
|
|
455
|
+
static JOINS_HAVE_EQUAL_PRECEDENCE: boolean;
|
|
456
|
+
static ADD_JOIN_ON_TRUE: boolean;
|
|
457
|
+
static ALTER_TABLE_PARTITIONS: boolean;
|
|
458
|
+
static CHANGE_COLUMN_ALTER_SYNTAX: boolean;
|
|
459
|
+
static get FUNCTION_PARSERS(): Partial<Record<string, (this: Parser) => Expression | undefined>>;
|
|
460
|
+
static get FUNCTIONS(): Record<string, (expression: Expression[], options: {
|
|
461
|
+
dialect: Dialect;
|
|
462
|
+
}) => Expression>;
|
|
463
|
+
static get NO_PAREN_FUNCTION_PARSERS(): Partial<Record<string, (this: Parser) => Expression | undefined>>;
|
|
464
|
+
static get PROPERTY_PARSERS(): Record<string, (this: Parser, ...args: unknown[]) => Expression | Expression[] | undefined>;
|
|
465
|
+
static get ALTER_PARSERS(): Partial<Record<string, (this: Parser) => Expression | Expression[] | undefined>>;
|
|
466
|
+
parseTransform(): TransformExpr | QueryTransformExpr | undefined;
|
|
467
|
+
parseQuantileFunction(FuncClass: typeof QuantileExpr | typeof ApproxQuantileExpr): QuantileExpr | ApproxQuantileExpr;
|
|
468
|
+
parseTypes(options?: {
|
|
469
|
+
checkFunc?: boolean;
|
|
470
|
+
schema?: boolean;
|
|
471
|
+
allowIdentifiers?: boolean;
|
|
472
|
+
}): Expression | undefined;
|
|
473
|
+
parseAlterTableChange(): Expression | undefined;
|
|
474
|
+
parsePartitionAndOrder(): [Expression[], Expression | undefined];
|
|
475
|
+
parseParameter(): ParameterExpr;
|
|
476
|
+
toPropEq(expression: Expression, index: number): Expression;
|
|
477
|
+
static get TABLE_ALIAS_TOKENS(): Set<TokenType>;
|
|
478
|
+
}
|
|
479
|
+
declare class HiveGenerator extends Generator {
|
|
480
|
+
static SUPPORTS_DECODE_CASE: boolean;
|
|
481
|
+
static readonly SELECT_KINDS: string[];
|
|
482
|
+
static TRY_SUPPORTED: boolean;
|
|
483
|
+
static SUPPORTS_UESCAPE: boolean;
|
|
484
|
+
static LIMIT_FETCH: string;
|
|
485
|
+
static TABLESAMPLE_WITH_METHOD: boolean;
|
|
486
|
+
static JOIN_HINTS: boolean;
|
|
487
|
+
static TABLE_HINTS: boolean;
|
|
488
|
+
static QUERY_HINTS: boolean;
|
|
489
|
+
static INDEX_ON: string;
|
|
490
|
+
static EXTRACT_ALLOWS_QUOTES: boolean;
|
|
491
|
+
static NVL2_SUPPORTED: boolean;
|
|
492
|
+
static LAST_DAY_SUPPORTS_DATE_PART: boolean;
|
|
493
|
+
static JSON_PATH_SINGLE_QUOTE_ESCAPE: boolean;
|
|
494
|
+
static SUPPORTS_TO_NUMBER: boolean;
|
|
495
|
+
static WITH_PROPERTIES_PREFIX: string;
|
|
496
|
+
static PARSE_JSON_NAME?: string;
|
|
497
|
+
static PAD_FILL_PATTERN_IS_REQUIRED: boolean;
|
|
498
|
+
static SUPPORTS_MEDIAN: boolean;
|
|
499
|
+
static ARRAY_SIZE_NAME: string;
|
|
500
|
+
static ALTER_SET_TYPE: string;
|
|
501
|
+
static get EXPRESSIONS_WITHOUT_NESTED_CTES(): Set<typeof SubqueryExpr | typeof SelectExpr | typeof SetOperationExpr | typeof InsertExpr>;
|
|
502
|
+
static get SUPPORTED_JSON_PATH_PARTS(): Set<typeof Expression>;
|
|
503
|
+
static get TYPE_MAPPING(): Map<string, string>;
|
|
504
|
+
static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: any) => string>;
|
|
505
|
+
static get PROPERTIES_LOCATION(): Map<typeof Expression, PropertiesLocation>;
|
|
506
|
+
static get TS_OR_DS_EXPRESSIONS(): Set<typeof Expression>;
|
|
507
|
+
unnestSql(expression: UnnestExpr): string;
|
|
508
|
+
jsonPathKeySql(expression: JsonPathKeyExpr): string;
|
|
509
|
+
parameterSql(expression: ParameterExpr): string;
|
|
510
|
+
schemaSql(expression: SchemaExpr): string;
|
|
511
|
+
constraintSql(expression: ConstraintExpr): string;
|
|
512
|
+
rowFormatSerdePropertySql(expression: RowFormatSerdePropertyExpr): string;
|
|
513
|
+
arrayAggSql(expression: ArrayAggExpr): string;
|
|
514
|
+
truncSql(expression: TruncExpr): string;
|
|
515
|
+
dataTypeSql(expression: DataTypeExpr): string;
|
|
516
|
+
versionSql(expression: VersionExpr): string;
|
|
517
|
+
structSql(expression: StructExpr): string;
|
|
518
|
+
columnDefSql(expression: ColumnDefExpr, options?: {
|
|
519
|
+
sep?: string;
|
|
520
|
+
}): string;
|
|
521
|
+
alterColumnSql(expression: AlterColumnExpr): string;
|
|
522
|
+
renameColumnSql(_expr: Expression): string;
|
|
523
|
+
alterSetSql(expression: AlterSetExpr): string;
|
|
524
|
+
serdePropertiesSql(expression: SerdePropertiesExpr): string;
|
|
525
|
+
existsSql(expression: ExistsExpr): string;
|
|
526
|
+
timeToStrSql(expression: TimeToStrExpr): string;
|
|
527
|
+
fileFormatPropertySql(expression: FileFormatPropertyExpr): string;
|
|
528
|
+
}
|
|
529
|
+
declare class Hive extends Dialect {
|
|
530
|
+
static DIALECT_NAME: Dialects;
|
|
531
|
+
static ALIAS_POST_TABLESAMPLE: boolean;
|
|
532
|
+
static IDENTIFIERS_CAN_START_WITH_DIGIT: boolean;
|
|
533
|
+
static SUPPORTS_USER_DEFINED_TYPES: boolean;
|
|
534
|
+
static get EXPRESSION_METADATA(): Map<typeof Expression, {
|
|
535
|
+
annotator?: (annotator: TypeAnnotator, expression: any) => void;
|
|
536
|
+
returns?: DataTypeExprKind | string;
|
|
537
|
+
}>;
|
|
538
|
+
static get COERCES_TO(): Map<DataTypeExprKind, Set<DataTypeExprKind>>;
|
|
539
|
+
static SAFE_DIVISION: boolean;
|
|
540
|
+
static ARRAY_AGG_INCLUDES_NULLS: undefined;
|
|
541
|
+
static REGEXP_EXTRACT_DEFAULT_GROUP: number;
|
|
542
|
+
static ALTER_TABLE_SUPPORTS_CASCADE: boolean;
|
|
543
|
+
static get NORMALIZATION_STRATEGY(): NormalizationStrategy;
|
|
544
|
+
static INITCAP_DEFAULT_DELIMITER_CHARS: string;
|
|
545
|
+
static get TIME_MAPPING(): {
|
|
546
|
+
y: string;
|
|
547
|
+
Y: string;
|
|
548
|
+
YYYY: string;
|
|
549
|
+
yyyy: string;
|
|
550
|
+
YY: string;
|
|
551
|
+
yy: string;
|
|
552
|
+
MMMM: string;
|
|
553
|
+
MMM: string;
|
|
554
|
+
MM: string;
|
|
555
|
+
M: string;
|
|
556
|
+
dd: string;
|
|
557
|
+
d: string;
|
|
558
|
+
HH: string;
|
|
559
|
+
H: string;
|
|
560
|
+
hh: string;
|
|
561
|
+
h: string;
|
|
562
|
+
mm: string;
|
|
563
|
+
m: string;
|
|
564
|
+
ss: string;
|
|
565
|
+
s: string;
|
|
566
|
+
SSSSSS: string;
|
|
567
|
+
a: string;
|
|
568
|
+
DD: string;
|
|
569
|
+
D: string;
|
|
570
|
+
E: string;
|
|
571
|
+
EE: string;
|
|
572
|
+
EEE: string;
|
|
573
|
+
EEEE: string;
|
|
574
|
+
z: string;
|
|
575
|
+
Z: string;
|
|
576
|
+
};
|
|
577
|
+
static DATE_FORMAT: string;
|
|
578
|
+
static DATEINT_FORMAT: string;
|
|
579
|
+
static TIME_FORMAT: string;
|
|
580
|
+
static Tokenizer: typeof HiveTokenizer;
|
|
581
|
+
static Parser: typeof HiveParser;
|
|
582
|
+
static Generator: typeof HiveGenerator;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export { Hive, buildWithIgnoreNulls };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkWRNYJ54Acjs = require('../chunk-WRNYJ54A.cjs');require('../chunk-DOKMTZYO.cjs');var _chunk2Z3O2CFMcjs = require('../chunk-2Z3O2CFM.cjs');var D,U,q,K,M,w,o,e=class extends(w=_chunkWRNYJ54Acjs.b.Parser,M=[_chunk2Z3O2CFMcjs.r],K=[_chunk2Z3O2CFMcjs.r],q=[_chunk2Z3O2CFMcjs.r],U=[_chunk2Z3O2CFMcjs.r],D=[_chunk2Z3O2CFMcjs.r],w){static get ID_VAR_TOKENS(){return new Set([..._chunk2Z3O2CFMcjs.za.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let s={..._chunkWRNYJ54Acjs.b.Parser.NO_PAREN_FUNCTIONS};return delete s.localtime,delete s.localtimestamp,s}static get NO_PAREN_FUNCTION_PARSERS(){return{..._chunkWRNYJ54Acjs.b.Parser.NO_PAREN_FUNCTION_PARSERS,MAP:function(){return this.parseMap()}}}static get LAMBDAS(){return{..._chunkWRNYJ54Acjs.b.Parser.LAMBDAS,farrow:function(s){return this.expression(_chunk2Z3O2CFMcjs.Le,{this:_chunk2Z3O2CFMcjs.ca.call(void 0, s,0),expression:this.parseAssignment()})}}}parseLambdaArg(){return this.parseField()}parseMap(){if(this.match("lParen")){let r=this.expression(_chunk2Z3O2CFMcjs.Wj,{this:this.parseSelect()});return this.matchRParen(),r}this.match("lBracket")||this.raiseError("Expecting [");let s=this.parseCsv(()=>this.parseLambda()).map(r=>new (0, _chunk2Z3O2CFMcjs.Fe)({this:_chunk2Z3O2CFMcjs.p.call(void 0, r.args.this,"string",_chunk2Z3O2CFMcjs.Ca),expression:_chunk2Z3O2CFMcjs.p.call(void 0, r.args.expression,"string",_chunk2Z3O2CFMcjs.Ca)}));return this.match("rBracket")||this.raiseError("Expecting ]"),this.expression(_chunk2Z3O2CFMcjs.Wj,{this:this.expression(_chunk2Z3O2CFMcjs.Cl,{expressions:s})})}static get TABLE_ALIAS_TOKENS(){return new Set([..._chunkWRNYJ54Acjs.b.Parser.TABLE_ALIAS_TOKENS,"straightJoin"])}};o=_chunk2Z3O2CFMcjs.a.call(void 0, w),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"ID_VAR_TOKENS",M,e),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"NO_PAREN_FUNCTIONS",K,e),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"NO_PAREN_FUNCTION_PARSERS",q,e),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"LAMBDAS",U,e),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"TABLE_ALIAS_TOKENS",D,e),_chunk2Z3O2CFMcjs.b.call(void 0, o,e),_chunk2Z3O2CFMcjs.c.call(void 0, o,3,e);var B,$,b,A,t=class extends(b=_chunkWRNYJ54Acjs.b.Generator,$=[_chunk2Z3O2CFMcjs.r],B=[_chunk2Z3O2CFMcjs.r],b){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let s=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(r=>s.delete(r)),s}static get ORIGINAL_TRANSFORMS(){let s=new Map([..._chunkWRNYJ54Acjs.b.Generator.TRANSFORMS,[_chunk2Z3O2CFMcjs.Kc,()=>""],[_chunk2Z3O2CFMcjs.Ja,_chunk2Z3O2CFMcjs.Po.call(void 0, [_chunk2Z3O2CFMcjs.ep,_chunk2Z3O2CFMcjs.fp])],[_chunk2Z3O2CFMcjs.Pc,()=>""],[_chunk2Z3O2CFMcjs.sb,()=>""],[_chunk2Z3O2CFMcjs.Vc,()=>""]]);return s.delete(_chunk2Z3O2CFMcjs.Wj),s}propertyEqSql(s){return this.binary(s,"=>")}dataTypeSql(s){if(s.isType("list"))return s.args.expressions&&0<s.args.expressions.length?`${this.expressions(s,{flat:!0})} LIST`:"LIST";if(s.isType("map")&&_optionalChain([s, 'access', _2 => _2.args, 'access', _3 => _3.expressions, 'optionalAccess', _4 => _4.length])===2){let[r,V]=s.args.expressions;return`MAP[${this.sql(r)} => ${this.sql(V)}]`}return super.dataTypeSql(s)}listSql(s){let r=_chunk2Z3O2CFMcjs.ca.call(void 0, s.args.expressions||[],0);return r instanceof _chunk2Z3O2CFMcjs.Wd?this.func("LIST",[r]):`${this.normalizeFunc("LIST")}[${this.expressions(s,{flat:!0})}]`}toMapSql(s){return s.args.this instanceof _chunk2Z3O2CFMcjs.Wd?this.func("MAP",[s.args.this]):`${this.normalizeFunc("MAP")}[${s.args.this instanceof _chunk2Z3O2CFMcjs.Ca?this.expressions(s.args.this):s.args.this}]`}};A=_chunk2Z3O2CFMcjs.a.call(void 0, b),_chunk2Z3O2CFMcjs.d.call(void 0, A,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",$,t),_chunk2Z3O2CFMcjs.d.call(void 0, A,10,"ORIGINAL_TRANSFORMS",B,t),_chunk2Z3O2CFMcjs.b.call(void 0, A,t),_chunk2Z3O2CFMcjs.c.call(void 0, A,3,t),t.SUPPORTS_DECODE_CASE=!1,t.TRY_SUPPORTED=!1,t.SUPPORTS_UESCAPE=!1,t.SUPPORTS_CREATE_TABLE_LIKE=!1,t.SUPPORTS_BETWEEN_FLAGS=!1;var E=class extends _chunkWRNYJ54Acjs.b{};E.DIALECT_NAME="materialize",E.Parser=e,E.Generator=t;_chunk2Z3O2CFMcjs.op.register("materialize",E);exports.Materialize = E;
|
|
2
|
+
//# sourceMappingURL=materialize.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/huydna/projects/sqlingo.js/dist/dialects/materialize.cjs","../../src/dialects/materialize.ts"],"names":["_TABLE_ALIAS_TOKENS_dec","_LAMBDAS_dec","_NO_PAREN_FUNCTION_PARSERS_dec","_NO_PAREN_FUNCTIONS_dec","_ID_VAR_TOKENS_dec","_a","_init","MaterializeParser","Postgres","cache","Parser","noParenFunctions","expressions","KwargExpr","seqGet","toMap","ToMapExpr","entries","e","PropertyEqExpr","narrowInstanceOf","Expression","StructExpr","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","_ORIGINAL_TRANSFORMS_dec","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","MaterializeGenerator","modifiers","m","transforms","AutoIncrementColumnConstraintExpr","CreateExpr","preprocess","removeUniqueConstraints","ctasWithTmpTablesToCreateTmpView","GeneratedAsIdentityColumnConstraintExpr","OnConflictExpr","PrimaryKeyColumnConstraintExpr","expression"],"mappings":"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","file":"/home/huydna/projects/sqlingo.js/dist/dialects/materialize.cjs","sourcesContent":[null,"import type {\n DataTypeExpr, ListExpr,\n} from '../expressions';\nimport {\n AutoIncrementColumnConstraintExpr,\n CreateExpr, DataTypeExprKind, Expression, GeneratedAsIdentityColumnConstraintExpr, KwargExpr, OnConflictExpr, PrimaryKeyColumnConstraintExpr, PropertyEqExpr, SelectExpr, StructExpr, ToMapExpr,\n} from '../expressions';\nimport type {\n Generator,\n} from '../generator';\nimport {\n seqGet,\n} from '../helper';\nimport {\n Parser,\n} from '../parser';\nimport {\n cache, narrowInstanceOf,\n} from '../port_internals';\nimport {\n TokenType,\n} from '../tokens';\nimport {\n ctasWithTmpTablesToCreateTmpView, preprocess, removeUniqueConstraints,\n} from '../transforms';\nimport {\n Dialect, Dialects,\n} from './dialect';\nimport {\n Postgres,\n} from './postgres';\n\nclass MaterializeParser extends Postgres.Parser {\n @cache\n static get ID_VAR_TOKENS (): Set<TokenType> {\n return new Set([\n ...Parser.ID_VAR_TOKENS,\n TokenType.SESSION_USER,\n TokenType.CURRENT_CATALOG,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get NO_PAREN_FUNCTIONS () {\n const noParenFunctions = {\n ...Postgres.Parser.NO_PAREN_FUNCTIONS,\n };\n delete noParenFunctions[TokenType.LOCALTIME];\n delete noParenFunctions[TokenType.LOCALTIMESTAMP];\n return noParenFunctions;\n }\n\n @cache\n static get NO_PAREN_FUNCTION_PARSERS () {\n return {\n ...Postgres.Parser.NO_PAREN_FUNCTION_PARSERS,\n MAP: function (this: Parser) {\n return (this as MaterializeParser).parseMap();\n },\n };\n }\n\n @cache\n static get LAMBDAS () {\n return {\n ...Postgres.Parser.LAMBDAS,\n [TokenType.FARROW]: function (this: Parser, expressions: Expression[]) {\n return this.expression(KwargExpr, {\n this: seqGet(expressions, 0),\n expression: (this as MaterializeParser).parseAssignment(),\n });\n },\n };\n }\n\n parseLambdaArg (): Expression | undefined {\n return this.parseField();\n }\n\n parseMap (): ToMapExpr {\n if (this.match(TokenType.L_PAREN)) {\n const toMap = this.expression(ToMapExpr, {\n this: this.parseSelect(),\n });\n this.matchRParen();\n return toMap;\n }\n\n if (!this.match(TokenType.L_BRACKET)) {\n this.raiseError('Expecting [');\n }\n\n const entries = this.parseCsv(() => (this as MaterializeParser).parseLambda()).map((e: Expression) =>\n new PropertyEqExpr({\n this: narrowInstanceOf(e.args.this, 'string', Expression),\n expression: narrowInstanceOf(e.args.expression, 'string', Expression),\n }));\n\n if (!this.match(TokenType.R_BRACKET)) {\n this.raiseError('Expecting ]');\n }\n\n return this.expression(ToMapExpr, {\n this: this.expression(StructExpr, {\n expressions: entries,\n }),\n });\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get TABLE_ALIAS_TOKENS (): Set<TokenType> {\n return new Set([\n ...Postgres.Parser.TABLE_ALIAS_TOKENS,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n}\nclass MaterializeGenerator extends Postgres.Generator {\n // port from _Dialect metaclass logic\n @cache\n static get AFTER_HAVING_MODIFIER_TRANSFORMS () {\n const modifiers = new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);\n [\n 'cluster',\n 'distribute',\n 'sort',\n ].forEach((m) => modifiers.delete(m));\n return modifiers;\n }\n\n // port from _Dialect metaclass logic\n static SUPPORTS_DECODE_CASE = false;\n // port from _Dialect metaclass logic\n static TRY_SUPPORTED = false;\n // port from _Dialect metaclass logic\n static SUPPORTS_UESCAPE = false;\n static SUPPORTS_CREATE_TABLE_LIKE = false;\n static SUPPORTS_BETWEEN_FLAGS = false;\n\n @cache\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static get ORIGINAL_TRANSFORMS (): Map<typeof Expression, (this: Generator, e: any) => string> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const transforms = new Map<typeof Expression, (this: Generator, e: any) => string>([\n ...Postgres.Generator.TRANSFORMS,\n [\n AutoIncrementColumnConstraintExpr,\n () => '',\n ],\n [\n CreateExpr,\n preprocess([\n removeUniqueConstraints,\n ctasWithTmpTablesToCreateTmpView,\n ]),\n ],\n [\n GeneratedAsIdentityColumnConstraintExpr,\n () => '',\n ],\n [\n OnConflictExpr,\n () => '',\n ],\n [\n PrimaryKeyColumnConstraintExpr,\n () => '',\n ],\n ]);\n transforms.delete(ToMapExpr);\n return transforms;\n }\n\n propertyEqSql (expression: PropertyEqExpr): string {\n return this.binary(expression, '=>');\n }\n\n dataTypeSql (expression: DataTypeExpr): string {\n if (expression.isType(DataTypeExprKind.LIST)) {\n if (expression.args.expressions && 0 < expression.args.expressions.length) {\n return `${this.expressions(expression, {\n flat: true,\n })} LIST`;\n }\n return 'LIST';\n }\n\n if (expression.isType(DataTypeExprKind.MAP) && expression.args.expressions?.length === 2) {\n const [\n key,\n value,\n ] = expression.args.expressions;\n return `MAP[${this.sql(key)} => ${this.sql(value)}]`;\n }\n\n return super.dataTypeSql(expression);\n }\n\n listSql (expression: ListExpr): string {\n const firstExpr = seqGet(expression.args.expressions || [\n ], 0);\n if (firstExpr instanceof SelectExpr) {\n return this.func('LIST', [\n firstExpr,\n ]);\n }\n\n return `${this.normalizeFunc('LIST')}[${this.expressions(expression, {\n flat: true,\n })}]`;\n }\n\n toMapSql (expression: ToMapExpr): string {\n if (expression.args.this instanceof SelectExpr) {\n return this.func('MAP', [\n expression.args.this,\n ]);\n }\n return `${this.normalizeFunc('MAP')}[${expression.args.this instanceof Expression ? this.expressions(expression.args.this) : expression.args.this}]`;\n }\n}\n\nexport class Materialize extends Postgres {\n static DIALECT_NAME = Dialects.MATERIALIZE;\n static Parser = MaterializeParser;\n static Generator = MaterializeGenerator;\n}\n\nDialect.register(Dialects.MATERIALIZE, Materialize);\n"]}
|