@hdnax/sqlingo.js 0.0.4 → 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 +12 -0
- package/README.md +8 -14
- package/README.npm.md +8 -14
- 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,510 @@
|
|
|
1
|
+
import { c as Dialect, d as Dialects, a0 as NormalizationStrategy, m as Tokenizer, _ as TokenPair, l as TokenType, i as Parser, E as Expression, dT as UniqueColumnConstraintExpr, bt as AttachExpr, bu as DetachExpr, G as Generator, $ as DataTypeExprKind, aj as PropertiesLocation, dy as JsonExtractExpr, dU as DateAddExpr, at as CastExpr, bN as TruncExpr, bT as GenerateSeriesExpr, az as DateDiffExpr, dV as GroupConcatExpr, bG as LeastExpr, dW as TransactionExpr, cL as IsAsciiExpr, d5 as CurrentSchemaExpr, cc as IgnoreNullsExpr, cd as RespectNullsExpr, dX as WindowSpecExpr } from '../tokens-VcMD09XM.js';
|
|
2
|
+
|
|
3
|
+
declare class SQLiteTokenizer extends Tokenizer {
|
|
4
|
+
static get IDENTIFIERS(): TokenPair[];
|
|
5
|
+
static get HEX_STRINGS(): TokenPair[];
|
|
6
|
+
static NESTED_COMMENTS: boolean;
|
|
7
|
+
static get ORIGINAL_KEYWORDS(): Record<string, TokenType>;
|
|
8
|
+
static get COMMANDS(): Set<TokenType>;
|
|
9
|
+
}
|
|
10
|
+
declare class SQLiteParser extends 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 STRING_ALIASES: boolean;
|
|
442
|
+
static ALTER_RENAME_REQUIRES_COLUMN: boolean;
|
|
443
|
+
static JOINS_HAVE_EQUAL_PRECEDENCE: boolean;
|
|
444
|
+
static ADD_JOIN_ON_TRUE: boolean;
|
|
445
|
+
static get FUNCTIONS(): Record<string, (args: Expression[], options: {
|
|
446
|
+
dialect: Dialect;
|
|
447
|
+
}) => Expression>;
|
|
448
|
+
static get STATEMENT_PARSERS(): Partial<Record<TokenType, (this: Parser) => Expression | undefined>>;
|
|
449
|
+
static get RANGE_PARSERS(): Partial<Record<TokenType, (this: Parser, this_: Expression) => Expression | undefined>>;
|
|
450
|
+
parseUnique(): UniqueColumnConstraintExpr;
|
|
451
|
+
parseAttachDetach(options?: {
|
|
452
|
+
isAttach?: boolean;
|
|
453
|
+
}): AttachExpr | DetachExpr;
|
|
454
|
+
static get TABLE_ALIAS_TOKENS(): Set<TokenType>;
|
|
455
|
+
}
|
|
456
|
+
declare class SQLiteGenerator extends Generator {
|
|
457
|
+
static get AFTER_HAVING_MODIFIER_TRANSFORMS(): Map<string, (this: Generator, e: Expression) => string>;
|
|
458
|
+
static SUPPORTS_DECODE_CASE: boolean;
|
|
459
|
+
static readonly SELECT_KINDS: string[];
|
|
460
|
+
static TRY_SUPPORTED: boolean;
|
|
461
|
+
static SUPPORTS_UESCAPE: boolean;
|
|
462
|
+
static JOIN_HINTS: boolean;
|
|
463
|
+
static TABLE_HINTS: boolean;
|
|
464
|
+
static QUERY_HINTS: boolean;
|
|
465
|
+
static NVL2_SUPPORTED: boolean;
|
|
466
|
+
static JSON_PATH_BRACKETED_KEY_SUPPORTED: boolean;
|
|
467
|
+
static SUPPORTS_CREATE_TABLE_LIKE: boolean;
|
|
468
|
+
static SUPPORTS_TABLE_ALIAS_COLUMNS: boolean;
|
|
469
|
+
static SUPPORTS_TO_NUMBER: boolean;
|
|
470
|
+
static SUPPORTS_WINDOW_EXCLUDE: boolean;
|
|
471
|
+
static EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE: boolean;
|
|
472
|
+
static SUPPORTS_MEDIAN: boolean;
|
|
473
|
+
static JSON_KEY_VALUE_PAIR_SEP: string;
|
|
474
|
+
static PARSE_JSON_NAME: undefined;
|
|
475
|
+
static get SUPPORTED_JSON_PATH_PARTS(): Set<typeof Expression>;
|
|
476
|
+
static get TYPE_MAPPING(): Map<DataTypeExprKind | string, string>;
|
|
477
|
+
static get TOKEN_MAPPING(): Record<TokenType, string>;
|
|
478
|
+
static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: any) => string>;
|
|
479
|
+
static get PROPERTIES_LOCATION(): Map<typeof Expression, PropertiesLocation>;
|
|
480
|
+
static LIMIT_FETCH: string;
|
|
481
|
+
jsonExtractSql(expression: JsonExtractExpr): string;
|
|
482
|
+
dateAddSql(expression: DateAddExpr): string;
|
|
483
|
+
castSql(expression: CastExpr, options?: {
|
|
484
|
+
safePrefix?: string;
|
|
485
|
+
}): string;
|
|
486
|
+
truncSql(expression: TruncExpr): string;
|
|
487
|
+
generateSeriesSql(expression: GenerateSeriesExpr): string;
|
|
488
|
+
dateDiffSql(expression: DateDiffExpr): string;
|
|
489
|
+
groupConcatSql(expression: GroupConcatExpr): string;
|
|
490
|
+
leastSql(expression: LeastExpr): string;
|
|
491
|
+
transactionSql(expression: TransactionExpr): string;
|
|
492
|
+
isAsciiSql(expression: IsAsciiExpr): string;
|
|
493
|
+
currentSchemaSql(_expression: CurrentSchemaExpr): string;
|
|
494
|
+
ignoreNullsSql(expression: IgnoreNullsExpr): string;
|
|
495
|
+
respectNullsSql(expression: RespectNullsExpr): string;
|
|
496
|
+
windowSpecSql(expression: WindowSpecExpr): string;
|
|
497
|
+
}
|
|
498
|
+
declare class SQLite extends Dialect {
|
|
499
|
+
static DIALECT_NAME: Dialects;
|
|
500
|
+
static get NORMALIZATION_STRATEGY(): NormalizationStrategy;
|
|
501
|
+
static SUPPORTS_SEMI_ANTI_JOIN: boolean;
|
|
502
|
+
static TYPED_DIVISION: boolean;
|
|
503
|
+
static SAFE_DIVISION: boolean;
|
|
504
|
+
static SAFE_TO_ELIMINATE_DOUBLE_NEGATION: boolean;
|
|
505
|
+
static Tokenizer: typeof SQLiteTokenizer;
|
|
506
|
+
static Parser: typeof SQLiteParser;
|
|
507
|
+
static Generator: typeof SQLiteGenerator;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export { SQLite };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$c as tt,$g as Tt,Ap as Mt,Ck as Nt,Ep as Ut,Fb as $,Hl as F,Ie as at,Ja as D,Kc as M,Kd as rt,Kf as g,Kg as ot,Kl as It,Lg as ct,Ma as G,Na as V,Ne as Et,Pc as Z,Po as O,Rj as H,Sl as K,So as Ot,To as _t,Uc as z,Um as Rt,Vb as X,Vc as U,Wb as W,Wc as Q,Wd as y,Xq as m,Ya as L,Yb as v,Yg as q,Za as C,_i as lt,a as R,aq as yt,b as S,bh as pt,bn as St,bp as mt,c as x,d as a,db as P,dq as qt,fh as w,fn as xt,ho as gt,ie as nt,je as et,ji as ut,ke as it,kp as _,lp as h,lq as wt,nb as b,nc as j,od as st,op as B,pp as A,qn as ht,r as E,rn as Ct,sp as k,ta as Y,tl as ft,vp as dt,wj as At,yp as Dt,za as l,zp as Pt}from"../chunk-KCNOE4DZ.js";function rs(e){return e.length===1&&e.push(new w({})),e.length===2?new F({this:new K({this:e[1]}),format:e[0]}):new g({this:"STRFTIME",expressions:e})}function ns(e){let p=e.args.this;if(e instanceof D&&p instanceof X){let t={},s;for(let r of p.args.expressions||[])r instanceof C?t[r.name]=r:r instanceof b&&(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",[]),i.args.constraints?.push(new P({kind:new U})),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 U){i=void 0;break}d.args.kind instanceof M&&(i=d)}i&&r.setArgKey("constraints",(r.args.constraints||[]).filter(T=>T!==i))}}return e}function es(e){if(!(e instanceof C))return e;let p=e.find(Z);if(p){p.parent.pop();let t=e.find(z);t&&t.parent.pop(),e.args.constraints||e.setArgKey("constraints",[]),e.args.constraints?.push(new P({kind:new M}))}return e}var Ht,Ft,Kt,Bt,kt,I,u=class extends(kt=m,Bt=[E],Kt=[E],Ft=[E],Ht=[E],kt){static get IDENTIFIERS(){return['"',["[","]"],"`"]}static get HEX_STRINGS(){return[["x'","'"],["X'","'"],["0x",""],["0X",""]]}static get ORIGINAL_KEYWORDS(){let t={...m.KEYWORDS,ATTACH:"attach",DETACH:"detach","INDEXED BY":"indexedBy",MATCH:"match"};return delete t["/*+"],t}static get COMMANDS(){return new Set([...Array.from(m.COMMANDS),"replace"])}};I=R(kt),a(I,10,"IDENTIFIERS",Bt,u),a(I,10,"HEX_STRINGS",Kt,u),a(I,10,"ORIGINAL_KEYWORDS",Ft,u),a(I,10,"COMMANDS",Ht,u),S(I,u),x(I,3,u),u.NESTED_COMMENTS=!1;var Jt,Yt,Gt,Vt,Lt,bt,$t,N,o=class extends($t=l,bt=[E],Lt=[E],Vt=[E],Gt=[E],Yt=[E],Jt=[E],$t){static get ID_VAR_TOKENS(){return new Set([...l.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let t={...l.NO_PAREN_FUNCTIONS};return delete t.localtime,delete t.localtimestamp,t}static get FUNCTIONS(){return{...l.FUNCTIONS,EDITDIST3:t=>H.fromArgList(t),STRFTIME:rs,DATETIME:t=>new g({this:"DATETIME",expressions:t}),TIME:t=>new g({this:"TIME",expressions:t}),SQLITE_VERSION:t=>q.fromArgList(t)}}static get STATEMENT_PARSERS(){return{...l.STATEMENT_PARSERS,attach:function(){return this.parseAttachDetach()},detach:function(){return this.parseAttachDetach({isAttach:!1})}}}static get RANGE_PARSERS(){return{...l.RANGE_PARSERS,match:Y(Et)}}parseUnique(){return this._constructor.CONSTRAINT_PARSERS[this.curr?.text.toUpperCase()??""]?this.expression(Q):super.parseUnique()}parseAttachDetach(t={}){let{isAttach:s=!0}=t;this.match("database");let r=this.parseExpression();return s?this.expression(G,{this:r}):this.expression(V,{this:r})}static get TABLE_ALIAS_TOKENS(){return new Set([...l.TABLE_ALIAS_TOKENS,"straightJoin"])}};N=R($t),a(N,10,"ID_VAR_TOKENS",bt,o),a(N,10,"NO_PAREN_FUNCTIONS",Lt,o),a(N,10,"FUNCTIONS",Vt,o),a(N,10,"STATEMENT_PARSERS",Gt,o),a(N,10,"RANGE_PARSERS",Yt,o),a(N,10,"TABLE_ALIAS_TOKENS",Jt,o),S(N,o),x(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=h,zt=[E],Zt=[E],jt=[E],vt=[E],Wt=[E],Xt=[E],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([nt,et,it])}static get TYPE_MAPPING(){let t=new Map([...h.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([...h.TRANSFORMS.entries(),[Rt,wt],[ot,A("CHAR")],[ct,qt],[xt,yt],[D,O([ns])],[Tt,()=>"CURRENT_DATE"],[pt,()=>"CURRENT_TIME"],[w,()=>"CURRENT_TIMESTAMP"],[q,()=>"SQLITE_VERSION()"],[C,O([es])],[ut,function(s){return this.sql(s,"this")}],[lt,A("IIF")],[at,dt],[At,function(s){return k.call(this,s)}],[H,function(s){return _.call(this,s,"insCost","delCost","subCost","maxDist"),A("EDITDIST3").call(this,s)}],[ht,A("MAX")],[Ct,A("MIN")],[v,Pt],[Nt,A("RANDOM")],[y,O([Ot,_t,mt])],[ft,function(s){return Ut.call(this,s,{funcName:"INSTR"})}],[W,Dt],[It,function(s){return this.sql(s,"this")}],[F,function(s){return this.func("STRFTIME",[s.args.format,s.args.this])}],[St,Mt],[K,function(s){return this.sql(s,"this")}]])}static get PROPERTIES_LOCATION(){let t=new Map;for(let s of h.PROPERTIES_LOCATION.keys())t.set(s,"unsupported");return t.set(st,"postSchema"),t.set(rt,"postCreate"),t}jsonExtractSql(t){return t.args.expressions&&0<t.args.expressions.length?this.functionFallbackSql(t):k.call(this,t)}dateAddSql(t){let s=t.args.expression,r=s instanceof tt&&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 _.call(this,t,"decimals"),this.func("TRUNC",[t.args.this])}generateSeriesSql(t){let r=t.parent?.args.alias;if(r instanceof L&&r.args.columns?.length){let i=r.args.columns[0];return r.setArgKey("columns",void 0),this.sql(new y({expressions:[gt("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(j),i="";r&&(s=r.args.expressions?.[0],i="DISTINCT "),t.args.this instanceof $&&(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?A("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 _.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=R(Qt),a(f,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",zt,n),a(f,10,"SUPPORTED_JSON_PATH_PARTS",Zt,n),a(f,10,"TYPE_MAPPING",jt,n),a(f,10,"TOKEN_MAPPING",vt,n),a(f,10,"ORIGINAL_TRANSFORMS",Wt,n),a(f,10,"PROPERTIES_LOCATION",Xt,n),S(f,n),x(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=class extends(ss=B,ts=[E],ss){static get NORMALIZATION_STRATEGY(){return"caseInsensitive"}};J=R(ss),a(J,10,"NORMALIZATION_STRATEGY",ts,c),S(J,c),x(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;B.register("sqlite",c);export{c as SQLite};
|
|
2
|
+
//# sourceMappingURL=sqlite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/dialects/sqlite.ts"],"sourcesContent":["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"],"mappings":"woBAuGA,SAASA,GAAeC,EAAmD,CAKzE,OAJIA,EAAK,SAAW,GAClBA,EAAK,KAAK,IAAIC,EAAqB,CAAC,CAAC,CAAC,EAGpCD,EAAK,SAAW,EACX,IAAIE,EAAc,CACvB,KAAM,IAAIC,EAAsB,CAC9B,KAAMH,EAAK,CAAC,CACd,CAAC,EACD,OAAQ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E,SACF,EACA,OAEE,SACF,EACA,UAEE,SACF,EACA,SAEE,MACF,EACA,UAEE,MACF,EACA,WAEE,MACF,EACA,QAEE,MACF,EACA,SAEE,MACF,EACA,WAEE,MACF,EACA,YAEE,MACF,EACA,UAEE,MACF,EACA,aAEE,MACF,CACF,CAAC,EAED,OAAAM,EAAQ,aAA4B,EAE7BA,CACT,CAGA,WAAW,eAAiB,CAC1B,MAAO,CACJ,cAA2B,eAC9B,CACF,CAIA,WAAW,qBAAoF,CA0I7F,OAxImB,IAAI,IAA4D,CACjF,GAAGN,EAAU,WAAW,QAAQ,EAChC,CACEO,GACAC,EACF,EACA,CACEC,GACAC,EAAW,MAAM,CACnB,EACA,CACEC,GACAC,EACF,EACA,CACEC,GACAC,EACF,EACA,CACE3E,EACA4E,EAAW,CACT/E,EACF,CAAC,CACH,EACA,CACEgF,GACA,IAAM,cACR,EACA,CACEC,GACA,IAAM,cACR,EACA,CACErF,EACA,IAAM,mBACR,EACA,CACEoD,EACA,IAAM,kBACR,EACA,CACExC,EACAuE,EAAW,CACT5D,EACF,CAAC,CACH,EACA,CACE+D,GACA,SAA2B3E,EAAsB,CAC/C,OAAO,KAAK,IAAIA,EAAG,MAAM,CAC3B,CACF,EACA,CACE4E,GACAT,EAAW,KAAK,CAClB,EACA,CACEU,GACAC,EACF,EACA,CACEC,GACA,SAA2B/E,EAA0B,CACnD,OAAOgF,EAAoB,KAAK,KAAMhF,CAAC,CACzC,CACF,EACA,CACEwC,EACA,SAA2BxC,EAAG,CAC5B,OAAAiF,EAAgB,KAAK,KAAMjF,EAAG,UAAW,UAAW,UAAW,SAAS,EACjEmE,EAAW,WAAW,EAAE,KAAK,KAAMnE,CAAC,CAC7C,CACF,EACA,CACEkF,GACAf,EAAW,KAAK,CAClB,EACA,CACEgB,GACAhB,EAAW,KAAK,CAClB,EACA,CACEiB,EACAC,EACF,EACA,CACEC,GACAnB,EAAW,QAAQ,CACrB,EACA,CACEoB,EACAf,EAAW,CACTgB,GACAC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ADX8B,GAhHII,GAyHJ5B,EAAAN,EAAA,GAAW,sBAFX6B,GAvHIK,GAuQJ5B,EAAAN,EAAA,GAAW,sBADX4B,GAtQIM,GAAN3B,EAAAP,EAAMkC,GAAN1B,EAAAR,EAAA,EAAMkC,KAcG,qBAAuB,GAd1BA,EAgBY,aAAyB,CACzC,EAjBIA,EAmBG,cAAgB,GAnBnBA,EAqBG,iBAAmB,GArBtBA,EAsBG,WAAa,GAtBhBA,EAuBG,YAAc,GAvBjBA,EAwBG,YAAc,GAxBjBA,EAyBG,eAAiB,GAzBpBA,EA0BG,kCAAoC,GA1BvCA,EA2BG,2BAA6B,GA3BhCA,EA4BG,6BAA+B,GA5BlCA,EA6BG,mBAAqB,GA7BxBA,EA8BG,wBAA0B,GA9B7BA,EA+BG,oCAAsC,GA/BzCA,EAgCG,gBAAkB,GAhCrBA,EAiCG,wBAA0B,IAjC7BA,EAkCG,gBAAkB,OAlCrBA,EAsRG,YAAc,QAhpBvB,IAAAgE,GAAAnG,GAAAC,EA4yBamG,EAAN,cAAqBpG,GAAAqG,EAG1BF,GAAA,CAAC/F,GAHyBJ,GAAQ,CAIlC,WAAW,wBAA0B,CACnC,uBACF,CAUF,EAhBOC,EAAAK,EAAAN,IAILO,EAAAN,EAAA,GAAW,yBADXkG,GAHWC,GAAN5F,EAAAP,EAAMmG,GAAN3F,EAAAR,EAAA,EAAMmG,KACJ,aAAe,SADXA,EAQJ,wBAA0B,GARtBA,EASJ,eAAiB,GATbA,EAUJ,cAAgB,GAVZA,EAWJ,kCAAoC,GAXhCA,EAaJ,UAAYlG,EAbRkG,EAcJ,OAASpF,EAdLoF,EAeJ,UAAYjE,EAGrBkE,EAAQ,kBAA0BD,CAAM","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","MatchExpr","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","distinct","DistinctExpr","distinctSql","OrderExpr","separator","_expression","_NORMALIZATION_STRATEGY_dec","SQLite","Dialect"]}
|
|
@@ -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 _chunkR7C3ZHVKcjs = require('../chunk-R7C3ZHVK.cjs');var _chunk2Z3O2CFMcjs = require('../chunk-2Z3O2CFM.cjs');function ve(c){let l=c.getArgKey("where");if(l instanceof _chunk2Z3O2CFMcjs.Ca)for(let e of l.findAll(_chunk2Z3O2CFMcjs.Xe)){let t=e.args.low,r=e.args.high;e.replace(new (0, _chunk2Z3O2CFMcjs.kn)({this:new (0, _chunk2Z3O2CFMcjs.He)({this:_optionalChain([e, 'access', _2 => _2.args, 'access', _3 => _3.this, 'optionalAccess', _4 => _4.copy, 'call', _5 => _5()]),expression:t}),expression:new (0, _chunk2Z3O2CFMcjs.Oe)({this:_optionalChain([e, 'access', _6 => _6.args, 'access', _7 => _7.this, 'optionalAccess', _8 => _8.copy, 'call', _9 => _9()]),expression:r})}))}return c}function Ye(c){let l=c.args.this,e=c.args.expression,t=this.func("ST_X",[l]),r=this.func("ST_Y",[l]),i=this.func("ST_X",[e]),o=this.func("ST_Y",[e]);return this.func("ST_Distance_Sphere",[t,r,i,o])}var Re,Se,q,A=class extends(Se=_chunkR7C3ZHVKcjs.j.Tokenizer,Re=[_chunk2Z3O2CFMcjs.r],Se){static get ORIGINAL_KEYWORDS(){return{..._chunkR7C3ZHVKcjs.j.Tokenizer.ORIGINAL_KEYWORDS,LARGEINT:"int128"}}};q=_chunk2Z3O2CFMcjs.a.call(void 0, Se),_chunk2Z3O2CFMcjs.d.call(void 0, q,10,"ORIGINAL_KEYWORDS",Re,A),_chunk2Z3O2CFMcjs.b.call(void 0, q,A),_chunk2Z3O2CFMcjs.c.call(void 0, q,3,A);var _e,Ie,ye,Oe,Ne,De,x,E=class extends(De=_chunkR7C3ZHVKcjs.j.Parser,Ne=[_chunk2Z3O2CFMcjs.r],Oe=[_chunk2Z3O2CFMcjs.r],ye=[_chunk2Z3O2CFMcjs.r],Ie=[_chunk2Z3O2CFMcjs.r],_e=[_chunk2Z3O2CFMcjs.r],De){static get ID_VAR_TOKENS(){return new Set([..._chunk2Z3O2CFMcjs.za.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let e={..._chunkR7C3ZHVKcjs.j.Parser.NO_PAREN_FUNCTIONS};return delete e.localtime,delete e.localtimestamp,e}static get FUNCTIONS(){return{..._chunkR7C3ZHVKcjs.j.Parser.FUNCTIONS,DATE_TRUNC:_chunk2Z3O2CFMcjs.jq,DATEDIFF:e=>new (0, _chunk2Z3O2CFMcjs.xh)({this:_chunk2Z3O2CFMcjs.ca.call(void 0, e,0),expression:_chunk2Z3O2CFMcjs.ca.call(void 0, e,1),unit:new (0, _chunk2Z3O2CFMcjs.$c)({this:"DAY",isString:!0})}),DATE_DIFF:e=>new (0, _chunk2Z3O2CFMcjs.xh)({this:_chunk2Z3O2CFMcjs.ca.call(void 0, e,1),expression:_chunk2Z3O2CFMcjs.ca.call(void 0, e,2),unit:_chunk2Z3O2CFMcjs.ca.call(void 0, e,0)}),ARRAY_FLATTEN:e=>_chunk2Z3O2CFMcjs.Gf.fromArgList(e),REGEXP:e=>_chunk2Z3O2CFMcjs.Lk.fromArgList(e)}}static get PROPERTY_PARSERS(){return{..._chunkR7C3ZHVKcjs.j.Parser.PROPERTY_PARSERS,PROPERTIES:function(){return this.parseWrappedProperties()},UNIQUE:function(){return this.parseCompositeKeyProperty(_chunk2Z3O2CFMcjs.Bd)},ROLLUP:function(){return this.parseRollupProperty()},REFRESH:function(){return this.parseRefreshProperty()}}}parseRollupProperty(){let e=()=>this.expression(_chunk2Z3O2CFMcjs.Jb,{this:this.parseIdVar(),expressions:this.parseWrappedIdVars(),fromIndex:this.matchTextSeq(["FROM"])?this.parseIdVar():void 0,properties:this.matchTextSeq(["PROPERTIES"])?this.expression(_chunk2Z3O2CFMcjs.Td,{expressions:this.parseWrappedProperties()}):void 0});return this.expression(_chunk2Z3O2CFMcjs.yd,{expressions:this.parseWrappedCsv(e)})}parseCreate(){let e=super.parseCreate();if(e instanceof _chunk2Z3O2CFMcjs.Ja&&e.args.this instanceof _chunk2Z3O2CFMcjs.Vb){let t=e.args.properties;if(t){let r=t.find(_chunk2Z3O2CFMcjs.nb);r&&e.args.this.append("expressions",r.pop())}}return e}parseUnnest(e={}){let t=super.parseUnnest(e);if(t){let r=t.args.alias;r?_optionalChain([_chunk2Z3O2CFMcjs.p.call(void 0, r,_chunk2Z3O2CFMcjs.Ya), 'optionalAccess', _10 => _10.args, 'access', _11 => _11.columns])||r.setArgKey("columns",[_chunk2Z3O2CFMcjs.eo.call(void 0, "unnest")]):(r=new (0, _chunk2Z3O2CFMcjs.Ya)({this:_chunk2Z3O2CFMcjs.eo.call(void 0, "unnest"),columns:[_chunk2Z3O2CFMcjs.eo.call(void 0, "unnest")]}),t.setArgKey("alias",r))}return t}parsePartitionedBy(){return this.expression(_chunk2Z3O2CFMcjs.ud,{this:new (0, _chunk2Z3O2CFMcjs.Vb)({expressions:this.parseWrappedCsv(this.parseAssignment.bind(this),{optional:!0})})})}parsePartitionProperty(){let e=super.parsePartitionProperty();if(!e)return _nullishCoalesce(this.parsePartitionedBy(), () => (void 0));if(e instanceof _chunk2Z3O2CFMcjs.Hb)return e;this.matchLParen();let t;return this.matchTextSeq(["START"],{advance:!1})&&(t=this.parseCsv(this.parsePartitioningGranularityDynamic.bind(this))),this.matchRParen(),this.expression(_chunk2Z3O2CFMcjs.xd,{partitionExpressions:e,createExpressions:t})}parsePartitioningGranularityDynamic(){this.matchTextSeq(["START"]);let e=this.parseWrapped(this.parseString.bind(this));this.matchTextSeq(["END"]);let t=this.parseWrapped(this.parseString.bind(this));this.matchTextSeq(["EVERY"]);let r=this.parseWrapped(()=>this.parseInterval()||this.parseNumber());return this.expression(_chunk2Z3O2CFMcjs.Ib,{start:e,end:t,every:r})}parseRefreshProperty(){let e=this.matchTexts(["DEFERRED","IMMEDIATE"])?_nullishCoalesce(_optionalChain([this, 'access', _12 => _12.prev, 'optionalAccess', _13 => _13.text, 'optionalAccess', _14 => _14.toUpperCase, 'call', _15 => _15()]), () => (void 0)):void 0,t=this.matchTexts(["ASYNC","MANUAL"])?_nullishCoalesce(_optionalChain([this, 'access', _16 => _16.prev, 'optionalAccess', _17 => _17.text, 'optionalAccess', _18 => _18.toUpperCase, 'call', _19 => _19()]), () => (void 0)):void 0,r=this.matchTextSeq(["START"])?this.parseWrapped(this.parseString.bind(this)):void 0,i,o;return this.matchTextSeq(["EVERY"])&&(this.matchLParen(),this.matchTextSeq(["INTERVAL"]),i=_nullishCoalesce(this.parseNumber(), () => (void 0)),o=_nullishCoalesce(this.parseVar({anyToken:!0}), () => (void 0)),this.matchRParen()),this.expression(_chunk2Z3O2CFMcjs.Ad,{method:e,kind:t,starts:r,every:i,unit:o})}static get TABLE_ALIAS_TOKENS(){return new Set([..._chunkR7C3ZHVKcjs.j.Parser.TABLE_ALIAS_TOKENS,"straightJoin"])}};x=_chunk2Z3O2CFMcjs.a.call(void 0, De),_chunk2Z3O2CFMcjs.d.call(void 0, x,10,"ID_VAR_TOKENS",Ne,E),_chunk2Z3O2CFMcjs.d.call(void 0, x,10,"NO_PAREN_FUNCTIONS",Oe,E),_chunk2Z3O2CFMcjs.d.call(void 0, x,10,"FUNCTIONS",ye,E),_chunk2Z3O2CFMcjs.d.call(void 0, x,10,"PROPERTY_PARSERS",Ie,E),_chunk2Z3O2CFMcjs.d.call(void 0, x,10,"TABLE_ALIAS_TOKENS",_e,E),_chunk2Z3O2CFMcjs.b.call(void 0, x,E),_chunk2Z3O2CFMcjs.c.call(void 0, x,3,E);var Ce,Me,Le,be,we,Ue,Fe,h,s=class extends(Fe=_chunkR7C3ZHVKcjs.j.Generator,Ue=[_chunk2Z3O2CFMcjs.r],we=[_chunk2Z3O2CFMcjs.r],be=[_chunk2Z3O2CFMcjs.r],Le=[_chunk2Z3O2CFMcjs.r],Me=[_chunk2Z3O2CFMcjs.r],Ce=[_chunk2Z3O2CFMcjs.r],Fe){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let e=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(t=>e.delete(t)),e}static get CAST_MAPPING(){return{}}static get TYPE_MAPPING(){let e=new Map(_chunkR7C3ZHVKcjs.j.Generator.TYPE_MAPPING);return e.set("int128","LARGEINT"),e.set("text","STRING"),e.set("timestamp","DATETIME"),e.set("timestamptz","DATETIME"),e}static get PROPERTIES_LOCATION(){let e=new Map(_chunkR7C3ZHVKcjs.j.Generator.PROPERTIES_LOCATION);return e.set(_chunk2Z3O2CFMcjs.nb,"postSchema"),e.set(_chunk2Z3O2CFMcjs.Bd,"postSchema"),e.set(_chunk2Z3O2CFMcjs.yd,"postSchema"),e.set(_chunk2Z3O2CFMcjs.ud,"postSchema"),e}static get ORIGINAL_TRANSFORMS(){let e=new Map(_chunkR7C3ZHVKcjs.j.Generator.TRANSFORMS);return e.set(_chunk2Z3O2CFMcjs.Mf,_chunk2Z3O2CFMcjs.tp),e.set(_chunk2Z3O2CFMcjs.Nm,_chunk2Z3O2CFMcjs.pp.call(void 0, "ARRAY_AGG")),e.set(_chunk2Z3O2CFMcjs.ng,_chunk2Z3O2CFMcjs.pp.call(void 0, "ARRAY_FILTER")),e.set(_chunk2Z3O2CFMcjs.qg,_chunk2Z3O2CFMcjs.pp.call(void 0, "ARRAY_JOIN")),e.set(_chunk2Z3O2CFMcjs.Lm,_chunk2Z3O2CFMcjs.qp),e.set(_chunk2Z3O2CFMcjs.Yg,()=>"CURRENT_VERSION()"),e.set(_chunk2Z3O2CFMcjs.xh,function(t){return this.func("DATE_DIFF",[_chunk2Z3O2CFMcjs.uq.call(void 0, t),t.args.this,t.args.expression])}),e.set(_chunk2Z3O2CFMcjs.fb,_chunk2Z3O2CFMcjs.Po.call(void 0, [ve])),e.set(_chunk2Z3O2CFMcjs.Gf,_chunk2Z3O2CFMcjs.pp.call(void 0, "ARRAY_FLATTEN")),e.set(_chunk2Z3O2CFMcjs.wj,_chunk2Z3O2CFMcjs.sp),e.set(_chunk2Z3O2CFMcjs.uj,_chunk2Z3O2CFMcjs.sp),e.set(_chunk2Z3O2CFMcjs.Hb,_chunk2Z3O2CFMcjs.Dp),e.set(_chunk2Z3O2CFMcjs.Lk,_chunk2Z3O2CFMcjs.pp.call(void 0, "REGEXP")),e.set(_chunk2Z3O2CFMcjs.Dd,function(t){return this.nakedProperty(t)}),e.set(_chunk2Z3O2CFMcjs.tg,Ye),e.set(_chunk2Z3O2CFMcjs.yl,function(t){return this.func("UNIX_TIMESTAMP",[t.args.this,this.formatTime(t)])}),e.set(_chunk2Z3O2CFMcjs.bi,function(t){return this.func("DATE_TRUNC",[_chunk2Z3O2CFMcjs.uq.call(void 0, t),t.args.this])}),e.set(_chunk2Z3O2CFMcjs.Jl,_chunk2Z3O2CFMcjs.pp.call(void 0, "TO_DATE")),e.set(_chunk2Z3O2CFMcjs.Yl,function(t){return this.func("FROM_UNIXTIME",[t.args.this,this.formatTime(t)])}),e.set(_chunk2Z3O2CFMcjs.Zl,_chunk2Z3O2CFMcjs.pp.call(void 0, "FROM_UNIXTIME")),e.delete(_chunk2Z3O2CFMcjs.yh),e}static get RESERVED_KEYWORDS(){return new Set(["add","all","alter","analyze","and","array","as","asc","between","bigint","bitmap","both","by","case","char","character","check","collate","column","compaction","convert","create","cross","cube","current_date","current_role","current_time","current_timestamp","current_user","database","databases","decimal","decimalv2","decimal32","decimal64","decimal128","default","deferred","delete","dense_rank","desc","describe","distinct","double","drop","dual","else","except","exists","explain","false","first_value","float","for","force","from","full","function","grant","group","grouping","grouping_id","groups","having","hll","host","if","ignore","immediate","in","index","infile","inner","insert","int","integer","intersect","into","is","join","json","key","keys","kill","lag","largeint","last_value","lateral","lead","left","like","limit","load","localtime","localtimestamp","maxvalue","minus","mod","not","ntile","undefined","on","or","order","outer","outfile","over","partition","percentile","primary","procedure","qualify","range","rank","read","regexp","release","rename","replace","revoke","right","rlike","row","row_number","rows","schema","schemas","select","set","set_var","show","smallint","system","table","terminated","text","then","tinyint","to","true","union","unique","unsigned","update","use","using","values","varchar","when","where","with"])}createSql(e){let t=e.args.this;if(t instanceof _chunk2Z3O2CFMcjs.Vb){let r=t.find(_chunk2Z3O2CFMcjs.nb);if(r){let i=e.args.properties;i||(i=new (0, _chunk2Z3O2CFMcjs.Td)({expressions:[]}),e.setArgKey("properties",i));let o=i.find(_chunk2Z3O2CFMcjs.hd),d=_optionalChain([o, 'optionalAccess', _20 => _20.index])!==void 0?o.index:-1;i.setArgKey("expressions",[r.pop()],d+1,{overwrite:!1})}}return super.createSql(e)}partitionedByPropertySql(e){let t=e.args.this;if(t instanceof _chunk2Z3O2CFMcjs.Vb){let r=e.findAncestor(_chunk2Z3O2CFMcjs.Ja),i=this.expressions(t,{flat:!0}),o=_optionalChain([t, 'access', _21 => _21.args, 'access', _22 => _22.expressions, 'optionalAccess', _23 => _23.every, 'call', _24 => _24(d=>d instanceof _chunk2Z3O2CFMcjs.Ic||d instanceof _chunk2Z3O2CFMcjs.rb)]);return(r&&r.args.kind==="view"||o)&&(i=`(${i})`),`PARTITION BY ${i}`}return`PARTITION BY ${this.sql(t)}`}clusterSql(e){let t=this.expressions(e,{flat:!0});return t?`ORDER BY (${t})`:""}refreshTriggerPropertySql(e){let t=this.sql(e,"method");t=t?` ${t}`:"";let r=this.sql(e,"kind");r=r?` ${r}`:"";let i=this.sql(e,"starts");i=i?` START (${i})`:"";let o=this.sql(e,"every"),d=this.sql(e,"unit"),qe=o&&d?` EVERY (INTERVAL ${o} ${d})`:"";return`REFRESH${t}${r}${i}${qe}`}};h=_chunk2Z3O2CFMcjs.a.call(void 0, Fe),_chunk2Z3O2CFMcjs.d.call(void 0, h,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",Ue,s),_chunk2Z3O2CFMcjs.d.call(void 0, h,10,"CAST_MAPPING",we,s),_chunk2Z3O2CFMcjs.d.call(void 0, h,10,"TYPE_MAPPING",be,s),_chunk2Z3O2CFMcjs.d.call(void 0, h,10,"PROPERTIES_LOCATION",Le,s),_chunk2Z3O2CFMcjs.d.call(void 0, h,10,"ORIGINAL_TRANSFORMS",Me,s),_chunk2Z3O2CFMcjs.d.call(void 0, h,10,"RESERVED_KEYWORDS",Ce,s),_chunk2Z3O2CFMcjs.b.call(void 0, h,s),_chunk2Z3O2CFMcjs.c.call(void 0, h,3,s),s.SUPPORTS_DECODE_CASE=!1,s.TRY_SUPPORTED=!1,s.SUPPORTS_UESCAPE=!1,s.EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE=!1,s.JSON_TYPE_REQUIRED_FOR_EXTRACTION=!1,s.VARCHAR_REQUIRES_SIZE=!1,s.PARSE_JSON_NAME="PARSE_JSON",s.WITH_PROPERTIES_PREFIX="PROPERTIES",s.UPDATE_STATEMENT_SUPPORTS_FROM=!0,s.INSERT_OVERWRITE=" OVERWRITE",s.IS_BOOL_ALLOWED=!1,s.RENAME_TABLE_WITH_DB=!1;var u=class extends _chunkR7C3ZHVKcjs.j{};u.DIALECT_NAME="starrocks",u.STRICT_JSON_PATH_SYNTAX=!1,u.INDEX_OFFSET=1,u.Tokenizer=A,u.Parser=E,u.Generator=s;_chunk2Z3O2CFMcjs.op.register("starrocks",u);exports.StarRocks = u; exports.eliminateBetweenInDelete = ve; exports.stDistanceSphere = Ye;
|
|
2
|
+
//# sourceMappingURL=starrocks.cjs.map
|