@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,486 @@
|
|
|
1
|
+
import { d as Dialects, E as Expression, bo as TypeAnnotator, $ as DataTypeExprKind, _ as TokenPair, l as TokenType, c as Dialect, i as Parser, dG as DropExpr, a6 as CommandExpr, aj as PropertiesLocation, G as Generator, dw as StructExpr, at as CastExpr, dm as FileFormatPropertyExpr, de as AlterColumnExpr } from '../tokens-VcMD09XM.js';
|
|
2
|
+
import { Hive } from './hive.js';
|
|
3
|
+
|
|
4
|
+
declare function buildAsCast(toType: string): (args: Expression[]) => CastExpr;
|
|
5
|
+
declare function temporaryStorageProvider(expression: Expression): Expression;
|
|
6
|
+
declare class Spark2Tokenizer extends Hive.Tokenizer {
|
|
7
|
+
static get HEX_STRINGS(): TokenPair[];
|
|
8
|
+
static get ORIGINAL_KEYWORDS(): Record<string, TokenType>;
|
|
9
|
+
}
|
|
10
|
+
declare class Spark2Parser extends Hive.Parser {
|
|
11
|
+
static get ID_VAR_TOKENS(): Set<TokenType>;
|
|
12
|
+
static get NO_PAREN_FUNCTIONS(): {
|
|
13
|
+
lParen?: typeof Expression | undefined;
|
|
14
|
+
rParen?: typeof Expression | undefined;
|
|
15
|
+
lBracket?: typeof Expression | undefined;
|
|
16
|
+
rBracket?: typeof Expression | undefined;
|
|
17
|
+
lBrace?: typeof Expression | undefined;
|
|
18
|
+
rBrace?: typeof Expression | undefined;
|
|
19
|
+
comma?: typeof Expression | undefined;
|
|
20
|
+
dot?: typeof Expression | undefined;
|
|
21
|
+
dash?: typeof Expression | undefined;
|
|
22
|
+
plus?: typeof Expression | undefined;
|
|
23
|
+
colon?: typeof Expression | undefined;
|
|
24
|
+
dotcolon?: typeof Expression | undefined;
|
|
25
|
+
dcolon?: typeof Expression | undefined;
|
|
26
|
+
dcolondollar?: typeof Expression | undefined;
|
|
27
|
+
dcolonpercent?: typeof Expression | undefined;
|
|
28
|
+
dcolonqmark?: typeof Expression | undefined;
|
|
29
|
+
dqmark?: typeof Expression | undefined;
|
|
30
|
+
semicolon?: typeof Expression | undefined;
|
|
31
|
+
star?: typeof Expression | undefined;
|
|
32
|
+
backslash?: typeof Expression | undefined;
|
|
33
|
+
slash?: typeof Expression | undefined;
|
|
34
|
+
lt?: typeof Expression | undefined;
|
|
35
|
+
lte?: typeof Expression | undefined;
|
|
36
|
+
gt?: typeof Expression | undefined;
|
|
37
|
+
gte?: typeof Expression | undefined;
|
|
38
|
+
not?: typeof Expression | undefined;
|
|
39
|
+
eq?: typeof Expression | undefined;
|
|
40
|
+
neq?: typeof Expression | undefined;
|
|
41
|
+
nullsafeEq?: typeof Expression | undefined;
|
|
42
|
+
colonEq?: typeof Expression | undefined;
|
|
43
|
+
colonGt?: typeof Expression | undefined;
|
|
44
|
+
ncolonGt?: typeof Expression | undefined;
|
|
45
|
+
and?: typeof Expression | undefined;
|
|
46
|
+
or?: typeof Expression | undefined;
|
|
47
|
+
amp?: typeof Expression | undefined;
|
|
48
|
+
dpipe?: typeof Expression | undefined;
|
|
49
|
+
pipeGt?: typeof Expression | undefined;
|
|
50
|
+
pipe?: typeof Expression | undefined;
|
|
51
|
+
pipeSlash?: typeof Expression | undefined;
|
|
52
|
+
dpipeSlash?: typeof Expression | undefined;
|
|
53
|
+
caret?: typeof Expression | undefined;
|
|
54
|
+
caretAt?: typeof Expression | undefined;
|
|
55
|
+
tilde?: typeof Expression | undefined;
|
|
56
|
+
arrow?: typeof Expression | undefined;
|
|
57
|
+
darrow?: typeof Expression | undefined;
|
|
58
|
+
farrow?: typeof Expression | undefined;
|
|
59
|
+
hash?: typeof Expression | undefined;
|
|
60
|
+
hashArrow?: typeof Expression | undefined;
|
|
61
|
+
dhashArrow?: typeof Expression | undefined;
|
|
62
|
+
lrArrow?: typeof Expression | undefined;
|
|
63
|
+
dat?: typeof Expression | undefined;
|
|
64
|
+
ltAt?: typeof Expression | undefined;
|
|
65
|
+
atGt?: typeof Expression | undefined;
|
|
66
|
+
dollar?: typeof Expression | undefined;
|
|
67
|
+
parameter?: typeof Expression | undefined;
|
|
68
|
+
session?: typeof Expression | undefined;
|
|
69
|
+
sessionParameter?: typeof Expression | undefined;
|
|
70
|
+
sessionUser?: typeof Expression | undefined;
|
|
71
|
+
damp?: typeof Expression | undefined;
|
|
72
|
+
ampLt?: typeof Expression | undefined;
|
|
73
|
+
ampGt?: typeof Expression | undefined;
|
|
74
|
+
adjacent?: typeof Expression | undefined;
|
|
75
|
+
xor?: typeof Expression | undefined;
|
|
76
|
+
dstar?: typeof Expression | undefined;
|
|
77
|
+
qmarkAmp?: typeof Expression | undefined;
|
|
78
|
+
qmarkPipe?: typeof Expression | undefined;
|
|
79
|
+
hashDash?: typeof Expression | undefined;
|
|
80
|
+
exclamation?: typeof Expression | undefined;
|
|
81
|
+
uriStart?: typeof Expression | undefined;
|
|
82
|
+
blockStart?: typeof Expression | undefined;
|
|
83
|
+
blockEnd?: typeof Expression | undefined;
|
|
84
|
+
space?: typeof Expression | undefined;
|
|
85
|
+
break?: typeof Expression | undefined;
|
|
86
|
+
string?: typeof Expression | undefined;
|
|
87
|
+
number?: typeof Expression | undefined;
|
|
88
|
+
identifier?: typeof Expression | undefined;
|
|
89
|
+
database?: typeof Expression | undefined;
|
|
90
|
+
column?: typeof Expression | undefined;
|
|
91
|
+
columnDef?: typeof Expression | undefined;
|
|
92
|
+
schema?: typeof Expression | undefined;
|
|
93
|
+
table?: typeof Expression | undefined;
|
|
94
|
+
warehouse?: typeof Expression | undefined;
|
|
95
|
+
stage?: typeof Expression | undefined;
|
|
96
|
+
streamlit?: typeof Expression | undefined;
|
|
97
|
+
var?: typeof Expression | undefined;
|
|
98
|
+
bitString?: typeof Expression | undefined;
|
|
99
|
+
hexString?: typeof Expression | undefined;
|
|
100
|
+
byteString?: typeof Expression | undefined;
|
|
101
|
+
nationalString?: typeof Expression | undefined;
|
|
102
|
+
rawString?: typeof Expression | undefined;
|
|
103
|
+
heredocString?: typeof Expression | undefined;
|
|
104
|
+
unicodeString?: typeof Expression | undefined;
|
|
105
|
+
bit?: typeof Expression | undefined;
|
|
106
|
+
boolean?: typeof Expression | undefined;
|
|
107
|
+
tinyint?: typeof Expression | undefined;
|
|
108
|
+
utinyint?: typeof Expression | undefined;
|
|
109
|
+
smallint?: typeof Expression | undefined;
|
|
110
|
+
usmallint?: typeof Expression | undefined;
|
|
111
|
+
mediumint?: typeof Expression | undefined;
|
|
112
|
+
umediumint?: typeof Expression | undefined;
|
|
113
|
+
int?: typeof Expression | undefined;
|
|
114
|
+
uint?: typeof Expression | undefined;
|
|
115
|
+
bigint?: typeof Expression | undefined;
|
|
116
|
+
ubigint?: typeof Expression | undefined;
|
|
117
|
+
bignum?: typeof Expression | undefined;
|
|
118
|
+
int128?: typeof Expression | undefined;
|
|
119
|
+
uint128?: typeof Expression | undefined;
|
|
120
|
+
int256?: typeof Expression | undefined;
|
|
121
|
+
uint256?: typeof Expression | undefined;
|
|
122
|
+
float?: typeof Expression | undefined;
|
|
123
|
+
double?: typeof Expression | undefined;
|
|
124
|
+
udouble?: typeof Expression | undefined;
|
|
125
|
+
decimal?: typeof Expression | undefined;
|
|
126
|
+
decimal32?: typeof Expression | undefined;
|
|
127
|
+
decimal64?: typeof Expression | undefined;
|
|
128
|
+
decimal128?: typeof Expression | undefined;
|
|
129
|
+
decimal256?: typeof Expression | undefined;
|
|
130
|
+
decfloat?: typeof Expression | undefined;
|
|
131
|
+
udecimal?: typeof Expression | undefined;
|
|
132
|
+
bigdecimal?: typeof Expression | undefined;
|
|
133
|
+
char?: typeof Expression | undefined;
|
|
134
|
+
nchar?: typeof Expression | undefined;
|
|
135
|
+
varchar?: typeof Expression | undefined;
|
|
136
|
+
nvarchar?: typeof Expression | undefined;
|
|
137
|
+
bpchar?: typeof Expression | undefined;
|
|
138
|
+
text?: typeof Expression | undefined;
|
|
139
|
+
mediumtext?: typeof Expression | undefined;
|
|
140
|
+
longtext?: typeof Expression | undefined;
|
|
141
|
+
blob?: typeof Expression | undefined;
|
|
142
|
+
mediumblob?: typeof Expression | undefined;
|
|
143
|
+
longblob?: typeof Expression | undefined;
|
|
144
|
+
tinyblob?: typeof Expression | undefined;
|
|
145
|
+
tinytext?: typeof Expression | undefined;
|
|
146
|
+
name?: typeof Expression | undefined;
|
|
147
|
+
binary?: typeof Expression | undefined;
|
|
148
|
+
varbinary?: typeof Expression | undefined;
|
|
149
|
+
json?: typeof Expression | undefined;
|
|
150
|
+
jsonb?: typeof Expression | undefined;
|
|
151
|
+
time?: typeof Expression | undefined;
|
|
152
|
+
timetz?: typeof Expression | undefined;
|
|
153
|
+
timeNs?: typeof Expression | undefined;
|
|
154
|
+
timestamp?: typeof Expression | undefined;
|
|
155
|
+
timestamptz?: typeof Expression | undefined;
|
|
156
|
+
timestampltz?: typeof Expression | undefined;
|
|
157
|
+
timestampntz?: typeof Expression | undefined;
|
|
158
|
+
timestampS?: typeof Expression | undefined;
|
|
159
|
+
timestampMs?: typeof Expression | undefined;
|
|
160
|
+
timestampNs?: typeof Expression | undefined;
|
|
161
|
+
datetime?: typeof Expression | undefined;
|
|
162
|
+
datetime2?: typeof Expression | undefined;
|
|
163
|
+
datetime64?: typeof Expression | undefined;
|
|
164
|
+
smalldatetime?: typeof Expression | undefined;
|
|
165
|
+
date?: typeof Expression | undefined;
|
|
166
|
+
date32?: typeof Expression | undefined;
|
|
167
|
+
int4range?: typeof Expression | undefined;
|
|
168
|
+
int4multirange?: typeof Expression | undefined;
|
|
169
|
+
int8range?: typeof Expression | undefined;
|
|
170
|
+
int8multirange?: typeof Expression | undefined;
|
|
171
|
+
numrange?: typeof Expression | undefined;
|
|
172
|
+
nummultirange?: typeof Expression | undefined;
|
|
173
|
+
tsrange?: typeof Expression | undefined;
|
|
174
|
+
tsmultirange?: typeof Expression | undefined;
|
|
175
|
+
tstzrange?: typeof Expression | undefined;
|
|
176
|
+
tstzmultirange?: typeof Expression | undefined;
|
|
177
|
+
daterange?: typeof Expression | undefined;
|
|
178
|
+
datemultirange?: typeof Expression | undefined;
|
|
179
|
+
uuid?: typeof Expression | undefined;
|
|
180
|
+
geography?: typeof Expression | undefined;
|
|
181
|
+
geographypoint?: typeof Expression | undefined;
|
|
182
|
+
nullable?: typeof Expression | undefined;
|
|
183
|
+
geometry?: typeof Expression | undefined;
|
|
184
|
+
point?: typeof Expression | undefined;
|
|
185
|
+
ring?: typeof Expression | undefined;
|
|
186
|
+
linestring?: typeof Expression | undefined;
|
|
187
|
+
localtime?: typeof Expression | undefined;
|
|
188
|
+
localtimestamp?: typeof Expression | undefined;
|
|
189
|
+
systimestamp?: typeof Expression | undefined;
|
|
190
|
+
multilinestring?: typeof Expression | undefined;
|
|
191
|
+
polygon?: typeof Expression | undefined;
|
|
192
|
+
multipolygon?: typeof Expression | undefined;
|
|
193
|
+
hllsketch?: typeof Expression | undefined;
|
|
194
|
+
hstore?: typeof Expression | undefined;
|
|
195
|
+
super?: typeof Expression | undefined;
|
|
196
|
+
serial?: typeof Expression | undefined;
|
|
197
|
+
smallserial?: typeof Expression | undefined;
|
|
198
|
+
bigserial?: typeof Expression | undefined;
|
|
199
|
+
xml?: typeof Expression | undefined;
|
|
200
|
+
year?: typeof Expression | undefined;
|
|
201
|
+
userdefined?: typeof Expression | undefined;
|
|
202
|
+
money?: typeof Expression | undefined;
|
|
203
|
+
smallmoney?: typeof Expression | undefined;
|
|
204
|
+
rowversion?: typeof Expression | undefined;
|
|
205
|
+
image?: typeof Expression | undefined;
|
|
206
|
+
variant?: typeof Expression | undefined;
|
|
207
|
+
object?: typeof Expression | undefined;
|
|
208
|
+
inet?: typeof Expression | undefined;
|
|
209
|
+
ipaddress?: typeof Expression | undefined;
|
|
210
|
+
ipprefix?: typeof Expression | undefined;
|
|
211
|
+
ipv4?: typeof Expression | undefined;
|
|
212
|
+
ipv6?: typeof Expression | undefined;
|
|
213
|
+
enum?: typeof Expression | undefined;
|
|
214
|
+
enum8?: typeof Expression | undefined;
|
|
215
|
+
enum16?: typeof Expression | undefined;
|
|
216
|
+
fixedstring?: typeof Expression | undefined;
|
|
217
|
+
lowcardinality?: typeof Expression | undefined;
|
|
218
|
+
nested?: typeof Expression | undefined;
|
|
219
|
+
aggregatefunction?: typeof Expression | undefined;
|
|
220
|
+
simpleaggregatefunction?: typeof Expression | undefined;
|
|
221
|
+
tdigest?: typeof Expression | undefined;
|
|
222
|
+
unknown?: typeof Expression | undefined;
|
|
223
|
+
vector?: typeof Expression | undefined;
|
|
224
|
+
dynamic?: typeof Expression | undefined;
|
|
225
|
+
void?: typeof Expression | undefined;
|
|
226
|
+
alias?: typeof Expression | undefined;
|
|
227
|
+
alter?: typeof Expression | undefined;
|
|
228
|
+
all?: typeof Expression | undefined;
|
|
229
|
+
anti?: typeof Expression | undefined;
|
|
230
|
+
any?: typeof Expression | undefined;
|
|
231
|
+
apply?: typeof Expression | undefined;
|
|
232
|
+
array?: typeof Expression | undefined;
|
|
233
|
+
asc?: typeof Expression | undefined;
|
|
234
|
+
asof?: typeof Expression | undefined;
|
|
235
|
+
attach?: typeof Expression | undefined;
|
|
236
|
+
autoIncrement?: typeof Expression | undefined;
|
|
237
|
+
begin?: typeof Expression | undefined;
|
|
238
|
+
between?: typeof Expression | undefined;
|
|
239
|
+
bulkCollectInto?: typeof Expression | undefined;
|
|
240
|
+
cache?: typeof Expression | undefined;
|
|
241
|
+
case?: typeof Expression | undefined;
|
|
242
|
+
characterSet?: typeof Expression | undefined;
|
|
243
|
+
clusterBy?: typeof Expression | undefined;
|
|
244
|
+
collate?: typeof Expression | undefined;
|
|
245
|
+
command?: typeof Expression | undefined;
|
|
246
|
+
comment?: typeof Expression | undefined;
|
|
247
|
+
commit?: typeof Expression | undefined;
|
|
248
|
+
connectBy?: typeof Expression | undefined;
|
|
249
|
+
constraint?: typeof Expression | undefined;
|
|
250
|
+
copy?: typeof Expression | undefined;
|
|
251
|
+
create?: typeof Expression | undefined;
|
|
252
|
+
cross?: typeof Expression | undefined;
|
|
253
|
+
cube?: typeof Expression | undefined;
|
|
254
|
+
currentDate?: typeof Expression | undefined;
|
|
255
|
+
currentDatetime?: typeof Expression | undefined;
|
|
256
|
+
currentSchema?: typeof Expression | undefined;
|
|
257
|
+
currentTime?: typeof Expression | undefined;
|
|
258
|
+
currentTimestamp?: typeof Expression | undefined;
|
|
259
|
+
currentUser?: typeof Expression | undefined;
|
|
260
|
+
currentRole?: typeof Expression | undefined;
|
|
261
|
+
currentCatalog?: typeof Expression | undefined;
|
|
262
|
+
declare?: typeof Expression | undefined;
|
|
263
|
+
default?: typeof Expression | undefined;
|
|
264
|
+
delete?: typeof Expression | undefined;
|
|
265
|
+
desc?: typeof Expression | undefined;
|
|
266
|
+
describe?: typeof Expression | undefined;
|
|
267
|
+
detach?: typeof Expression | undefined;
|
|
268
|
+
dictionary?: typeof Expression | undefined;
|
|
269
|
+
distinct?: typeof Expression | undefined;
|
|
270
|
+
distributeBy?: typeof Expression | undefined;
|
|
271
|
+
div?: typeof Expression | undefined;
|
|
272
|
+
drop?: typeof Expression | undefined;
|
|
273
|
+
else?: typeof Expression | undefined;
|
|
274
|
+
end?: typeof Expression | undefined;
|
|
275
|
+
escape?: typeof Expression | undefined;
|
|
276
|
+
except?: typeof Expression | undefined;
|
|
277
|
+
execute?: typeof Expression | undefined;
|
|
278
|
+
exists?: typeof Expression | undefined;
|
|
279
|
+
false?: typeof Expression | undefined;
|
|
280
|
+
fetch?: typeof Expression | undefined;
|
|
281
|
+
file?: typeof Expression | undefined;
|
|
282
|
+
fileFormat?: typeof Expression | undefined;
|
|
283
|
+
filter?: typeof Expression | undefined;
|
|
284
|
+
final?: typeof Expression | undefined;
|
|
285
|
+
first?: typeof Expression | undefined;
|
|
286
|
+
for?: typeof Expression | undefined;
|
|
287
|
+
force?: typeof Expression | undefined;
|
|
288
|
+
foreignKey?: typeof Expression | undefined;
|
|
289
|
+
format?: typeof Expression | undefined;
|
|
290
|
+
from?: typeof Expression | undefined;
|
|
291
|
+
full?: typeof Expression | undefined;
|
|
292
|
+
function?: typeof Expression | undefined;
|
|
293
|
+
get?: typeof Expression | undefined;
|
|
294
|
+
glob?: typeof Expression | undefined;
|
|
295
|
+
global?: typeof Expression | undefined;
|
|
296
|
+
grant?: typeof Expression | undefined;
|
|
297
|
+
groupBy?: typeof Expression | undefined;
|
|
298
|
+
groupingSets?: typeof Expression | undefined;
|
|
299
|
+
having?: typeof Expression | undefined;
|
|
300
|
+
hint?: typeof Expression | undefined;
|
|
301
|
+
ignore?: typeof Expression | undefined;
|
|
302
|
+
ilike?: typeof Expression | undefined;
|
|
303
|
+
in?: typeof Expression | undefined;
|
|
304
|
+
index?: typeof Expression | undefined;
|
|
305
|
+
indexedBy?: typeof Expression | undefined;
|
|
306
|
+
inner?: typeof Expression | undefined;
|
|
307
|
+
insert?: typeof Expression | undefined;
|
|
308
|
+
install?: typeof Expression | undefined;
|
|
309
|
+
intersect?: typeof Expression | undefined;
|
|
310
|
+
interval?: typeof Expression | undefined;
|
|
311
|
+
into?: typeof Expression | undefined;
|
|
312
|
+
introducer?: typeof Expression | undefined;
|
|
313
|
+
irlike?: typeof Expression | undefined;
|
|
314
|
+
is?: typeof Expression | undefined;
|
|
315
|
+
isnull?: typeof Expression | undefined;
|
|
316
|
+
join?: typeof Expression | undefined;
|
|
317
|
+
joinMarker?: typeof Expression | undefined;
|
|
318
|
+
keep?: typeof Expression | undefined;
|
|
319
|
+
key?: typeof Expression | undefined;
|
|
320
|
+
kill?: typeof Expression | undefined;
|
|
321
|
+
language?: typeof Expression | undefined;
|
|
322
|
+
lateral?: typeof Expression | undefined;
|
|
323
|
+
left?: typeof Expression | undefined;
|
|
324
|
+
like?: typeof Expression | undefined;
|
|
325
|
+
limit?: typeof Expression | undefined;
|
|
326
|
+
list?: typeof Expression | undefined;
|
|
327
|
+
load?: typeof Expression | undefined;
|
|
328
|
+
lock?: typeof Expression | undefined;
|
|
329
|
+
map?: typeof Expression | undefined;
|
|
330
|
+
match?: typeof Expression | undefined;
|
|
331
|
+
matchCondition?: typeof Expression | undefined;
|
|
332
|
+
matchRecognize?: typeof Expression | undefined;
|
|
333
|
+
memberOf?: typeof Expression | undefined;
|
|
334
|
+
merge?: typeof Expression | undefined;
|
|
335
|
+
mod?: typeof Expression | undefined;
|
|
336
|
+
model?: typeof Expression | undefined;
|
|
337
|
+
natural?: typeof Expression | undefined;
|
|
338
|
+
next?: typeof Expression | undefined;
|
|
339
|
+
nothing?: typeof Expression | undefined;
|
|
340
|
+
notnull?: typeof Expression | undefined;
|
|
341
|
+
null?: typeof Expression | undefined;
|
|
342
|
+
objectIdentifier?: typeof Expression | undefined;
|
|
343
|
+
offset?: typeof Expression | undefined;
|
|
344
|
+
on?: typeof Expression | undefined;
|
|
345
|
+
only?: typeof Expression | undefined;
|
|
346
|
+
operator?: typeof Expression | undefined;
|
|
347
|
+
orderBy?: typeof Expression | undefined;
|
|
348
|
+
orderSiblingsBy?: typeof Expression | undefined;
|
|
349
|
+
ordered?: typeof Expression | undefined;
|
|
350
|
+
ordinality?: typeof Expression | undefined;
|
|
351
|
+
out?: typeof Expression | undefined;
|
|
352
|
+
inout?: typeof Expression | undefined;
|
|
353
|
+
outer?: typeof Expression | undefined;
|
|
354
|
+
over?: typeof Expression | undefined;
|
|
355
|
+
overlaps?: typeof Expression | undefined;
|
|
356
|
+
overwrite?: typeof Expression | undefined;
|
|
357
|
+
partition?: typeof Expression | undefined;
|
|
358
|
+
partitionBy?: typeof Expression | undefined;
|
|
359
|
+
percent?: typeof Expression | undefined;
|
|
360
|
+
pivot?: typeof Expression | undefined;
|
|
361
|
+
placeholder?: typeof Expression | undefined;
|
|
362
|
+
positional?: typeof Expression | undefined;
|
|
363
|
+
pragma?: typeof Expression | undefined;
|
|
364
|
+
prewhere?: typeof Expression | undefined;
|
|
365
|
+
primaryKey?: typeof Expression | undefined;
|
|
366
|
+
procedure?: typeof Expression | undefined;
|
|
367
|
+
properties?: typeof Expression | undefined;
|
|
368
|
+
pseudoType?: typeof Expression | undefined;
|
|
369
|
+
put?: typeof Expression | undefined;
|
|
370
|
+
qualify?: typeof Expression | undefined;
|
|
371
|
+
quote?: typeof Expression | undefined;
|
|
372
|
+
qdcolon?: typeof Expression | undefined;
|
|
373
|
+
range?: typeof Expression | undefined;
|
|
374
|
+
recursive?: typeof Expression | undefined;
|
|
375
|
+
refresh?: typeof Expression | undefined;
|
|
376
|
+
rename?: typeof Expression | undefined;
|
|
377
|
+
replace?: typeof Expression | undefined;
|
|
378
|
+
returning?: typeof Expression | undefined;
|
|
379
|
+
revoke?: typeof Expression | undefined;
|
|
380
|
+
references?: typeof Expression | undefined;
|
|
381
|
+
right?: typeof Expression | undefined;
|
|
382
|
+
rlike?: typeof Expression | undefined;
|
|
383
|
+
rollback?: typeof Expression | undefined;
|
|
384
|
+
rollup?: typeof Expression | undefined;
|
|
385
|
+
row?: typeof Expression | undefined;
|
|
386
|
+
rows?: typeof Expression | undefined;
|
|
387
|
+
select?: typeof Expression | undefined;
|
|
388
|
+
semi?: typeof Expression | undefined;
|
|
389
|
+
separator?: typeof Expression | undefined;
|
|
390
|
+
sequence?: typeof Expression | undefined;
|
|
391
|
+
serdeProperties?: typeof Expression | undefined;
|
|
392
|
+
set?: typeof Expression | undefined;
|
|
393
|
+
settings?: typeof Expression | undefined;
|
|
394
|
+
show?: typeof Expression | undefined;
|
|
395
|
+
similarTo?: typeof Expression | undefined;
|
|
396
|
+
some?: typeof Expression | undefined;
|
|
397
|
+
sortBy?: typeof Expression | undefined;
|
|
398
|
+
soundsLike?: typeof Expression | undefined;
|
|
399
|
+
startWith?: typeof Expression | undefined;
|
|
400
|
+
storageIntegration?: typeof Expression | undefined;
|
|
401
|
+
straightJoin?: typeof Expression | undefined;
|
|
402
|
+
struct?: typeof Expression | undefined;
|
|
403
|
+
summarize?: typeof Expression | undefined;
|
|
404
|
+
tableSample?: typeof Expression | undefined;
|
|
405
|
+
tag?: typeof Expression | undefined;
|
|
406
|
+
temporary?: typeof Expression | undefined;
|
|
407
|
+
top?: typeof Expression | undefined;
|
|
408
|
+
then?: typeof Expression | undefined;
|
|
409
|
+
true?: typeof Expression | undefined;
|
|
410
|
+
truncate?: typeof Expression | undefined;
|
|
411
|
+
uncache?: typeof Expression | undefined;
|
|
412
|
+
union?: typeof Expression | undefined;
|
|
413
|
+
unnest?: typeof Expression | undefined;
|
|
414
|
+
unpivot?: typeof Expression | undefined;
|
|
415
|
+
update?: typeof Expression | undefined;
|
|
416
|
+
use?: typeof Expression | undefined;
|
|
417
|
+
using?: typeof Expression | undefined;
|
|
418
|
+
values?: typeof Expression | undefined;
|
|
419
|
+
variadic?: typeof Expression | undefined;
|
|
420
|
+
view?: typeof Expression | undefined;
|
|
421
|
+
semanticView?: typeof Expression | undefined;
|
|
422
|
+
volatile?: typeof Expression | undefined;
|
|
423
|
+
when?: typeof Expression | undefined;
|
|
424
|
+
where?: typeof Expression | undefined;
|
|
425
|
+
window?: typeof Expression | undefined;
|
|
426
|
+
with?: typeof Expression | undefined;
|
|
427
|
+
unique?: typeof Expression | undefined;
|
|
428
|
+
utcDate?: typeof Expression | undefined;
|
|
429
|
+
utcTime?: typeof Expression | undefined;
|
|
430
|
+
utcTimestamp?: typeof Expression | undefined;
|
|
431
|
+
versionSnapshot?: typeof Expression | undefined;
|
|
432
|
+
timestampSnapshot?: typeof Expression | undefined;
|
|
433
|
+
option?: typeof Expression | undefined;
|
|
434
|
+
sink?: typeof Expression | undefined;
|
|
435
|
+
source?: typeof Expression | undefined;
|
|
436
|
+
analyze?: typeof Expression | undefined;
|
|
437
|
+
namespace?: typeof Expression | undefined;
|
|
438
|
+
export?: typeof Expression | undefined;
|
|
439
|
+
hiveTokenStream?: typeof Expression | undefined;
|
|
440
|
+
};
|
|
441
|
+
static TRIM_PATTERN_FIRST: boolean;
|
|
442
|
+
static CHANGE_COLUMN_ALTER_SYNTAX: boolean;
|
|
443
|
+
static get FUNCTIONS(): Record<string, (args: Expression[], options: {
|
|
444
|
+
dialect: Dialect;
|
|
445
|
+
}) => Expression>;
|
|
446
|
+
static get FUNCTION_PARSERS(): Partial<Record<string, (this: Parser) => Expression | undefined>>;
|
|
447
|
+
parseDropColumn(): DropExpr | CommandExpr | undefined;
|
|
448
|
+
pivotColumnNames(aggregations: Expression[]): string[];
|
|
449
|
+
static get TABLE_ALIAS_TOKENS(): Set<TokenType>;
|
|
450
|
+
}
|
|
451
|
+
declare class Spark2Generator extends Hive.Generator {
|
|
452
|
+
static SUPPORTS_DECODE_CASE: boolean;
|
|
453
|
+
static TRY_SUPPORTED: boolean;
|
|
454
|
+
static SUPPORTS_UESCAPE: boolean;
|
|
455
|
+
static QUERY_HINTS: boolean;
|
|
456
|
+
static NVL2_SUPPORTED: boolean;
|
|
457
|
+
static CAN_IMPLEMENT_ARRAY_ANY: boolean;
|
|
458
|
+
static ALTER_SET_TYPE: string;
|
|
459
|
+
static PARSE_JSON_NAME?: string;
|
|
460
|
+
static get PROPERTIES_LOCATION(): Map<typeof Expression, PropertiesLocation>;
|
|
461
|
+
static get TS_OR_DS_EXPRESSIONS(): Set<typeof Expression>;
|
|
462
|
+
static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: any) => string>;
|
|
463
|
+
static WRAP_DERIVED_VALUES: boolean;
|
|
464
|
+
static CREATE_FUNCTION_RETURN_AS: boolean;
|
|
465
|
+
structSql(expression: StructExpr): string;
|
|
466
|
+
castSql(expression: CastExpr, options?: {
|
|
467
|
+
safePrefix?: string;
|
|
468
|
+
}): string;
|
|
469
|
+
fileFormatPropertySql(expression: FileFormatPropertyExpr): string;
|
|
470
|
+
alterColumnSql(expression: AlterColumnExpr): string;
|
|
471
|
+
renameColumnSql(expr: Expression): string;
|
|
472
|
+
}
|
|
473
|
+
declare class Spark2 extends Hive {
|
|
474
|
+
static DIALECT_NAME: Dialects;
|
|
475
|
+
static ALTER_TABLE_SUPPORTS_CASCADE: boolean;
|
|
476
|
+
static get EXPRESSION_METADATA(): Map<typeof Expression, {
|
|
477
|
+
annotator?: (annotator: TypeAnnotator, expression: any) => void;
|
|
478
|
+
returns?: DataTypeExprKind | string;
|
|
479
|
+
}>;
|
|
480
|
+
static INITCAP_DEFAULT_DELIMITER_CHARS: string;
|
|
481
|
+
static Tokenizer: typeof Spark2Tokenizer;
|
|
482
|
+
static Parser: typeof Spark2Parser;
|
|
483
|
+
static Generator: typeof Spark2Generator;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export { Spark2, buildAsCast, temporaryStorageProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunk2Z3O2CFMcjs = require('../chunk-2Z3O2CFM.cjs');function rs(e){return e.length===1&&e.push(new (0, _chunk2Z3O2CFMcjs.fh)({})),e.length===2?new (0, _chunk2Z3O2CFMcjs.Hl)({this:new (0, _chunk2Z3O2CFMcjs.Sl)({this:e[1]}),format:e[0]}):new (0, _chunk2Z3O2CFMcjs.Kf)({this:"STRFTIME",expressions:e})}function ns(e){let p=e.args.this;if(e instanceof _chunk2Z3O2CFMcjs.Ja&&p instanceof _chunk2Z3O2CFMcjs.Vb){let t={},s;for(let r of p.args.expressions||[])r instanceof _chunk2Z3O2CFMcjs.Za?t[r.name]=r:r instanceof _chunk2Z3O2CFMcjs.nb&&(s=r);if(s&&(s.args.expressions||[]).length===1){let r=(s.args.expressions||[])[0].name,i=t[r];i.args.constraints||i.setArgKey("constraints",[]),i.args.constraints||i.setArgKey("constraints",[]),_optionalChain([i, 'access', _2 => _2.args, 'access', _3 => _3.constraints, 'optionalAccess', _4 => _4.push, 'call', _5 => _5(new (0, _chunk2Z3O2CFMcjs.db)({kind:new _chunk2Z3O2CFMcjs.Vc}))]),p.setArgKey("expressions",(p.args.expressions||[]).filter(T=>T!==s))}else for(let r of Object.values(t)){let i;for(let T of r.args.constraints||[]){let d=T;if(d.args.kind instanceof _chunk2Z3O2CFMcjs.Vc){i=void 0;break}d.args.kind instanceof _chunk2Z3O2CFMcjs.Kc&&(i=d)}i&&r.setArgKey("constraints",(r.args.constraints||[]).filter(T=>T!==i))}}return e}function es(e){if(!(e instanceof _chunk2Z3O2CFMcjs.Za))return e;let p=e.find(_chunk2Z3O2CFMcjs.Pc);if(p){p.parent.pop();let t=e.find(_chunk2Z3O2CFMcjs.Uc);t&&t.parent.pop(),e.args.constraints||e.setArgKey("constraints",[]),_optionalChain([e, 'access', _6 => _6.args, 'access', _7 => _7.constraints, 'optionalAccess', _8 => _8.push, 'call', _9 => _9(new (0, _chunk2Z3O2CFMcjs.db)({kind:new _chunk2Z3O2CFMcjs.Kc}))])}return e}var Ht,Ft,Kt,Bt,kt,I,u=class extends(kt=_chunk2Z3O2CFMcjs.Xq,Bt=[_chunk2Z3O2CFMcjs.r],Kt=[_chunk2Z3O2CFMcjs.r],Ft=[_chunk2Z3O2CFMcjs.r],Ht=[_chunk2Z3O2CFMcjs.r],kt){static get IDENTIFIERS(){return['"',["[","]"],"`"]}static get HEX_STRINGS(){return[["x'","'"],["X'","'"],["0x",""],["0X",""]]}static get ORIGINAL_KEYWORDS(){let t={..._chunk2Z3O2CFMcjs.Xq.KEYWORDS,ATTACH:"attach",DETACH:"detach","INDEXED BY":"indexedBy",MATCH:"match"};return delete t["/*+"],t}static get COMMANDS(){return new Set([...Array.from(_chunk2Z3O2CFMcjs.Xq.COMMANDS),"replace"])}};I=_chunk2Z3O2CFMcjs.a.call(void 0, kt),_chunk2Z3O2CFMcjs.d.call(void 0, I,10,"IDENTIFIERS",Bt,u),_chunk2Z3O2CFMcjs.d.call(void 0, I,10,"HEX_STRINGS",Kt,u),_chunk2Z3O2CFMcjs.d.call(void 0, I,10,"ORIGINAL_KEYWORDS",Ft,u),_chunk2Z3O2CFMcjs.d.call(void 0, I,10,"COMMANDS",Ht,u),_chunk2Z3O2CFMcjs.b.call(void 0, I,u),_chunk2Z3O2CFMcjs.c.call(void 0, I,3,u),u.NESTED_COMMENTS=!1;var Jt,Yt,Gt,Vt,Lt,bt,$t,N,o=class extends($t=_chunk2Z3O2CFMcjs.za,bt=[_chunk2Z3O2CFMcjs.r],Lt=[_chunk2Z3O2CFMcjs.r],Vt=[_chunk2Z3O2CFMcjs.r],Gt=[_chunk2Z3O2CFMcjs.r],Yt=[_chunk2Z3O2CFMcjs.r],Jt=[_chunk2Z3O2CFMcjs.r],$t){static get ID_VAR_TOKENS(){return new Set([..._chunk2Z3O2CFMcjs.za.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let t={..._chunk2Z3O2CFMcjs.za.NO_PAREN_FUNCTIONS};return delete t.localtime,delete t.localtimestamp,t}static get FUNCTIONS(){return{..._chunk2Z3O2CFMcjs.za.FUNCTIONS,EDITDIST3:t=>_chunk2Z3O2CFMcjs.Rj.fromArgList(t),STRFTIME:rs,DATETIME:t=>new (0, _chunk2Z3O2CFMcjs.Kf)({this:"DATETIME",expressions:t}),TIME:t=>new (0, _chunk2Z3O2CFMcjs.Kf)({this:"TIME",expressions:t}),SQLITE_VERSION:t=>_chunk2Z3O2CFMcjs.Yg.fromArgList(t)}}static get STATEMENT_PARSERS(){return{..._chunk2Z3O2CFMcjs.za.STATEMENT_PARSERS,attach:function(){return this.parseAttachDetach()},detach:function(){return this.parseAttachDetach({isAttach:!1})}}}static get RANGE_PARSERS(){return{..._chunk2Z3O2CFMcjs.za.RANGE_PARSERS,match:_chunk2Z3O2CFMcjs.ta.call(void 0, _chunk2Z3O2CFMcjs.Ne)}}parseUnique(){return this._constructor.CONSTRAINT_PARSERS[_nullishCoalesce(_optionalChain([this, 'access', _10 => _10.curr, 'optionalAccess', _11 => _11.text, 'access', _12 => _12.toUpperCase, 'call', _13 => _13()]), () => (""))]?this.expression(_chunk2Z3O2CFMcjs.Wc):super.parseUnique()}parseAttachDetach(t={}){let{isAttach:s=!0}=t;this.match("database");let r=this.parseExpression();return s?this.expression(_chunk2Z3O2CFMcjs.Ma,{this:r}):this.expression(_chunk2Z3O2CFMcjs.Na,{this:r})}static get TABLE_ALIAS_TOKENS(){return new Set([..._chunk2Z3O2CFMcjs.za.TABLE_ALIAS_TOKENS,"straightJoin"])}};N=_chunk2Z3O2CFMcjs.a.call(void 0, $t),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"ID_VAR_TOKENS",bt,o),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"NO_PAREN_FUNCTIONS",Lt,o),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"FUNCTIONS",Vt,o),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"STATEMENT_PARSERS",Gt,o),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"RANGE_PARSERS",Yt,o),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"TABLE_ALIAS_TOKENS",Jt,o),_chunk2Z3O2CFMcjs.b.call(void 0, N,o),_chunk2Z3O2CFMcjs.c.call(void 0, N,3,o),o.STRING_ALIASES=!0,o.ALTER_RENAME_REQUIRES_COLUMN=!1,o.JOINS_HAVE_EQUAL_PRECEDENCE=!0,o.ADD_JOIN_ON_TRUE=!0;var Xt,Wt,vt,jt,Zt,zt,Qt,f,n=class extends(Qt=_chunk2Z3O2CFMcjs.lp,zt=[_chunk2Z3O2CFMcjs.r],Zt=[_chunk2Z3O2CFMcjs.r],jt=[_chunk2Z3O2CFMcjs.r],vt=[_chunk2Z3O2CFMcjs.r],Wt=[_chunk2Z3O2CFMcjs.r],Xt=[_chunk2Z3O2CFMcjs.r],Qt){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let t=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(s=>t.delete(s)),t}static get SUPPORTED_JSON_PATH_PARTS(){return new Set([_chunk2Z3O2CFMcjs.ie,_chunk2Z3O2CFMcjs.je,_chunk2Z3O2CFMcjs.ke])}static get TYPE_MAPPING(){let t=new Map([..._chunk2Z3O2CFMcjs.lp.TYPE_MAPPING,["boolean","INTEGER"],["tinyint","INTEGER"],["smallint","INTEGER"],["int","INTEGER"],["bigint","INTEGER"],["float","REAL"],["double","REAL"],["decimal","REAL"],["char","TEXT"],["nchar","TEXT"],["varchar","TEXT"],["nvarchar","TEXT"],["binary","BLOB"],["varbinary","BLOB"]]);return t.delete("blob"),t}static get TOKEN_MAPPING(){return{autoIncrement:"AUTOINCREMENT"}}static get ORIGINAL_TRANSFORMS(){return new Map([..._chunk2Z3O2CFMcjs.lp.TRANSFORMS.entries(),[_chunk2Z3O2CFMcjs.Um,_chunk2Z3O2CFMcjs.lq],[_chunk2Z3O2CFMcjs.Kg,_chunk2Z3O2CFMcjs.pp.call(void 0, "CHAR")],[_chunk2Z3O2CFMcjs.Lg,_chunk2Z3O2CFMcjs.dq],[_chunk2Z3O2CFMcjs.fn,_chunk2Z3O2CFMcjs.aq],[_chunk2Z3O2CFMcjs.Ja,_chunk2Z3O2CFMcjs.Po.call(void 0, [ns])],[_chunk2Z3O2CFMcjs.$g,()=>"CURRENT_DATE"],[_chunk2Z3O2CFMcjs.bh,()=>"CURRENT_TIME"],[_chunk2Z3O2CFMcjs.fh,()=>"CURRENT_TIMESTAMP"],[_chunk2Z3O2CFMcjs.Yg,()=>"SQLITE_VERSION()"],[_chunk2Z3O2CFMcjs.Za,_chunk2Z3O2CFMcjs.Po.call(void 0, [es])],[_chunk2Z3O2CFMcjs.ji,function(s){return this.sql(s,"this")}],[_chunk2Z3O2CFMcjs._i,_chunk2Z3O2CFMcjs.pp.call(void 0, "IIF")],[_chunk2Z3O2CFMcjs.Ie,_chunk2Z3O2CFMcjs.vp],[_chunk2Z3O2CFMcjs.wj,function(s){return _chunk2Z3O2CFMcjs.sp.call(this,s)}],[_chunk2Z3O2CFMcjs.Rj,function(s){return _chunk2Z3O2CFMcjs.kp.call(this,s,"insCost","delCost","subCost","maxDist"),_chunk2Z3O2CFMcjs.pp.call(void 0, "EDITDIST3").call(this,s)}],[_chunk2Z3O2CFMcjs.qn,_chunk2Z3O2CFMcjs.pp.call(void 0, "MAX")],[_chunk2Z3O2CFMcjs.rn,_chunk2Z3O2CFMcjs.pp.call(void 0, "MIN")],[_chunk2Z3O2CFMcjs.Yb,_chunk2Z3O2CFMcjs.zp],[_chunk2Z3O2CFMcjs.Ck,_chunk2Z3O2CFMcjs.pp.call(void 0, "RANDOM")],[_chunk2Z3O2CFMcjs.Wd,_chunk2Z3O2CFMcjs.Po.call(void 0, [_chunk2Z3O2CFMcjs.So,_chunk2Z3O2CFMcjs.To,_chunk2Z3O2CFMcjs.bp])],[_chunk2Z3O2CFMcjs.tl,function(s){return _chunk2Z3O2CFMcjs.Ep.call(this,s,{funcName:"INSTR"})}],[_chunk2Z3O2CFMcjs.Wb,_chunk2Z3O2CFMcjs.yp],[_chunk2Z3O2CFMcjs.Kl,function(s){return this.sql(s,"this")}],[_chunk2Z3O2CFMcjs.Hl,function(s){return this.func("STRFTIME",[s.args.format,s.args.this])}],[_chunk2Z3O2CFMcjs.bn,_chunk2Z3O2CFMcjs.Ap],[_chunk2Z3O2CFMcjs.Sl,function(s){return this.sql(s,"this")}]])}static get PROPERTIES_LOCATION(){let t=new Map;for(let s of _chunk2Z3O2CFMcjs.lp.PROPERTIES_LOCATION.keys())t.set(s,"unsupported");return t.set(_chunk2Z3O2CFMcjs.od,"postSchema"),t.set(_chunk2Z3O2CFMcjs.Kd,"postCreate"),t}jsonExtractSql(t){return t.args.expressions&&0<t.args.expressions.length?this.functionFallbackSql(t):_chunk2Z3O2CFMcjs.sp.call(this,t)}dateAddSql(t){let s=t.args.expression,r=s instanceof _chunk2Z3O2CFMcjs.$c&&s.isString?s.name:this.sql(s),i=t.args.unit,T=i?`'${r} ${i.name}'`:`'${r}'`;return this.func("DATE",[t.args.this,T])}castSql(t,s={}){return t.isType("date")?this.func("DATE",[t.args.this]):super.castSql(t,s)}truncSql(t){return _chunk2Z3O2CFMcjs.kp.call(this,t,"decimals"),this.func("TRUNC",[t.args.this])}generateSeriesSql(t){let r=_optionalChain([t, 'access', _14 => _14.parent, 'optionalAccess', _15 => _15.args, 'access', _16 => _16.alias]);if(r instanceof _chunk2Z3O2CFMcjs.Ya&&_optionalChain([r, 'access', _17 => _17.args, 'access', _18 => _18.columns, 'optionalAccess', _19 => _19.length])){let i=r.args.columns[0];return r.setArgKey("columns",void 0),this.sql(new (0, _chunk2Z3O2CFMcjs.Wd)({expressions:[_chunk2Z3O2CFMcjs.ho.call(void 0, "value",i)]}).from(t).subquery())}return this.functionFallbackSql(t)}dateDiffSql(t){let s=(t.text("unit")||"DAY").toUpperCase(),r=`(JULIANDAY(${this.sql(t,"this")}) - JULIANDAY(${this.sql(t,"expression")}))`,i={MONTH:" / 30.0",YEAR:" / 365.0",HOUR:" * 24.0",MINUTE:" * 1440.0",SECOND:" * 86400.0",MILLISECOND:" * 86400000.0",MICROSECOND:" * 86400000000.0",NANOSECOND:" * 8640000000000.0"};if(s!=="DAY"){let T=i[s];T?r=`${r}${T}`:this.unsupported(`DATEDIFF unsupported for '${s}'.`)}return`CAST(${r} AS INTEGER)`}groupConcatSql(t){let s=t.args.this,r=t.find(_chunk2Z3O2CFMcjs.nc),i="";r&&(s=_optionalChain([r, 'access', _20 => _20.args, 'access', _21 => _21.expressions, 'optionalAccess', _22 => _22[0]]),i="DISTINCT "),t.args.this instanceof _chunk2Z3O2CFMcjs.Fb&&(this.unsupported("SQLite GROUP_CONCAT doesn't support ORDER BY."),t.args.this.args.this&&!r&&(s=t.args.this.args.this));let T=t.args.separator;return`GROUP_CONCAT(${i}${this.formatArgs([s,T])})`}leastSql(t){return t.args.expressions&&0<t.args.expressions.length?_chunk2Z3O2CFMcjs.pp.call(void 0, "MIN").call(this,t):this.sql(t,"this")}transactionSql(t){let s=t.args.this;return`BEGIN${s?` ${s}`:""} TRANSACTION`}isAsciiSql(t){return`(NOT ${this.sql(t.args.this)} GLOB CAST(x'2a5b5e012d7f5d2a' AS TEXT))`}currentSchemaSql(t){return _chunk2Z3O2CFMcjs.kp.call(this,t,"this"),"'main'"}ignoreNullsSql(t){return this.unsupported("SQLite does not support IGNORE NULLS."),this.sql(t.args.this)}respectNullsSql(t){return this.sql(t.args.this)}windowSpecSql(t){return t.text("kind").toUpperCase()==="RANGE"&&t.text("start").toUpperCase()==="CURRENT ROW"?"RANGE CURRENT ROW":super.windowSpecSql(t)}};f=_chunk2Z3O2CFMcjs.a.call(void 0, Qt),_chunk2Z3O2CFMcjs.d.call(void 0, f,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",zt,n),_chunk2Z3O2CFMcjs.d.call(void 0, f,10,"SUPPORTED_JSON_PATH_PARTS",Zt,n),_chunk2Z3O2CFMcjs.d.call(void 0, f,10,"TYPE_MAPPING",jt,n),_chunk2Z3O2CFMcjs.d.call(void 0, f,10,"TOKEN_MAPPING",vt,n),_chunk2Z3O2CFMcjs.d.call(void 0, f,10,"ORIGINAL_TRANSFORMS",Wt,n),_chunk2Z3O2CFMcjs.d.call(void 0, f,10,"PROPERTIES_LOCATION",Xt,n),_chunk2Z3O2CFMcjs.b.call(void 0, f,n),_chunk2Z3O2CFMcjs.c.call(void 0, f,3,n),n.SUPPORTS_DECODE_CASE=!1,n.SELECT_KINDS=[],n.TRY_SUPPORTED=!1,n.SUPPORTS_UESCAPE=!1,n.JOIN_HINTS=!1,n.TABLE_HINTS=!1,n.QUERY_HINTS=!1,n.NVL2_SUPPORTED=!1,n.JSON_PATH_BRACKETED_KEY_SUPPORTED=!1,n.SUPPORTS_CREATE_TABLE_LIKE=!1,n.SUPPORTS_TABLE_ALIAS_COLUMNS=!1,n.SUPPORTS_TO_NUMBER=!1,n.SUPPORTS_WINDOW_EXCLUDE=!0,n.EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE=!1,n.SUPPORTS_MEDIAN=!1,n.JSON_KEY_VALUE_PAIR_SEP=",",n.PARSE_JSON_NAME=void 0,n.LIMIT_FETCH="LIMIT";var ts,ss,J,c= exports.SQLite =class extends(ss=_chunk2Z3O2CFMcjs.op,ts=[_chunk2Z3O2CFMcjs.r],ss){static get NORMALIZATION_STRATEGY(){return"caseInsensitive"}};J=_chunk2Z3O2CFMcjs.a.call(void 0, ss),_chunk2Z3O2CFMcjs.d.call(void 0, J,10,"NORMALIZATION_STRATEGY",ts,c),_chunk2Z3O2CFMcjs.b.call(void 0, J,c),_chunk2Z3O2CFMcjs.c.call(void 0, J,3,c),c.DIALECT_NAME="sqlite",c.SUPPORTS_SEMI_ANTI_JOIN=!1,c.TYPED_DIVISION=!0,c.SAFE_DIVISION=!0,c.SAFE_TO_ELIMINATE_DOUBLE_NEGATION=!1,c.Tokenizer=u,c.Parser=o,c.Generator=n;_chunk2Z3O2CFMcjs.op.register("sqlite",c);exports.SQLite = c;
|
|
2
|
+
//# sourceMappingURL=sqlite.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/huydna/projects/sqlingo.js/dist/dialects/sqlite.cjs","../../src/dialects/sqlite.ts"],"names":["buildStrftime","args","CurrentTimestampExpr","TimeToStrExpr","TsOrDsToTimestampExpr","AnonymousExpr","transformCreate","expression","schema","CreateExpr","SchemaExpr","defs","primaryKey","e","ColumnDefExpr","PrimaryKeyExpr","columnName","column","ColumnConstraintExpr","PrimaryKeyColumnConstraintExpr","autoIncrement","constraint","constraintExpr","AutoIncrementColumnConstraintExpr","c","generatedToAutoIncrement","generated","GeneratedAsIdentityColumnConstraintExpr","notNull","NotNullColumnConstraintExpr","_COMMANDS_dec","_ORIGINAL_KEYWORDS_dec","_HEX_STRINGS_dec","_IDENTIFIERS_dec","_a","_init","SQLiteTokenizer","Tokenizer","cache","keywords","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","_TABLE_ALIAS_TOKENS_dec","_RANGE_PARSERS_dec","_STATEMENT_PARSERS_dec","_FUNCTIONS_dec","_NO_PAREN_FUNCTIONS_dec","_ID_VAR_TOKENS_dec","SQLiteParser","Parser","noParenFunctions","LevenshteinExpr","CurrentVersionExpr","binaryRangeParser","UniqueColumnConstraintExpr","options","isAttach","thisNode","AttachExpr","DetachExpr","_PROPERTIES_LOCATION_dec","_ORIGINAL_TRANSFORMS_dec","_TOKEN_MAPPING_dec","_TYPE_MAPPING_dec","_SUPPORTED_JSON_PATH_PARTS_dec","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","SQLiteGenerator","Generator","modifiers","m","JsonPathKeyExpr","JsonPathRootExpr","JsonPathSubscriptExpr","mapping","AnyValueExpr","anyValueToMaxSql","ChrExpr","renameFunc","ConcatExpr","concatToDPipeSql","CountIfExpr","countIfToSum","preprocess","CurrentDateExpr","CurrentTimeExpr","DateStrToDateExpr","IfExpr","ILikeExpr","noIlikeSql","JsonExtractScalarExpr","arrowJsonExtractSql","unsupportedArgs","LogicalOrExpr","LogicalAndExpr","PivotExpr","noPivotSql","RandExpr","SelectExpr","eliminateDistinctOn","eliminateQualify","eliminateSemiAndAntiJoins","StrPositionExpr","strPositionSql","TableSampleExpr","noTablesampleSql","TimeStrToTimeExpr","TryCastExpr","noTrycastSql","locations","prop","LikePropertyExpr","TemporaryPropertyExpr","modifier","modifierSql","LiteralExpr","unit","finalModifier","aliasExpr","TableAliasExpr","columnAlias","alias","sql","multipliers","adjustment"],"mappings":"AAAA,0uBAAwoB,SCuG/nBA,EAAAA,CAAeC,CAAAA,CAAmD,CAKzE,OAJIA,CAAAA,CAAK,MAAA,GAAW,CAAA,EAClBA,CAAAA,CAAK,IAAA,CAAK,IAAIC,yBAAAA,CAAqB,CAAC,CAAC,CAAC,CAAA,CAGpCD,CAAAA,CAAK,MAAA,GAAW,CAAA,CACX,IAAIE,yBAAAA,CAAc,CACvB,IAAA,CAAM,IAAIC,yBAAAA,CAAsB,CAC9B,IAAA,CAAMH,CAAAA,CAAK,CAAC,CACd,CAAC,CAAA,CACD,MAAA,CAAQA,CAAAA,CAAK,CAAC,CAChB,CAAC,CAAA,CAGI,IAAII,yBAAAA,CAAc,CACvB,IAAA,CAAM,UAAA,CACN,WAAA,CAAaJ,CACf,CAAC,CACH,CAEA,SAASK,EA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A,CACjC,IAAA,CAAK,GAAA,CACV,IAAIpB,yBAAAA,CAAW,CACb,WAAA,CAAa,CACXuB,kCAAAA,OAAM,CAASD,CAAW,CAC5B,CACF,CAAC,CAAA,CACE,IAAA,CAAKlH,CAAU,CAAA,CACf,QAAA,CAAS,CACd,CACF,CAEA,OAAO,IAAA,CAAK,mBAAA,CAAoBA,CAAU,CAC5C,CAEA,WAAA,CAAaA,CAAAA,CAAkC,CAC7C,IAAM8G,CAAAA,CAAAA,CAAQ9G,CAAAA,CAAW,IAAA,CAAK,MAAM,CAAA,EAAK,KAAA,CAAA,CAAO,WAAA,CAAY,CAAA,CAExDoH,CAAAA,CAAM,CAAA,WAAA,EAAc,IAAA,CAAK,GAAA,CAAIpH,CAAAA,CAAY,MAAM,CAAC,CAAA,cAAA,EAAiB,IAAA,CAAK,GAAA,CAAIA,CAAAA,CAAY,YAAY,CAAC,CAAA,EAAA,CAAA,CAEjGqH,CAAAA,CAAsC,CAC1C,KAAA,CAAO,SAAA,CACP,IAAA,CAAM,UAAA,CACN,IAAA,CAAM,SAAA,CACN,MAAA,CAAQ,WAAA,CACR,MAAA,CAAQ,YAAA,CACR,WAAA,CAAa,eAAA,CACb,WAAA,CAAa,kBAAA,CACb,UAAA,CAAY,oBACd,CAAA,CAEA,EAAA,CAAIP,CAAAA,GAAS,KAAA,CAAO,CAClB,IAAMQ,CAAAA,CAAaD,CAAAA,CAAYP,CAAI,CAAA,CAC/BQ,CAAAA,CACFF,CAAAA,CAAM,CAAA,EAAA","file":"/home/huydna/projects/sqlingo.js/dist/dialects/sqlite.cjs","sourcesContent":[null,"import {\n cache,\n} from '../port_internals';\nimport {\n Generator,\n unsupportedArgs,\n} from '../generator';\nimport {\n Parser, binaryRangeParser,\n} from '../parser';\nimport type {\n TokenPair,\n} from '../tokens';\nimport {\n Tokenizer, TokenType,\n} from '../tokens';\nimport type {\n Expression,\n DateAddExpr,\n CastExpr,\n TruncExpr,\n GenerateSeriesExpr,\n DateDiffExpr,\n GroupConcatExpr,\n LeastExpr,\n TransactionExpr,\n IsAsciiExpr,\n CurrentSchemaExpr,\n IgnoreNullsExpr,\n RespectNullsExpr,\n WindowSpecExpr,\n JsonExtractExpr,\n IdentifierExpr,\n} from '../expressions';\nimport {\n AnonymousExpr,\n TimeToStrExpr,\n TsOrDsToTimestampExpr,\n CreateExpr,\n SchemaExpr,\n ColumnDefExpr,\n PrimaryKeyExpr,\n PrimaryKeyColumnConstraintExpr,\n ColumnConstraintExpr,\n AutoIncrementColumnConstraintExpr,\n GeneratedAsIdentityColumnConstraintExpr,\n NotNullColumnConstraintExpr,\n MatchExpr,\n AttachExpr,\n DetachExpr,\n LevenshteinExpr,\n CurrentTimestampExpr,\n CurrentVersionExpr,\n DataTypeExprKind,\n AnyValueExpr,\n ChrExpr,\n ConcatExpr,\n CountIfExpr,\n CurrentDateExpr,\n CurrentTimeExpr,\n DateStrToDateExpr,\n IfExpr,\n ILikeExpr,\n LogicalOrExpr,\n LogicalAndExpr,\n PivotExpr,\n RandExpr,\n SelectExpr,\n StrPositionExpr,\n TableSampleExpr,\n TimeStrToTimeExpr,\n TryCastExpr,\n PropertiesLocation,\n LikePropertyExpr,\n TemporaryPropertyExpr,\n TableAliasExpr,\n DistinctExpr,\n OrderExpr,\n UniqueColumnConstraintExpr,\n LiteralExpr,\n JsonPathKeyExpr,\n JsonPathRootExpr,\n JsonPathSubscriptExpr,\n JsonExtractScalarExpr,\n alias,\n} from '../expressions';\nimport {\n eliminateDistinctOn, eliminateQualify, eliminateSemiAndAntiJoins, preprocess,\n} from '../transforms';\nimport {\n anyValueToMaxSql,\n arrowJsonExtractSql,\n concatToDPipeSql,\n countIfToSum,\n noIlikeSql,\n noPivotSql,\n noTablesampleSql,\n noTrycastSql,\n strPositionSql,\n renameFunc,\n Dialect, NormalizationStrategy, Dialects,\n} from './dialect';\n\nfunction buildStrftime (args: Expression[]): AnonymousExpr | TimeToStrExpr {\n if (args.length === 1) {\n args.push(new CurrentTimestampExpr({}));\n }\n\n if (args.length === 2) {\n return new TimeToStrExpr({\n this: new TsOrDsToTimestampExpr({\n this: args[1],\n }),\n format: args[0],\n });\n }\n\n return new AnonymousExpr({\n this: 'STRFTIME',\n expressions: args,\n });\n}\n\nfunction transformCreate (expression: Expression): Expression {\n /** Move primary key to a column and enforce auto_increment on primary keys. */\n const schema = (expression as CreateExpr).args.this;\n\n if (expression instanceof CreateExpr && schema instanceof SchemaExpr) {\n const defs: Record<string, ColumnDefExpr> = {};\n let primaryKey: PrimaryKeyExpr | undefined = undefined;\n\n for (const e of (schema.args.expressions || [\n ])) {\n if (e instanceof ColumnDefExpr) {\n defs[e.name] = e;\n } else if (e instanceof PrimaryKeyExpr) {\n primaryKey = e;\n }\n }\n\n if (primaryKey && (primaryKey.args.expressions || [\n ]).length === 1) {\n const columnName = ((primaryKey.args.expressions || [\n ])[0] as IdentifierExpr).name;\n const column = defs[columnName];\n\n if (!column.args.constraints) {\n column.setArgKey('constraints', [\n ]);\n }\n if (!column.args.constraints) {\n column.setArgKey('constraints', [\n ]);\n }\n column.args.constraints?.push(\n new ColumnConstraintExpr({\n kind: new PrimaryKeyColumnConstraintExpr(),\n }),\n );\n\n schema.setArgKey('expressions', (schema.args.expressions || [\n ]).filter((e) => e !== primaryKey));\n } else {\n for (const column of Object.values(defs)) {\n let autoIncrement: ColumnConstraintExpr | undefined;\n\n for (const constraint of (column.args.constraints || [\n ])) {\n const constraintExpr = constraint as ColumnConstraintExpr;\n if ((constraintExpr.args.kind as unknown) instanceof PrimaryKeyColumnConstraintExpr) {\n autoIncrement = undefined; // Reset if we hit a PK to stop processing this column\n break;\n }\n if ((constraintExpr.args.kind as unknown) instanceof AutoIncrementColumnConstraintExpr) {\n autoIncrement = constraintExpr;\n }\n }\n\n if (autoIncrement) {\n column.setArgKey('constraints', (column.args.constraints || [\n ]).filter((c) => c !== autoIncrement));\n }\n }\n }\n }\n\n return expression;\n}\n\nfunction generatedToAutoIncrement (expression: Expression): Expression {\n if (!(expression instanceof ColumnDefExpr)) {\n return expression;\n }\n\n const generated = expression.find(GeneratedAsIdentityColumnConstraintExpr);\n\n if (generated) {\n (generated.parent as ColumnConstraintExpr).pop();\n\n const notNull = expression.find(NotNullColumnConstraintExpr);\n if (notNull) {\n (notNull.parent as ColumnConstraintExpr).pop();\n }\n\n if (!expression.args.constraints) {\n expression.setArgKey('constraints', [\n ]);\n }\n expression.args.constraints?.push(\n new ColumnConstraintExpr({\n kind: new AutoIncrementColumnConstraintExpr(),\n }),\n );\n }\n\n return expression;\n}\n\nclass SQLiteTokenizer extends Tokenizer {\n @cache\n static get IDENTIFIERS (): TokenPair[] {\n return [\n '\"',\n [\n '[',\n ']',\n ],\n '`',\n ];\n }\n\n @cache\n static get HEX_STRINGS (): TokenPair[] {\n return [\n [\n 'x\\'',\n '\\'',\n ],\n [\n 'X\\'',\n '\\'',\n ],\n [\n '0x',\n '',\n ],\n [\n '0X',\n '',\n ],\n ];\n }\n\n static NESTED_COMMENTS = false;\n\n @cache\n static get ORIGINAL_KEYWORDS (): Record<string, TokenType> {\n const keywords: Record<string, TokenType> = {\n ...Tokenizer.KEYWORDS,\n 'ATTACH': TokenType.ATTACH,\n 'DETACH': TokenType.DETACH,\n 'INDEXED BY': TokenType.INDEXED_BY,\n 'MATCH': TokenType.MATCH,\n };\n delete keywords['/*+'];\n return keywords;\n }\n\n @cache\n static get COMMANDS () {\n return new Set([\n ...Array.from(Tokenizer.COMMANDS),\n TokenType.REPLACE,\n ]);\n }\n}\n\nclass SQLiteParser extends 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 ...Parser.NO_PAREN_FUNCTIONS,\n };\n delete noParenFunctions[TokenType.LOCALTIME];\n delete noParenFunctions[TokenType.LOCALTIMESTAMP];\n return noParenFunctions;\n }\n\n static STRING_ALIASES = true;\n static ALTER_RENAME_REQUIRES_COLUMN = false;\n static JOINS_HAVE_EQUAL_PRECEDENCE = true;\n static ADD_JOIN_ON_TRUE = true;\n @cache\n static get FUNCTIONS (): Record<string, (args: Expression[], options: {dialect: Dialect}) => Expression> {\n return {\n ...Parser.FUNCTIONS,\n EDITDIST3: (args: unknown[]) => LevenshteinExpr.fromArgList(args),\n STRFTIME: buildStrftime,\n DATETIME: (args: Expression[]) => new AnonymousExpr({\n this: 'DATETIME',\n expressions: args,\n }),\n TIME: (args: Expression[]) => new AnonymousExpr({\n this: 'TIME',\n expressions: args,\n }),\n SQLITE_VERSION: (args: unknown[]) => CurrentVersionExpr.fromArgList(args),\n };\n }\n\n @cache\n static get STATEMENT_PARSERS (): Partial<Record<TokenType, (this: Parser) => Expression | undefined>> {\n return {\n ...Parser.STATEMENT_PARSERS,\n [TokenType.ATTACH]: function (this: Parser) {\n return (this as SQLiteParser).parseAttachDetach();\n },\n [TokenType.DETACH]: function (this: Parser) {\n return (this as SQLiteParser).parseAttachDetach({\n isAttach: false,\n });\n },\n };\n }\n\n @cache\n static get RANGE_PARSERS (): Partial<Record<TokenType, (this: Parser, this_: Expression) => Expression | undefined>> {\n return {\n ...Parser.RANGE_PARSERS,\n [TokenType.MATCH]: binaryRangeParser(MatchExpr),\n };\n }\n\n parseUnique (): UniqueColumnConstraintExpr {\n // Do not consume more tokens if UNIQUE is used as a standalone constraint\n if (this._constructor.CONSTRAINT_PARSERS[this.curr?.text.toUpperCase() ?? '']) {\n return this.expression(UniqueColumnConstraintExpr);\n }\n\n return super.parseUnique();\n }\n\n parseAttachDetach (options: {isAttach?: boolean} = {}): AttachExpr | DetachExpr {\n const {\n isAttach = true,\n } = options;\n this.match(TokenType.DATABASE);\n const thisNode = this.parseExpression();\n\n return isAttach\n ? this.expression(AttachExpr, {\n this: thisNode,\n })\n : this.expression(DetachExpr, {\n this: thisNode,\n });\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get TABLE_ALIAS_TOKENS (): Set<TokenType> {\n return new Set([\n ...Parser.TABLE_ALIAS_TOKENS,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n}\nclass SQLiteGenerator extends 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 readonly SELECT_KINDS: string[] = [\n ];\n // port from _Dialect metaclass logic\n static TRY_SUPPORTED = false;\n // port from _Dialect metaclass logic\n static SUPPORTS_UESCAPE = false;\n static JOIN_HINTS = false;\n static TABLE_HINTS = false;\n static QUERY_HINTS = false;\n static NVL2_SUPPORTED = false;\n static JSON_PATH_BRACKETED_KEY_SUPPORTED = false;\n static SUPPORTS_CREATE_TABLE_LIKE = false;\n static SUPPORTS_TABLE_ALIAS_COLUMNS = false;\n static SUPPORTS_TO_NUMBER = false;\n static SUPPORTS_WINDOW_EXCLUDE = true;\n static EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE = false;\n static SUPPORTS_MEDIAN = false;\n static JSON_KEY_VALUE_PAIR_SEP = ',';\n static PARSE_JSON_NAME = undefined;\n\n @cache\n static get SUPPORTED_JSON_PATH_PARTS (): Set<typeof Expression> {\n return new Set([\n JsonPathKeyExpr,\n JsonPathRootExpr,\n JsonPathSubscriptExpr,\n ]);\n }\n\n @cache\n static get TYPE_MAPPING (): Map<DataTypeExprKind | string, string> {\n const mapping = new Map<DataTypeExprKind | string, string>([\n ...Generator.TYPE_MAPPING,\n [\n DataTypeExprKind.BOOLEAN,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.TINYINT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.SMALLINT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.INT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.BIGINT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.FLOAT,\n 'REAL',\n ],\n [\n DataTypeExprKind.DOUBLE,\n 'REAL',\n ],\n [\n DataTypeExprKind.DECIMAL,\n 'REAL',\n ],\n [\n DataTypeExprKind.CHAR,\n 'TEXT',\n ],\n [\n DataTypeExprKind.NCHAR,\n 'TEXT',\n ],\n [\n DataTypeExprKind.VARCHAR,\n 'TEXT',\n ],\n [\n DataTypeExprKind.NVARCHAR,\n 'TEXT',\n ],\n [\n DataTypeExprKind.BINARY,\n 'BLOB',\n ],\n [\n DataTypeExprKind.VARBINARY,\n 'BLOB',\n ],\n ]);\n\n mapping.delete(DataTypeExprKind.BLOB);\n\n return mapping;\n }\n\n @cache\n static get TOKEN_MAPPING () {\n return {\n [TokenType.AUTO_INCREMENT]: 'AUTOINCREMENT',\n } as Record<TokenType, string>;\n }\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 ...Generator.TRANSFORMS.entries(),\n [\n AnyValueExpr,\n anyValueToMaxSql,\n ],\n [\n ChrExpr,\n renameFunc('CHAR'),\n ],\n [\n ConcatExpr,\n concatToDPipeSql,\n ],\n [\n CountIfExpr,\n countIfToSum,\n ],\n [\n CreateExpr,\n preprocess([\n transformCreate,\n ]),\n ],\n [\n CurrentDateExpr,\n () => 'CURRENT_DATE',\n ],\n [\n CurrentTimeExpr,\n () => 'CURRENT_TIME',\n ],\n [\n CurrentTimestampExpr,\n () => 'CURRENT_TIMESTAMP',\n ],\n [\n CurrentVersionExpr,\n () => 'SQLITE_VERSION()',\n ],\n [\n ColumnDefExpr,\n preprocess([\n generatedToAutoIncrement,\n ]),\n ],\n [\n DateStrToDateExpr,\n function (this: Generator, e: DateStrToDateExpr) {\n return this.sql(e, 'this');\n },\n ],\n [\n IfExpr,\n renameFunc('IIF'),\n ],\n [\n ILikeExpr,\n noIlikeSql,\n ],\n [\n JsonExtractScalarExpr,\n function (this: Generator, e: JsonExtractScalarExpr) {\n return arrowJsonExtractSql.call(this, e);\n },\n ],\n [\n LevenshteinExpr,\n function (this: Generator, e) {\n unsupportedArgs.call(this, e, 'insCost', 'delCost', 'subCost', 'maxDist');\n return renameFunc('EDITDIST3').call(this, e);\n },\n ],\n [\n LogicalOrExpr,\n renameFunc('MAX'),\n ],\n [\n LogicalAndExpr,\n renameFunc('MIN'),\n ],\n [\n PivotExpr,\n noPivotSql,\n ],\n [\n RandExpr,\n renameFunc('RANDOM'),\n ],\n [\n SelectExpr,\n preprocess([\n eliminateDistinctOn,\n eliminateQualify,\n eliminateSemiAndAntiJoins,\n ]),\n ],\n [\n StrPositionExpr,\n function (this: Generator, e: StrPositionExpr) {\n return strPositionSql.call(this, e, {\n funcName: 'INSTR',\n });\n },\n ],\n [\n TableSampleExpr,\n noTablesampleSql,\n ],\n [\n TimeStrToTimeExpr,\n function (this: Generator, e: TimeStrToTimeExpr) {\n return this.sql(e, 'this');\n },\n ],\n [\n TimeToStrExpr,\n function (this: Generator, e: TimeToStrExpr) {\n return this.func('STRFTIME', [\n e.args.format,\n e.args.this,\n ]);\n },\n ],\n [\n TryCastExpr,\n noTrycastSql,\n ],\n [\n TsOrDsToTimestampExpr,\n function (this: Generator, e: TsOrDsToTimestampExpr) {\n return this.sql(e, 'this');\n },\n ],\n ]);\n\n return transforms;\n }\n\n @cache\n static get PROPERTIES_LOCATION (): Map<typeof Expression, PropertiesLocation> {\n const locations = new Map<typeof Expression, PropertiesLocation>();\n\n // Initialize all base properties as UNSUPPORTED for SQLite\n for (const prop of Generator.PROPERTIES_LOCATION.keys()) {\n locations.set(prop, PropertiesLocation.UNSUPPORTED);\n }\n\n // Override specific supported properties\n locations.set(LikePropertyExpr, PropertiesLocation.POST_SCHEMA);\n locations.set(TemporaryPropertyExpr, PropertiesLocation.POST_CREATE);\n\n return locations;\n }\n\n static LIMIT_FETCH = 'LIMIT';\n\n jsonExtractSql (expression: JsonExtractExpr): string {\n if (expression.args.expressions && 0 < expression.args.expressions.length) {\n return this.functionFallbackSql(expression);\n }\n return arrowJsonExtractSql.call(this, expression);\n }\n\n dateAddSql (expression: DateAddExpr): string {\n const modifier = expression.args.expression;\n const modifierSql = modifier instanceof LiteralExpr && modifier.isString\n ? modifier.name\n : this.sql(modifier);\n\n const unit = expression.args.unit;\n const finalModifier = unit ? `'${modifierSql} ${unit.name}'` : `'${modifierSql}'`;\n\n return this.func('DATE', [\n expression.args.this,\n finalModifier,\n ]);\n }\n\n castSql (expression: CastExpr, options: {safePrefix?: string} = {}): string {\n if (expression.isType('date')) {\n return this.func('DATE', [\n expression.args.this,\n ]);\n }\n return super.castSql(expression, options);\n }\n\n truncSql (expression: TruncExpr): string {\n unsupportedArgs.call(this, expression, 'decimals');\n return this.func('TRUNC', [\n expression.args.this,\n ]);\n }\n\n generateSeriesSql (expression: GenerateSeriesExpr): string {\n const parent = expression.parent;\n const aliasExpr = parent?.args.alias;\n\n if (aliasExpr instanceof TableAliasExpr && aliasExpr.args.columns?.length) {\n const columnAlias = aliasExpr.args.columns[0];\n aliasExpr.setArgKey('columns', undefined);\n return this.sql(\n new SelectExpr({\n expressions: [\n alias('value', columnAlias),\n ],\n })\n .from(expression)\n .subquery(),\n );\n }\n\n return this.functionFallbackSql(expression);\n }\n\n dateDiffSql (expression: DateDiffExpr): string {\n const unit = (expression.text('unit') || 'DAY').toUpperCase();\n\n let sql = `(JULIANDAY(${this.sql(expression, 'this')}) - JULIANDAY(${this.sql(expression, 'expression')}))`;\n\n const multipliers: Record<string, string> = {\n MONTH: ' / 30.0',\n YEAR: ' / 365.0',\n HOUR: ' * 24.0',\n MINUTE: ' * 1440.0',\n SECOND: ' * 86400.0',\n MILLISECOND: ' * 86400000.0',\n MICROSECOND: ' * 86400000000.0',\n NANOSECOND: ' * 8640000000000.0',\n };\n\n if (unit !== 'DAY') {\n const adjustment = multipliers[unit];\n if (adjustment) {\n sql = `${sql}${adjustment}`;\n } else {\n this.unsupported(`DATEDIFF unsupported for '${unit}'.`);\n }\n }\n\n return `CAST(${sql} AS INTEGER)`;\n }\n\n groupConcatSql (expression: GroupConcatExpr): string {\n let thisNode: Expression | undefined = expression.args.this;\n const distinct = expression.find(DistinctExpr);\n let distinctSql = '';\n\n if (distinct) {\n thisNode = distinct.args.expressions?.[0];\n distinctSql = 'DISTINCT ';\n }\n\n if (expression.args.this instanceof OrderExpr) {\n this.unsupported('SQLite GROUP_CONCAT doesn\\'t support ORDER BY.');\n if (expression.args.this.args.this && !distinct) {\n thisNode = expression.args.this.args.this;\n }\n }\n\n const separator = expression.args.separator;\n return `GROUP_CONCAT(${distinctSql}${this.formatArgs([\n thisNode,\n separator,\n ])})`;\n }\n\n leastSql (expression: LeastExpr): string {\n if (expression.args.expressions && 0 < expression.args.expressions.length) {\n return renameFunc('MIN').call(this, expression);\n }\n return this.sql(expression, 'this');\n }\n\n transactionSql (expression: TransactionExpr): string {\n const thisNode = expression.args.this;\n const thisPart = thisNode ? ` ${thisNode}` : '';\n return `BEGIN${thisPart} TRANSACTION`;\n }\n\n isAsciiSql (expression: IsAsciiExpr): string {\n return `(NOT ${this.sql(expression.args.this)} GLOB CAST(x'2a5b5e012d7f5d2a' AS TEXT))`;\n }\n\n currentSchemaSql (_expression: CurrentSchemaExpr): string {\n unsupportedArgs.call(this, _expression, 'this');\n return '\\'main\\'';\n }\n\n ignoreNullsSql (expression: IgnoreNullsExpr): string {\n this.unsupported('SQLite does not support IGNORE NULLS.');\n return this.sql(expression.args.this);\n }\n\n respectNullsSql (expression: RespectNullsExpr): string {\n return this.sql(expression.args.this);\n }\n\n windowSpecSql (expression: WindowSpecExpr): string {\n if (\n expression.text('kind').toUpperCase() === 'RANGE'\n && expression.text('start').toUpperCase() === 'CURRENT ROW'\n ) {\n return 'RANGE CURRENT ROW';\n }\n\n return super.windowSpecSql(expression);\n }\n}\n\nexport class SQLite extends Dialect {\n static DIALECT_NAME = Dialects.SQLITE;\n\n @cache\n static get NORMALIZATION_STRATEGY () {\n return NormalizationStrategy.CASE_INSENSITIVE;\n }\n\n static SUPPORTS_SEMI_ANTI_JOIN = false;\n static TYPED_DIVISION = true;\n static SAFE_DIVISION = true;\n static SAFE_TO_ELIMINATE_DOUBLE_NEGATION = false;\n\n static Tokenizer = SQLiteTokenizer;\n static Parser = SQLiteParser;\n static Generator = SQLiteGenerator;\n}\n\nDialect.register(Dialects.SQLITE, SQLite);\n"]}
|