@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,518 @@
|
|
|
1
|
+
import { d as Dialects, l as TokenType, E as Expression, c as Dialect, i as Parser, dY as RollupPropertyExpr, b8 as CreateExpr, ag as UnnestExpr, a_ as PartitionedByPropertyExpr, bj as PartitionByRangePropertyDynamicExpr, bl as RefreshTriggerPropertyExpr, G as Generator, $ as DataTypeExprKind, aj as PropertiesLocation, dZ as StDistanceExpr } from '../tokens-VcMD09XM.js';
|
|
2
|
+
import { MySQL } from './mysql.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* StarRocks doesn't support BETWEEN in DELETE statements.
|
|
6
|
+
* This transforms BETWEEN expressions into explicit GTE and LTE comparisons.
|
|
7
|
+
* Reference: https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/DELETE/#parameters
|
|
8
|
+
*/
|
|
9
|
+
declare function eliminateBetweenInDelete(expression: Expression): Expression;
|
|
10
|
+
/**
|
|
11
|
+
* StarRocks ST_Distance_Sphere expects individual coordinates rather than point objects.
|
|
12
|
+
* Reference: https://docs.starrocks.io/docs/sql-reference/sql-functions/spatial-functions/st_distance_sphere/
|
|
13
|
+
*/
|
|
14
|
+
declare function stDistanceSphere(this: Generator, expression: StDistanceExpr): string;
|
|
15
|
+
declare class StarRocksTokenizer extends MySQL.Tokenizer {
|
|
16
|
+
static get ORIGINAL_KEYWORDS(): Record<string, TokenType>;
|
|
17
|
+
}
|
|
18
|
+
declare class StarRocksParser extends MySQL.Parser {
|
|
19
|
+
static get ID_VAR_TOKENS(): Set<TokenType>;
|
|
20
|
+
static get NO_PAREN_FUNCTIONS(): {
|
|
21
|
+
lParen?: typeof Expression | undefined;
|
|
22
|
+
rParen?: typeof Expression | undefined;
|
|
23
|
+
lBracket?: typeof Expression | undefined;
|
|
24
|
+
rBracket?: typeof Expression | undefined;
|
|
25
|
+
lBrace?: typeof Expression | undefined;
|
|
26
|
+
rBrace?: typeof Expression | undefined;
|
|
27
|
+
comma?: typeof Expression | undefined;
|
|
28
|
+
dot?: typeof Expression | undefined;
|
|
29
|
+
dash?: typeof Expression | undefined;
|
|
30
|
+
plus?: typeof Expression | undefined;
|
|
31
|
+
colon?: typeof Expression | undefined;
|
|
32
|
+
dotcolon?: typeof Expression | undefined;
|
|
33
|
+
dcolon?: typeof Expression | undefined;
|
|
34
|
+
dcolondollar?: typeof Expression | undefined;
|
|
35
|
+
dcolonpercent?: typeof Expression | undefined;
|
|
36
|
+
dcolonqmark?: typeof Expression | undefined;
|
|
37
|
+
dqmark?: typeof Expression | undefined;
|
|
38
|
+
semicolon?: typeof Expression | undefined;
|
|
39
|
+
star?: typeof Expression | undefined;
|
|
40
|
+
backslash?: typeof Expression | undefined;
|
|
41
|
+
slash?: typeof Expression | undefined;
|
|
42
|
+
lt?: typeof Expression | undefined;
|
|
43
|
+
lte?: typeof Expression | undefined;
|
|
44
|
+
gt?: typeof Expression | undefined;
|
|
45
|
+
gte?: typeof Expression | undefined;
|
|
46
|
+
not?: typeof Expression | undefined;
|
|
47
|
+
eq?: typeof Expression | undefined;
|
|
48
|
+
neq?: typeof Expression | undefined;
|
|
49
|
+
nullsafeEq?: typeof Expression | undefined;
|
|
50
|
+
colonEq?: typeof Expression | undefined;
|
|
51
|
+
colonGt?: typeof Expression | undefined;
|
|
52
|
+
ncolonGt?: typeof Expression | undefined;
|
|
53
|
+
and?: typeof Expression | undefined;
|
|
54
|
+
or?: typeof Expression | undefined;
|
|
55
|
+
amp?: typeof Expression | undefined;
|
|
56
|
+
dpipe?: typeof Expression | undefined;
|
|
57
|
+
pipeGt?: typeof Expression | undefined;
|
|
58
|
+
pipe?: typeof Expression | undefined;
|
|
59
|
+
pipeSlash?: typeof Expression | undefined;
|
|
60
|
+
dpipeSlash?: typeof Expression | undefined;
|
|
61
|
+
caret?: typeof Expression | undefined;
|
|
62
|
+
caretAt?: typeof Expression | undefined;
|
|
63
|
+
tilde?: typeof Expression | undefined;
|
|
64
|
+
arrow?: typeof Expression | undefined;
|
|
65
|
+
darrow?: typeof Expression | undefined;
|
|
66
|
+
farrow?: typeof Expression | undefined;
|
|
67
|
+
hash?: typeof Expression | undefined;
|
|
68
|
+
hashArrow?: typeof Expression | undefined;
|
|
69
|
+
dhashArrow?: typeof Expression | undefined;
|
|
70
|
+
lrArrow?: typeof Expression | undefined;
|
|
71
|
+
dat?: typeof Expression | undefined;
|
|
72
|
+
ltAt?: typeof Expression | undefined;
|
|
73
|
+
atGt?: typeof Expression | undefined;
|
|
74
|
+
dollar?: typeof Expression | undefined;
|
|
75
|
+
parameter?: typeof Expression | undefined;
|
|
76
|
+
session?: typeof Expression | undefined;
|
|
77
|
+
sessionParameter?: typeof Expression | undefined;
|
|
78
|
+
sessionUser?: typeof Expression | undefined;
|
|
79
|
+
damp?: typeof Expression | undefined;
|
|
80
|
+
ampLt?: typeof Expression | undefined;
|
|
81
|
+
ampGt?: typeof Expression | undefined;
|
|
82
|
+
adjacent?: typeof Expression | undefined;
|
|
83
|
+
xor?: typeof Expression | undefined;
|
|
84
|
+
dstar?: typeof Expression | undefined;
|
|
85
|
+
qmarkAmp?: typeof Expression | undefined;
|
|
86
|
+
qmarkPipe?: typeof Expression | undefined;
|
|
87
|
+
hashDash?: typeof Expression | undefined;
|
|
88
|
+
exclamation?: typeof Expression | undefined;
|
|
89
|
+
uriStart?: typeof Expression | undefined;
|
|
90
|
+
blockStart?: typeof Expression | undefined;
|
|
91
|
+
blockEnd?: typeof Expression | undefined;
|
|
92
|
+
space?: typeof Expression | undefined;
|
|
93
|
+
break?: typeof Expression | undefined;
|
|
94
|
+
string?: typeof Expression | undefined;
|
|
95
|
+
number?: typeof Expression | undefined;
|
|
96
|
+
identifier?: typeof Expression | undefined;
|
|
97
|
+
database?: typeof Expression | undefined;
|
|
98
|
+
column?: typeof Expression | undefined;
|
|
99
|
+
columnDef?: typeof Expression | undefined;
|
|
100
|
+
schema?: typeof Expression | undefined;
|
|
101
|
+
table?: typeof Expression | undefined;
|
|
102
|
+
warehouse?: typeof Expression | undefined;
|
|
103
|
+
stage?: typeof Expression | undefined;
|
|
104
|
+
streamlit?: typeof Expression | undefined;
|
|
105
|
+
var?: typeof Expression | undefined;
|
|
106
|
+
bitString?: typeof Expression | undefined;
|
|
107
|
+
hexString?: typeof Expression | undefined;
|
|
108
|
+
byteString?: typeof Expression | undefined;
|
|
109
|
+
nationalString?: typeof Expression | undefined;
|
|
110
|
+
rawString?: typeof Expression | undefined;
|
|
111
|
+
heredocString?: typeof Expression | undefined;
|
|
112
|
+
unicodeString?: typeof Expression | undefined;
|
|
113
|
+
bit?: typeof Expression | undefined;
|
|
114
|
+
boolean?: typeof Expression | undefined;
|
|
115
|
+
tinyint?: typeof Expression | undefined;
|
|
116
|
+
utinyint?: typeof Expression | undefined;
|
|
117
|
+
smallint?: typeof Expression | undefined;
|
|
118
|
+
usmallint?: typeof Expression | undefined;
|
|
119
|
+
mediumint?: typeof Expression | undefined;
|
|
120
|
+
umediumint?: typeof Expression | undefined;
|
|
121
|
+
int?: typeof Expression | undefined;
|
|
122
|
+
uint?: typeof Expression | undefined;
|
|
123
|
+
bigint?: typeof Expression | undefined;
|
|
124
|
+
ubigint?: typeof Expression | undefined;
|
|
125
|
+
bignum?: typeof Expression | undefined;
|
|
126
|
+
int128?: typeof Expression | undefined;
|
|
127
|
+
uint128?: typeof Expression | undefined;
|
|
128
|
+
int256?: typeof Expression | undefined;
|
|
129
|
+
uint256?: typeof Expression | undefined;
|
|
130
|
+
float?: typeof Expression | undefined;
|
|
131
|
+
double?: typeof Expression | undefined;
|
|
132
|
+
udouble?: typeof Expression | undefined;
|
|
133
|
+
decimal?: typeof Expression | undefined;
|
|
134
|
+
decimal32?: typeof Expression | undefined;
|
|
135
|
+
decimal64?: typeof Expression | undefined;
|
|
136
|
+
decimal128?: typeof Expression | undefined;
|
|
137
|
+
decimal256?: typeof Expression | undefined;
|
|
138
|
+
decfloat?: typeof Expression | undefined;
|
|
139
|
+
udecimal?: typeof Expression | undefined;
|
|
140
|
+
bigdecimal?: typeof Expression | undefined;
|
|
141
|
+
char?: typeof Expression | undefined;
|
|
142
|
+
nchar?: typeof Expression | undefined;
|
|
143
|
+
varchar?: typeof Expression | undefined;
|
|
144
|
+
nvarchar?: typeof Expression | undefined;
|
|
145
|
+
bpchar?: typeof Expression | undefined;
|
|
146
|
+
text?: typeof Expression | undefined;
|
|
147
|
+
mediumtext?: typeof Expression | undefined;
|
|
148
|
+
longtext?: typeof Expression | undefined;
|
|
149
|
+
blob?: typeof Expression | undefined;
|
|
150
|
+
mediumblob?: typeof Expression | undefined;
|
|
151
|
+
longblob?: typeof Expression | undefined;
|
|
152
|
+
tinyblob?: typeof Expression | undefined;
|
|
153
|
+
tinytext?: typeof Expression | undefined;
|
|
154
|
+
name?: typeof Expression | undefined;
|
|
155
|
+
binary?: typeof Expression | undefined;
|
|
156
|
+
varbinary?: typeof Expression | undefined;
|
|
157
|
+
json?: typeof Expression | undefined;
|
|
158
|
+
jsonb?: typeof Expression | undefined;
|
|
159
|
+
time?: typeof Expression | undefined;
|
|
160
|
+
timetz?: typeof Expression | undefined;
|
|
161
|
+
timeNs?: typeof Expression | undefined;
|
|
162
|
+
timestamp?: typeof Expression | undefined;
|
|
163
|
+
timestamptz?: typeof Expression | undefined;
|
|
164
|
+
timestampltz?: typeof Expression | undefined;
|
|
165
|
+
timestampntz?: typeof Expression | undefined;
|
|
166
|
+
timestampS?: typeof Expression | undefined;
|
|
167
|
+
timestampMs?: typeof Expression | undefined;
|
|
168
|
+
timestampNs?: typeof Expression | undefined;
|
|
169
|
+
datetime?: typeof Expression | undefined;
|
|
170
|
+
datetime2?: typeof Expression | undefined;
|
|
171
|
+
datetime64?: typeof Expression | undefined;
|
|
172
|
+
smalldatetime?: typeof Expression | undefined;
|
|
173
|
+
date?: typeof Expression | undefined;
|
|
174
|
+
date32?: typeof Expression | undefined;
|
|
175
|
+
int4range?: typeof Expression | undefined;
|
|
176
|
+
int4multirange?: typeof Expression | undefined;
|
|
177
|
+
int8range?: typeof Expression | undefined;
|
|
178
|
+
int8multirange?: typeof Expression | undefined;
|
|
179
|
+
numrange?: typeof Expression | undefined;
|
|
180
|
+
nummultirange?: typeof Expression | undefined;
|
|
181
|
+
tsrange?: typeof Expression | undefined;
|
|
182
|
+
tsmultirange?: typeof Expression | undefined;
|
|
183
|
+
tstzrange?: typeof Expression | undefined;
|
|
184
|
+
tstzmultirange?: typeof Expression | undefined;
|
|
185
|
+
daterange?: typeof Expression | undefined;
|
|
186
|
+
datemultirange?: typeof Expression | undefined;
|
|
187
|
+
uuid?: typeof Expression | undefined;
|
|
188
|
+
geography?: typeof Expression | undefined;
|
|
189
|
+
geographypoint?: typeof Expression | undefined;
|
|
190
|
+
nullable?: typeof Expression | undefined;
|
|
191
|
+
geometry?: typeof Expression | undefined;
|
|
192
|
+
point?: typeof Expression | undefined;
|
|
193
|
+
ring?: typeof Expression | undefined;
|
|
194
|
+
linestring?: typeof Expression | undefined;
|
|
195
|
+
localtime?: typeof Expression | undefined;
|
|
196
|
+
localtimestamp?: typeof Expression | undefined;
|
|
197
|
+
systimestamp?: typeof Expression | undefined;
|
|
198
|
+
multilinestring?: typeof Expression | undefined;
|
|
199
|
+
polygon?: typeof Expression | undefined;
|
|
200
|
+
multipolygon?: typeof Expression | undefined;
|
|
201
|
+
hllsketch?: typeof Expression | undefined;
|
|
202
|
+
hstore?: typeof Expression | undefined;
|
|
203
|
+
super?: typeof Expression | undefined;
|
|
204
|
+
serial?: typeof Expression | undefined;
|
|
205
|
+
smallserial?: typeof Expression | undefined;
|
|
206
|
+
bigserial?: typeof Expression | undefined;
|
|
207
|
+
xml?: typeof Expression | undefined;
|
|
208
|
+
year?: typeof Expression | undefined;
|
|
209
|
+
userdefined?: typeof Expression | undefined;
|
|
210
|
+
money?: typeof Expression | undefined;
|
|
211
|
+
smallmoney?: typeof Expression | undefined;
|
|
212
|
+
rowversion?: typeof Expression | undefined;
|
|
213
|
+
image?: typeof Expression | undefined;
|
|
214
|
+
variant?: typeof Expression | undefined;
|
|
215
|
+
object?: typeof Expression | undefined;
|
|
216
|
+
inet?: typeof Expression | undefined;
|
|
217
|
+
ipaddress?: typeof Expression | undefined;
|
|
218
|
+
ipprefix?: typeof Expression | undefined;
|
|
219
|
+
ipv4?: typeof Expression | undefined;
|
|
220
|
+
ipv6?: typeof Expression | undefined;
|
|
221
|
+
enum?: typeof Expression | undefined;
|
|
222
|
+
enum8?: typeof Expression | undefined;
|
|
223
|
+
enum16?: typeof Expression | undefined;
|
|
224
|
+
fixedstring?: typeof Expression | undefined;
|
|
225
|
+
lowcardinality?: typeof Expression | undefined;
|
|
226
|
+
nested?: typeof Expression | undefined;
|
|
227
|
+
aggregatefunction?: typeof Expression | undefined;
|
|
228
|
+
simpleaggregatefunction?: typeof Expression | undefined;
|
|
229
|
+
tdigest?: typeof Expression | undefined;
|
|
230
|
+
unknown?: typeof Expression | undefined;
|
|
231
|
+
vector?: typeof Expression | undefined;
|
|
232
|
+
dynamic?: typeof Expression | undefined;
|
|
233
|
+
void?: typeof Expression | undefined;
|
|
234
|
+
alias?: typeof Expression | undefined;
|
|
235
|
+
alter?: typeof Expression | undefined;
|
|
236
|
+
all?: typeof Expression | undefined;
|
|
237
|
+
anti?: typeof Expression | undefined;
|
|
238
|
+
any?: typeof Expression | undefined;
|
|
239
|
+
apply?: typeof Expression | undefined;
|
|
240
|
+
array?: typeof Expression | undefined;
|
|
241
|
+
asc?: typeof Expression | undefined;
|
|
242
|
+
asof?: typeof Expression | undefined;
|
|
243
|
+
attach?: typeof Expression | undefined;
|
|
244
|
+
autoIncrement?: typeof Expression | undefined;
|
|
245
|
+
begin?: typeof Expression | undefined;
|
|
246
|
+
between?: typeof Expression | undefined;
|
|
247
|
+
bulkCollectInto?: typeof Expression | undefined;
|
|
248
|
+
cache?: typeof Expression | undefined;
|
|
249
|
+
case?: typeof Expression | undefined;
|
|
250
|
+
characterSet?: typeof Expression | undefined;
|
|
251
|
+
clusterBy?: typeof Expression | undefined;
|
|
252
|
+
collate?: typeof Expression | undefined;
|
|
253
|
+
command?: typeof Expression | undefined;
|
|
254
|
+
comment?: typeof Expression | undefined;
|
|
255
|
+
commit?: typeof Expression | undefined;
|
|
256
|
+
connectBy?: typeof Expression | undefined;
|
|
257
|
+
constraint?: typeof Expression | undefined;
|
|
258
|
+
copy?: typeof Expression | undefined;
|
|
259
|
+
create?: typeof Expression | undefined;
|
|
260
|
+
cross?: typeof Expression | undefined;
|
|
261
|
+
cube?: typeof Expression | undefined;
|
|
262
|
+
currentDate?: typeof Expression | undefined;
|
|
263
|
+
currentDatetime?: typeof Expression | undefined;
|
|
264
|
+
currentSchema?: typeof Expression | undefined;
|
|
265
|
+
currentTime?: typeof Expression | undefined;
|
|
266
|
+
currentTimestamp?: typeof Expression | undefined;
|
|
267
|
+
currentUser?: typeof Expression | undefined;
|
|
268
|
+
currentRole?: typeof Expression | undefined;
|
|
269
|
+
currentCatalog?: typeof Expression | undefined;
|
|
270
|
+
declare?: typeof Expression | undefined;
|
|
271
|
+
default?: typeof Expression | undefined;
|
|
272
|
+
delete?: typeof Expression | undefined;
|
|
273
|
+
desc?: typeof Expression | undefined;
|
|
274
|
+
describe?: typeof Expression | undefined;
|
|
275
|
+
detach?: typeof Expression | undefined;
|
|
276
|
+
dictionary?: typeof Expression | undefined;
|
|
277
|
+
distinct?: typeof Expression | undefined;
|
|
278
|
+
distributeBy?: typeof Expression | undefined;
|
|
279
|
+
div?: typeof Expression | undefined;
|
|
280
|
+
drop?: typeof Expression | undefined;
|
|
281
|
+
else?: typeof Expression | undefined;
|
|
282
|
+
end?: typeof Expression | undefined;
|
|
283
|
+
escape?: typeof Expression | undefined;
|
|
284
|
+
except?: typeof Expression | undefined;
|
|
285
|
+
execute?: typeof Expression | undefined;
|
|
286
|
+
exists?: typeof Expression | undefined;
|
|
287
|
+
false?: typeof Expression | undefined;
|
|
288
|
+
fetch?: typeof Expression | undefined;
|
|
289
|
+
file?: typeof Expression | undefined;
|
|
290
|
+
fileFormat?: typeof Expression | undefined;
|
|
291
|
+
filter?: typeof Expression | undefined;
|
|
292
|
+
final?: typeof Expression | undefined;
|
|
293
|
+
first?: typeof Expression | undefined;
|
|
294
|
+
for?: typeof Expression | undefined;
|
|
295
|
+
force?: typeof Expression | undefined;
|
|
296
|
+
foreignKey?: typeof Expression | undefined;
|
|
297
|
+
format?: typeof Expression | undefined;
|
|
298
|
+
from?: typeof Expression | undefined;
|
|
299
|
+
full?: typeof Expression | undefined;
|
|
300
|
+
function?: typeof Expression | undefined;
|
|
301
|
+
get?: typeof Expression | undefined;
|
|
302
|
+
glob?: typeof Expression | undefined;
|
|
303
|
+
global?: typeof Expression | undefined;
|
|
304
|
+
grant?: typeof Expression | undefined;
|
|
305
|
+
groupBy?: typeof Expression | undefined;
|
|
306
|
+
groupingSets?: typeof Expression | undefined;
|
|
307
|
+
having?: typeof Expression | undefined;
|
|
308
|
+
hint?: typeof Expression | undefined;
|
|
309
|
+
ignore?: typeof Expression | undefined;
|
|
310
|
+
ilike?: typeof Expression | undefined;
|
|
311
|
+
in?: typeof Expression | undefined;
|
|
312
|
+
index?: typeof Expression | undefined;
|
|
313
|
+
indexedBy?: typeof Expression | undefined;
|
|
314
|
+
inner?: typeof Expression | undefined;
|
|
315
|
+
insert?: typeof Expression | undefined;
|
|
316
|
+
install?: typeof Expression | undefined;
|
|
317
|
+
intersect?: typeof Expression | undefined;
|
|
318
|
+
interval?: typeof Expression | undefined;
|
|
319
|
+
into?: typeof Expression | undefined;
|
|
320
|
+
introducer?: typeof Expression | undefined;
|
|
321
|
+
irlike?: typeof Expression | undefined;
|
|
322
|
+
is?: typeof Expression | undefined;
|
|
323
|
+
isnull?: typeof Expression | undefined;
|
|
324
|
+
join?: typeof Expression | undefined;
|
|
325
|
+
joinMarker?: typeof Expression | undefined;
|
|
326
|
+
keep?: typeof Expression | undefined;
|
|
327
|
+
key?: typeof Expression | undefined;
|
|
328
|
+
kill?: typeof Expression | undefined;
|
|
329
|
+
language?: typeof Expression | undefined;
|
|
330
|
+
lateral?: typeof Expression | undefined;
|
|
331
|
+
left?: typeof Expression | undefined;
|
|
332
|
+
like?: typeof Expression | undefined;
|
|
333
|
+
limit?: typeof Expression | undefined;
|
|
334
|
+
list?: typeof Expression | undefined;
|
|
335
|
+
load?: typeof Expression | undefined;
|
|
336
|
+
lock?: typeof Expression | undefined;
|
|
337
|
+
map?: typeof Expression | undefined;
|
|
338
|
+
match?: typeof Expression | undefined;
|
|
339
|
+
matchCondition?: typeof Expression | undefined;
|
|
340
|
+
matchRecognize?: typeof Expression | undefined;
|
|
341
|
+
memberOf?: typeof Expression | undefined;
|
|
342
|
+
merge?: typeof Expression | undefined;
|
|
343
|
+
mod?: typeof Expression | undefined;
|
|
344
|
+
model?: typeof Expression | undefined;
|
|
345
|
+
natural?: typeof Expression | undefined;
|
|
346
|
+
next?: typeof Expression | undefined;
|
|
347
|
+
nothing?: typeof Expression | undefined;
|
|
348
|
+
notnull?: typeof Expression | undefined;
|
|
349
|
+
null?: typeof Expression | undefined;
|
|
350
|
+
objectIdentifier?: typeof Expression | undefined;
|
|
351
|
+
offset?: typeof Expression | undefined;
|
|
352
|
+
on?: typeof Expression | undefined;
|
|
353
|
+
only?: typeof Expression | undefined;
|
|
354
|
+
operator?: typeof Expression | undefined;
|
|
355
|
+
orderBy?: typeof Expression | undefined;
|
|
356
|
+
orderSiblingsBy?: typeof Expression | undefined;
|
|
357
|
+
ordered?: typeof Expression | undefined;
|
|
358
|
+
ordinality?: typeof Expression | undefined;
|
|
359
|
+
out?: typeof Expression | undefined;
|
|
360
|
+
inout?: typeof Expression | undefined;
|
|
361
|
+
outer?: typeof Expression | undefined;
|
|
362
|
+
over?: typeof Expression | undefined;
|
|
363
|
+
overlaps?: typeof Expression | undefined;
|
|
364
|
+
overwrite?: typeof Expression | undefined;
|
|
365
|
+
partition?: typeof Expression | undefined;
|
|
366
|
+
partitionBy?: typeof Expression | undefined;
|
|
367
|
+
percent?: typeof Expression | undefined;
|
|
368
|
+
pivot?: typeof Expression | undefined;
|
|
369
|
+
placeholder?: typeof Expression | undefined;
|
|
370
|
+
positional?: typeof Expression | undefined;
|
|
371
|
+
pragma?: typeof Expression | undefined;
|
|
372
|
+
prewhere?: typeof Expression | undefined;
|
|
373
|
+
primaryKey?: typeof Expression | undefined;
|
|
374
|
+
procedure?: typeof Expression | undefined;
|
|
375
|
+
properties?: typeof Expression | undefined;
|
|
376
|
+
pseudoType?: typeof Expression | undefined;
|
|
377
|
+
put?: typeof Expression | undefined;
|
|
378
|
+
qualify?: typeof Expression | undefined;
|
|
379
|
+
quote?: typeof Expression | undefined;
|
|
380
|
+
qdcolon?: typeof Expression | undefined;
|
|
381
|
+
range?: typeof Expression | undefined;
|
|
382
|
+
recursive?: typeof Expression | undefined;
|
|
383
|
+
refresh?: typeof Expression | undefined;
|
|
384
|
+
rename?: typeof Expression | undefined;
|
|
385
|
+
replace?: typeof Expression | undefined;
|
|
386
|
+
returning?: typeof Expression | undefined;
|
|
387
|
+
revoke?: typeof Expression | undefined;
|
|
388
|
+
references?: typeof Expression | undefined;
|
|
389
|
+
right?: typeof Expression | undefined;
|
|
390
|
+
rlike?: typeof Expression | undefined;
|
|
391
|
+
rollback?: typeof Expression | undefined;
|
|
392
|
+
rollup?: typeof Expression | undefined;
|
|
393
|
+
row?: typeof Expression | undefined;
|
|
394
|
+
rows?: typeof Expression | undefined;
|
|
395
|
+
select?: typeof Expression | undefined;
|
|
396
|
+
semi?: typeof Expression | undefined;
|
|
397
|
+
separator?: typeof Expression | undefined;
|
|
398
|
+
sequence?: typeof Expression | undefined;
|
|
399
|
+
serdeProperties?: typeof Expression | undefined;
|
|
400
|
+
set?: typeof Expression | undefined;
|
|
401
|
+
settings?: typeof Expression | undefined;
|
|
402
|
+
show?: typeof Expression | undefined;
|
|
403
|
+
similarTo?: typeof Expression | undefined;
|
|
404
|
+
some?: typeof Expression | undefined;
|
|
405
|
+
sortBy?: typeof Expression | undefined;
|
|
406
|
+
soundsLike?: typeof Expression | undefined;
|
|
407
|
+
startWith?: typeof Expression | undefined;
|
|
408
|
+
storageIntegration?: typeof Expression | undefined;
|
|
409
|
+
straightJoin?: typeof Expression | undefined;
|
|
410
|
+
struct?: typeof Expression | undefined;
|
|
411
|
+
summarize?: typeof Expression | undefined;
|
|
412
|
+
tableSample?: typeof Expression | undefined;
|
|
413
|
+
tag?: typeof Expression | undefined;
|
|
414
|
+
temporary?: typeof Expression | undefined;
|
|
415
|
+
top?: typeof Expression | undefined;
|
|
416
|
+
then?: typeof Expression | undefined;
|
|
417
|
+
true?: typeof Expression | undefined;
|
|
418
|
+
truncate?: typeof Expression | undefined;
|
|
419
|
+
uncache?: typeof Expression | undefined;
|
|
420
|
+
union?: typeof Expression | undefined;
|
|
421
|
+
unnest?: typeof Expression | undefined;
|
|
422
|
+
unpivot?: typeof Expression | undefined;
|
|
423
|
+
update?: typeof Expression | undefined;
|
|
424
|
+
use?: typeof Expression | undefined;
|
|
425
|
+
using?: typeof Expression | undefined;
|
|
426
|
+
values?: typeof Expression | undefined;
|
|
427
|
+
variadic?: typeof Expression | undefined;
|
|
428
|
+
view?: typeof Expression | undefined;
|
|
429
|
+
semanticView?: typeof Expression | undefined;
|
|
430
|
+
volatile?: typeof Expression | undefined;
|
|
431
|
+
when?: typeof Expression | undefined;
|
|
432
|
+
where?: typeof Expression | undefined;
|
|
433
|
+
window?: typeof Expression | undefined;
|
|
434
|
+
with?: typeof Expression | undefined;
|
|
435
|
+
unique?: typeof Expression | undefined;
|
|
436
|
+
utcDate?: typeof Expression | undefined;
|
|
437
|
+
utcTime?: typeof Expression | undefined;
|
|
438
|
+
utcTimestamp?: typeof Expression | undefined;
|
|
439
|
+
versionSnapshot?: typeof Expression | undefined;
|
|
440
|
+
timestampSnapshot?: typeof Expression | undefined;
|
|
441
|
+
option?: typeof Expression | undefined;
|
|
442
|
+
sink?: typeof Expression | undefined;
|
|
443
|
+
source?: typeof Expression | undefined;
|
|
444
|
+
analyze?: typeof Expression | undefined;
|
|
445
|
+
namespace?: typeof Expression | undefined;
|
|
446
|
+
export?: typeof Expression | undefined;
|
|
447
|
+
hiveTokenStream?: typeof Expression | undefined;
|
|
448
|
+
};
|
|
449
|
+
static get FUNCTIONS(): Record<string, (args: Expression[], options: {
|
|
450
|
+
dialect: Dialect;
|
|
451
|
+
}) => Expression>;
|
|
452
|
+
static get PROPERTY_PARSERS(): Record<string, (this: Parser, ...args: unknown[]) => Expression | Expression[] | undefined>;
|
|
453
|
+
/**
|
|
454
|
+
* ROLLUP (rollup_name (col1, col2) [FROM from_index] [PROPERTIES (...)], ...)
|
|
455
|
+
*/
|
|
456
|
+
protected parseRollupProperty(): RollupPropertyExpr;
|
|
457
|
+
parseCreate(): CreateExpr;
|
|
458
|
+
parseUnnest(options?: {
|
|
459
|
+
withAlias?: boolean;
|
|
460
|
+
}): UnnestExpr | undefined;
|
|
461
|
+
parsePartitionedBy(): PartitionedByPropertyExpr;
|
|
462
|
+
protected parsePartitionProperty(): Expression | Expression[] | undefined;
|
|
463
|
+
protected parsePartitioningGranularityDynamic(): PartitionByRangePropertyDynamicExpr;
|
|
464
|
+
protected parseRefreshProperty(): RefreshTriggerPropertyExpr;
|
|
465
|
+
static get TABLE_ALIAS_TOKENS(): Set<TokenType>;
|
|
466
|
+
}
|
|
467
|
+
declare class StarRocksGenerator extends MySQL.Generator {
|
|
468
|
+
static get AFTER_HAVING_MODIFIER_TRANSFORMS(): Map<string, (this: Generator, e: Expression) => string>;
|
|
469
|
+
static SUPPORTS_DECODE_CASE: boolean;
|
|
470
|
+
static TRY_SUPPORTED: boolean;
|
|
471
|
+
static SUPPORTS_UESCAPE: boolean;
|
|
472
|
+
static EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE: boolean;
|
|
473
|
+
static JSON_TYPE_REQUIRED_FOR_EXTRACTION: boolean;
|
|
474
|
+
static VARCHAR_REQUIRES_SIZE: boolean;
|
|
475
|
+
static PARSE_JSON_NAME: string | undefined;
|
|
476
|
+
static WITH_PROPERTIES_PREFIX: string;
|
|
477
|
+
static UPDATE_STATEMENT_SUPPORTS_FROM: boolean;
|
|
478
|
+
static INSERT_OVERWRITE: string;
|
|
479
|
+
static IS_BOOL_ALLOWED: boolean;
|
|
480
|
+
static RENAME_TABLE_WITH_DB: boolean;
|
|
481
|
+
static get CAST_MAPPING(): Record<string, string>;
|
|
482
|
+
static get TYPE_MAPPING(): Map<DataTypeExprKind | string, string>;
|
|
483
|
+
static get PROPERTIES_LOCATION(): Map<typeof Expression, PropertiesLocation>;
|
|
484
|
+
static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: any) => string>;
|
|
485
|
+
/**
|
|
486
|
+
* Comprehensive list of StarRocks reserved keywords.
|
|
487
|
+
* Reference: https://docs.starrocks.io/docs/sql-reference/sql-statements/keywords/#reserved-keywords
|
|
488
|
+
*/
|
|
489
|
+
static get RESERVED_KEYWORDS(): Set<string>;
|
|
490
|
+
/**
|
|
491
|
+
* Overrides table creation to move Primary Keys from the schema into properties.
|
|
492
|
+
* In StarRocks, PKs are defined as part of the table properties (often after the ENGINE).
|
|
493
|
+
*/
|
|
494
|
+
createSql(expression: CreateExpr): string;
|
|
495
|
+
/**
|
|
496
|
+
* Generates the PARTITION BY clause.
|
|
497
|
+
* Handles specific parenthesis requirements for Materialized Views.
|
|
498
|
+
*/
|
|
499
|
+
partitionedByPropertySql(expression: PartitionedByPropertyExpr): string;
|
|
500
|
+
/**
|
|
501
|
+
* Generates StarRocks ORDER BY clause for clustering.
|
|
502
|
+
*/
|
|
503
|
+
clusterSql(expression: Expression): string;
|
|
504
|
+
/**
|
|
505
|
+
* Generates the REFRESH clause for materialized views.
|
|
506
|
+
*/
|
|
507
|
+
refreshTriggerPropertySql(expression: RefreshTriggerPropertyExpr): string;
|
|
508
|
+
}
|
|
509
|
+
declare class StarRocks extends MySQL {
|
|
510
|
+
static DIALECT_NAME: Dialects;
|
|
511
|
+
static STRICT_JSON_PATH_SYNTAX: boolean;
|
|
512
|
+
static INDEX_OFFSET: number;
|
|
513
|
+
static Tokenizer: typeof StarRocksTokenizer;
|
|
514
|
+
static Parser: typeof StarRocksParser;
|
|
515
|
+
static Generator: typeof StarRocksGenerator;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export { StarRocks, eliminateBetweenInDelete, stDistanceSphere };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as p}from"../chunk-O2J5RKBN.js";import{$c as H,Ad as Q,Bd as M,Ca as K,Dd as j,Dp as ge,Gf as b,Hb as N,He as Z,Ib as W,Ic as X,Ja as y,Jb as G,Jl as ce,Lk as w,Lm as Te,Mf as ee,Nm as he,Oe as z,Po as xe,Td as L,Vb as P,Xe as k,Ya as O,Yg as ie,Yl as ue,Zl as le,a as g,b as m,bi as ae,c as R,ca as f,d as n,eo as I,fb as V,hd as $,jq as me,kn as de,nb as S,ng as te,op as fe,p as v,pp as T,qg as re,qp as Ae,r as a,rb as B,sp as U,tg as se,tp as Pe,ud as D,uj as pe,uq as F,wj as oe,xd as J,xh as _,yd as C,yh as ne,yl as Ee,za as Y}from"../chunk-KCNOE4DZ.js";function ve(c){let l=c.getArgKey("where");if(l instanceof K)for(let e of l.findAll(k)){let t=e.args.low,r=e.args.high;e.replace(new de({this:new Z({this:e.args.this?.copy(),expression:t}),expression:new z({this:e.args.this?.copy(),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=p.Tokenizer,Re=[a],Se){static get ORIGINAL_KEYWORDS(){return{...p.Tokenizer.ORIGINAL_KEYWORDS,LARGEINT:"int128"}}};q=g(Se),n(q,10,"ORIGINAL_KEYWORDS",Re,A),m(q,A),R(q,3,A);var _e,Ie,ye,Oe,Ne,De,x,E=class extends(De=p.Parser,Ne=[a],Oe=[a],ye=[a],Ie=[a],_e=[a],De){static get ID_VAR_TOKENS(){return new Set([...Y.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let e={...p.Parser.NO_PAREN_FUNCTIONS};return delete e.localtime,delete e.localtimestamp,e}static get FUNCTIONS(){return{...p.Parser.FUNCTIONS,DATE_TRUNC:me,DATEDIFF:e=>new _({this:f(e,0),expression:f(e,1),unit:new H({this:"DAY",isString:!0})}),DATE_DIFF:e=>new _({this:f(e,1),expression:f(e,2),unit:f(e,0)}),ARRAY_FLATTEN:e=>b.fromArgList(e),REGEXP:e=>w.fromArgList(e)}}static get PROPERTY_PARSERS(){return{...p.Parser.PROPERTY_PARSERS,PROPERTIES:function(){return this.parseWrappedProperties()},UNIQUE:function(){return this.parseCompositeKeyProperty(M)},ROLLUP:function(){return this.parseRollupProperty()},REFRESH:function(){return this.parseRefreshProperty()}}}parseRollupProperty(){let e=()=>this.expression(G,{this:this.parseIdVar(),expressions:this.parseWrappedIdVars(),fromIndex:this.matchTextSeq(["FROM"])?this.parseIdVar():void 0,properties:this.matchTextSeq(["PROPERTIES"])?this.expression(L,{expressions:this.parseWrappedProperties()}):void 0});return this.expression(C,{expressions:this.parseWrappedCsv(e)})}parseCreate(){let e=super.parseCreate();if(e instanceof y&&e.args.this instanceof P){let t=e.args.properties;if(t){let r=t.find(S);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?v(r,O)?.args.columns||r.setArgKey("columns",[I("unnest")]):(r=new O({this:I("unnest"),columns:[I("unnest")]}),t.setArgKey("alias",r))}return t}parsePartitionedBy(){return this.expression(D,{this:new P({expressions:this.parseWrappedCsv(this.parseAssignment.bind(this),{optional:!0})})})}parsePartitionProperty(){let e=super.parsePartitionProperty();if(!e)return this.parsePartitionedBy()??void 0;if(e instanceof N)return e;this.matchLParen();let t;return this.matchTextSeq(["START"],{advance:!1})&&(t=this.parseCsv(this.parsePartitioningGranularityDynamic.bind(this))),this.matchRParen(),this.expression(J,{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(W,{start:e,end:t,every:r})}parseRefreshProperty(){let e=this.matchTexts(["DEFERRED","IMMEDIATE"])?this.prev?.text?.toUpperCase()??void 0:void 0,t=this.matchTexts(["ASYNC","MANUAL"])?this.prev?.text?.toUpperCase()??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=this.parseNumber()??void 0,o=this.parseVar({anyToken:!0})??void 0,this.matchRParen()),this.expression(Q,{method:e,kind:t,starts:r,every:i,unit:o})}static get TABLE_ALIAS_TOKENS(){return new Set([...p.Parser.TABLE_ALIAS_TOKENS,"straightJoin"])}};x=g(De),n(x,10,"ID_VAR_TOKENS",Ne,E),n(x,10,"NO_PAREN_FUNCTIONS",Oe,E),n(x,10,"FUNCTIONS",ye,E),n(x,10,"PROPERTY_PARSERS",Ie,E),n(x,10,"TABLE_ALIAS_TOKENS",_e,E),m(x,E),R(x,3,E);var Ce,Me,Le,be,we,Ue,Fe,h,s=class extends(Fe=p.Generator,Ue=[a],we=[a],be=[a],Le=[a],Me=[a],Ce=[a],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(p.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(p.Generator.PROPERTIES_LOCATION);return e.set(S,"postSchema"),e.set(M,"postSchema"),e.set(C,"postSchema"),e.set(D,"postSchema"),e}static get ORIGINAL_TRANSFORMS(){let e=new Map(p.Generator.TRANSFORMS);return e.set(ee,Pe),e.set(he,T("ARRAY_AGG")),e.set(te,T("ARRAY_FILTER")),e.set(re,T("ARRAY_JOIN")),e.set(Te,Ae),e.set(ie,()=>"CURRENT_VERSION()"),e.set(_,function(t){return this.func("DATE_DIFF",[F(t),t.args.this,t.args.expression])}),e.set(V,xe([ve])),e.set(b,T("ARRAY_FLATTEN")),e.set(oe,U),e.set(pe,U),e.set(N,ge),e.set(w,T("REGEXP")),e.set(j,function(t){return this.nakedProperty(t)}),e.set(se,Ye),e.set(Ee,function(t){return this.func("UNIX_TIMESTAMP",[t.args.this,this.formatTime(t)])}),e.set(ae,function(t){return this.func("DATE_TRUNC",[F(t),t.args.this])}),e.set(ce,T("TO_DATE")),e.set(ue,function(t){return this.func("FROM_UNIXTIME",[t.args.this,this.formatTime(t)])}),e.set(le,T("FROM_UNIXTIME")),e.delete(ne),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 P){let r=t.find(S);if(r){let i=e.args.properties;i||(i=new L({expressions:[]}),e.setArgKey("properties",i));let o=i.find($),d=o?.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 P){let r=e.findAncestor(y),i=this.expressions(t,{flat:!0}),o=t.args.expressions?.every(d=>d instanceof X||d instanceof B);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=g(Fe),n(h,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",Ue,s),n(h,10,"CAST_MAPPING",we,s),n(h,10,"TYPE_MAPPING",be,s),n(h,10,"PROPERTIES_LOCATION",Le,s),n(h,10,"ORIGINAL_TRANSFORMS",Me,s),n(h,10,"RESERVED_KEYWORDS",Ce,s),m(h,s),R(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 p{};u.DIALECT_NAME="starrocks",u.STRICT_JSON_PATH_SYNTAX=!1,u.INDEX_OFFSET=1,u.Tokenizer=A,u.Parser=E,u.Generator=s;fe.register("starrocks",u);export{u as StarRocks,ve as eliminateBetweenInDelete,Ye as stDistanceSphere};
|
|
2
|
+
//# sourceMappingURL=starrocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/dialects/starrocks.ts"],"sourcesContent":["import type {\n Generator,\n} from '../generator';\nimport {\n Parser,\n} from '../parser';\nimport {\n TokenType,\n} from '../tokens';\nimport type {\n UnnestExpr,\n} from '../expressions';\nimport {\n Expression,\n BetweenExpr, GteExpr, LteExpr, AndExpr,\n LiteralExpr, DateDiffExpr, FlattenExpr, RegexpLikeExpr,\n UniqueKeyPropertyExpr, RollupPropertyExpr, RefreshTriggerPropertyExpr,\n RollupIndexExpr, PropertiesExpr, CreateExpr, CreateExprKind, SchemaExpr, TableAliasExpr, PartitionedByPropertyExpr,\n PartitionByRangePropertyExpr, PartitionByRangePropertyDynamicExpr,\n PropertyExpr, PrimaryKeyExpr, EnginePropertyExpr, ColumnExpr,\n IdentifierExpr, DeleteExpr, ArrayExpr, ArrayAggExpr,\n ArrayFilterExpr, ArrayToStringExpr, ApproxDistinctExpr,\n StrToUnixExpr, TimestampTruncExpr,\n TimeStrToDateExpr, UnixToStrExpr, UnixToTimeExpr, DateTruncExpr,\n DataTypeExprKind, PropertiesLocation,\n JsonExtractScalarExpr, JsonExtractExpr, CurrentVersionExpr,\n StDistanceExpr,\n SchemaCommentPropertyExpr,\n toIdentifier,\n} from '../expressions';\nimport {\n seqGet,\n} from '../helper';\nimport {\n cache, narrowInstanceOf,\n} from '../port_internals';\nimport {\n preprocess,\n} from '../transforms';\nimport {\n renameFunc, arrowJsonExtractSql, buildTimestampTrunc, unitToStr,\n approxCountDistinctSql, inlineArraySql, propertySql,\n Dialect, Dialects,\n} from './dialect';\nimport {\n MySQL,\n} from './mysql';\n\n/**\n * StarRocks doesn't support BETWEEN in DELETE statements.\n * This transforms BETWEEN expressions into explicit GTE and LTE comparisons.\n * Reference: https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/DELETE/#parameters\n */\nexport function eliminateBetweenInDelete (expression: Expression): Expression {\n const where = expression.getArgKey('where');\n\n if (where instanceof Expression) {\n for (const between of where.findAll(BetweenExpr)) {\n const low = between.args.low;\n const high = between.args.high;\n\n between.replace(\n new AndExpr({\n this: new GteExpr({\n this: between.args.this?.copy(),\n expression: low,\n }),\n expression: new LteExpr({\n this: between.args.this?.copy(),\n expression: high,\n }),\n }),\n );\n }\n }\n\n return expression;\n}\n\n/**\n * StarRocks ST_Distance_Sphere expects individual coordinates rather than point objects.\n * Reference: https://docs.starrocks.io/docs/sql-reference/sql-functions/spatial-functions/st_distance_sphere/\n */\nexport function stDistanceSphere (this: Generator, expression: StDistanceExpr): string {\n const point1 = expression.args.this;\n const point2 = expression.args.expression;\n\n const point1X = this.func('ST_X', [\n point1,\n ]);\n const point1Y = this.func('ST_Y', [\n point1,\n ]);\n const point2X = this.func('ST_X', [\n point2,\n ]);\n const point2Y = this.func('ST_Y', [\n point2,\n ]);\n\n return this.func('ST_Distance_Sphere', [\n point1X,\n point1Y,\n point2X,\n point2Y,\n ]);\n}\n\nclass StarRocksTokenizer extends MySQL.Tokenizer {\n @cache\n static get ORIGINAL_KEYWORDS (): Record<string, TokenType> {\n return {\n ...MySQL.Tokenizer.ORIGINAL_KEYWORDS,\n LARGEINT: TokenType.INT128,\n };\n }\n};\n\nclass StarRocksParser extends MySQL.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 ...MySQL.Parser.NO_PAREN_FUNCTIONS,\n };\n delete noParenFunctions[TokenType.LOCALTIME];\n delete noParenFunctions[TokenType.LOCALTIMESTAMP];\n return noParenFunctions;\n }\n\n @cache\n static get FUNCTIONS (): Record<string, (args: Expression[], options: {dialect: Dialect}) => Expression> {\n return {\n ...MySQL.Parser.FUNCTIONS,\n DATE_TRUNC: buildTimestampTrunc,\n DATEDIFF: (args: Expression[]): DateDiffExpr =>\n new DateDiffExpr({\n this: seqGet(args, 0),\n expression: seqGet(args, 1),\n unit: new LiteralExpr({\n this: 'DAY',\n isString: true,\n }),\n }),\n DATE_DIFF: (args: Expression[]): DateDiffExpr =>\n new DateDiffExpr({\n this: seqGet(args, 1),\n expression: seqGet(args, 2),\n unit: seqGet(args, 0),\n }),\n ARRAY_FLATTEN: (args: unknown[]) => FlattenExpr.fromArgList(args),\n REGEXP: (args: unknown[]) => RegexpLikeExpr.fromArgList(args),\n };\n }\n\n @cache\n static get PROPERTY_PARSERS (): Record<string, (this: Parser, ...args: unknown[]) => Expression | Expression[] | undefined> {\n return {\n ...MySQL.Parser.PROPERTY_PARSERS,\n PROPERTIES: function (this: Parser): Expression[] {\n return (this as StarRocksParser).parseWrappedProperties();\n },\n UNIQUE: function (this: Parser): Expression {\n return (this as StarRocksParser).parseCompositeKeyProperty(UniqueKeyPropertyExpr);\n },\n ROLLUP: function (this: Parser): RollupPropertyExpr {\n return (this as StarRocksParser).parseRollupProperty();\n },\n REFRESH: function (this: Parser): Expression {\n return (this as StarRocksParser).parseRefreshProperty();\n },\n };\n }\n\n /**\n * ROLLUP (rollup_name (col1, col2) [FROM from_index] [PROPERTIES (...)], ...)\n */\n protected parseRollupProperty (): RollupPropertyExpr {\n const parseRollupIndex = (): RollupIndexExpr => {\n return this.expression(RollupIndexExpr, {\n this: this.parseIdVar(),\n expressions: this.parseWrappedIdVars(),\n fromIndex: this.matchTextSeq([\n 'FROM',\n ])\n ? this.parseIdVar()\n : undefined,\n properties: this.matchTextSeq([\n 'PROPERTIES',\n ])\n ? this.expression(PropertiesExpr, {\n expressions: this.parseWrappedProperties(),\n })\n : undefined,\n });\n };\n\n return this.expression(RollupPropertyExpr, {\n expressions: this.parseWrappedCsv(parseRollupIndex),\n });\n }\n\n public parseCreate (): CreateExpr {\n const create = super.parseCreate();\n\n // StarRocks' primary key is defined outside of the schema in properties,\n // so we move it into the schema expressions for standard AST representation.\n if (create instanceof CreateExpr && create.args.this instanceof SchemaExpr) {\n const props = create.args.properties;\n if (props) {\n const primaryKey = props.find(PrimaryKeyExpr);\n if (primaryKey) {\n create.args.this.append('expressions', primaryKey.pop());\n }\n }\n }\n\n return create as CreateExpr;\n }\n\n public parseUnnest (options: {withAlias?: boolean} = {}): UnnestExpr | undefined {\n const unnest = super.parseUnnest(options);\n\n if (unnest) {\n let aliasObj = unnest.args.alias;\n\n if (!aliasObj) {\n // StarRocks defaults to naming the table alias as \"unnest\"\n aliasObj = new TableAliasExpr({\n this: toIdentifier('unnest'),\n columns: [\n toIdentifier('unnest'),\n ],\n });\n unnest.setArgKey('alias', aliasObj);\n } else if (!narrowInstanceOf(aliasObj, TableAliasExpr)?.args.columns) {\n // StarRocks defaults to naming the UNNEST column as \"unnest\" if unspecified\n aliasObj.setArgKey('columns', [\n toIdentifier('unnest'),\n ]);\n }\n }\n\n return unnest;\n }\n\n public parsePartitionedBy (): PartitionedByPropertyExpr {\n return this.expression(PartitionedByPropertyExpr, {\n this: new SchemaExpr({\n expressions: this.parseWrappedCsv(this.parseAssignment.bind(this), {\n optional: true,\n }),\n }),\n });\n }\n\n protected parsePartitionProperty (): Expression | Expression[] | undefined {\n const expr = super.parsePartitionProperty();\n\n if (!expr) {\n return this.parsePartitionedBy() ?? undefined;\n }\n\n if (expr instanceof PropertyExpr) {\n return expr;\n }\n\n this.matchLParen();\n\n let createExpressions: Expression[] | undefined = undefined;\n if (this.matchTextSeq([\n 'START',\n ], {\n advance: false,\n })) {\n createExpressions = this.parseCsv(this.parsePartitioningGranularityDynamic.bind(this));\n }\n\n this.matchRParen();\n\n return this.expression(PartitionByRangePropertyExpr, {\n partitionExpressions: expr,\n createExpressions: createExpressions,\n });\n }\n\n protected parsePartitioningGranularityDynamic (): PartitionByRangePropertyDynamicExpr {\n this.matchTextSeq([\n 'START',\n ]);\n const start = this.parseWrapped(this.parseString.bind(this));\n this.matchTextSeq([\n 'END',\n ]);\n const end = this.parseWrapped(this.parseString.bind(this));\n this.matchTextSeq([\n 'EVERY',\n ]);\n const every = this.parseWrapped(() => this.parseInterval() || this.parseNumber());\n\n return this.expression(PartitionByRangePropertyDynamicExpr, {\n start: start,\n end: end,\n every: every,\n });\n }\n\n protected parseRefreshProperty (): RefreshTriggerPropertyExpr {\n const method = this.matchTexts([\n 'DEFERRED',\n 'IMMEDIATE',\n ])\n ? this.prev?.text?.toUpperCase() ?? undefined\n : undefined;\n const kind = this.matchTexts([\n 'ASYNC',\n 'MANUAL',\n ])\n ? this.prev?.text?.toUpperCase() ?? undefined\n : undefined;\n const start = this.matchTextSeq([\n 'START',\n ])\n ? this.parseWrapped(this.parseString.bind(this))\n : undefined;\n\n let every: Expression | undefined = undefined;\n let unit: Expression | undefined = undefined;\n\n if (this.matchTextSeq([\n 'EVERY',\n ])) {\n this.matchLParen();\n this.matchTextSeq([\n 'INTERVAL',\n ]);\n every = this.parseNumber() ?? undefined;\n unit = this.parseVar({\n anyToken: true,\n }) ?? undefined;\n this.matchRParen();\n }\n\n return this.expression(RefreshTriggerPropertyExpr, {\n method: method,\n kind: kind,\n starts: start,\n every: every,\n unit: unit,\n });\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get TABLE_ALIAS_TOKENS (): Set<TokenType> {\n return new Set([\n ...MySQL.Parser.TABLE_ALIAS_TOKENS,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n};\n\nclass StarRocksGenerator extends MySQL.Generator {\n // port from _Dialect metaclass logic\n @cache\n static get AFTER_HAVING_MODIFIER_TRANSFORMS () {\n const modifiers = new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);\n [\n 'cluster',\n 'distribute',\n 'sort',\n ].forEach((m) => modifiers.delete(m));\n return modifiers;\n }\n\n // port from _Dialect metaclass logic\n static SUPPORTS_DECODE_CASE = false;\n // port from _Dialect metaclass logic\n static TRY_SUPPORTED = false;\n // port from _Dialect metaclass logic\n static SUPPORTS_UESCAPE = false;\n static EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE: boolean = false;\n static JSON_TYPE_REQUIRED_FOR_EXTRACTION: boolean = false;\n static VARCHAR_REQUIRES_SIZE: boolean = false;\n static PARSE_JSON_NAME: string | undefined = 'PARSE_JSON';\n static WITH_PROPERTIES_PREFIX: string = 'PROPERTIES';\n static UPDATE_STATEMENT_SUPPORTS_FROM: boolean = true;\n static INSERT_OVERWRITE: string = ' OVERWRITE';\n\n // StarRocks doesn't support \"IS TRUE/FALSE\" syntax.\n static IS_BOOL_ALLOWED: boolean = false;\n // StarRocks doesn't support renaming a table with a database.\n static RENAME_TABLE_WITH_DB: boolean = false;\n\n @cache\n static get CAST_MAPPING (): Record<string, string> {\n return {};\n }\n\n @cache\n static get TYPE_MAPPING (): Map<DataTypeExprKind | string, string> {\n const m = new Map(MySQL.Generator.TYPE_MAPPING);\n m.set(DataTypeExprKind.INT128, 'LARGEINT');\n m.set(DataTypeExprKind.TEXT, 'STRING');\n m.set(DataTypeExprKind.TIMESTAMP, 'DATETIME');\n m.set(DataTypeExprKind.TIMESTAMPTZ, 'DATETIME');\n return m;\n }\n\n @cache\n static get PROPERTIES_LOCATION (): Map<typeof Expression, PropertiesLocation> {\n const m = new Map(MySQL.Generator.PROPERTIES_LOCATION);\n m.set(PrimaryKeyExpr, PropertiesLocation.POST_SCHEMA);\n m.set(UniqueKeyPropertyExpr, PropertiesLocation.POST_SCHEMA);\n m.set(RollupPropertyExpr, PropertiesLocation.POST_SCHEMA);\n m.set(PartitionedByPropertyExpr, PropertiesLocation.POST_SCHEMA);\n return m;\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 m = new Map<typeof Expression, (this: Generator, e: any) => string>(MySQL.Generator.TRANSFORMS);\n m.set(ArrayExpr, inlineArraySql);\n m.set(ArrayAggExpr, renameFunc('ARRAY_AGG'));\n m.set(ArrayFilterExpr, renameFunc('ARRAY_FILTER'));\n m.set(ArrayToStringExpr, renameFunc('ARRAY_JOIN'));\n m.set(ApproxDistinctExpr, approxCountDistinctSql);\n m.set(CurrentVersionExpr, (): string => 'CURRENT_VERSION()');\n m.set(\n DateDiffExpr,\n function (this: Generator, e: DateDiffExpr): string {\n return this.func('DATE_DIFF', [\n unitToStr(e),\n e.args.this,\n e.args.expression,\n ]);\n },\n );\n m.set(DeleteExpr, preprocess([\n eliminateBetweenInDelete,\n ]));\n m.set(FlattenExpr, renameFunc('ARRAY_FLATTEN'));\n m.set(JsonExtractScalarExpr, arrowJsonExtractSql);\n m.set(JsonExtractExpr, arrowJsonExtractSql);\n m.set(PropertyExpr, propertySql);\n m.set(RegexpLikeExpr, renameFunc('REGEXP'));\n m.set(SchemaCommentPropertyExpr, function (this: Generator, e: Expression): string {\n return this.nakedProperty(e);\n });\n m.set(StDistanceExpr, stDistanceSphere);\n m.set(\n StrToUnixExpr,\n function (this: Generator, e: StrToUnixExpr): string {\n return this.func('UNIX_TIMESTAMP', [\n e.args.this,\n this.formatTime(e),\n ]);\n },\n );\n m.set(\n TimestampTruncExpr,\n function (this: Generator, e: TimestampTruncExpr): string {\n return this.func('DATE_TRUNC', [\n unitToStr(e),\n e.args.this,\n ]);\n },\n );\n m.set(TimeStrToDateExpr, renameFunc('TO_DATE'));\n m.set(\n UnixToStrExpr,\n function (this: Generator, e: UnixToStrExpr): string {\n return this.func('FROM_UNIXTIME', [\n e.args.this,\n this.formatTime(e),\n ]);\n },\n );\n m.set(UnixToTimeExpr, renameFunc('FROM_UNIXTIME'));\n // StarRocks uses DATE_TRUNC instead of the MySQL simulation, so we remove the MySQL transform.\n m.delete(DateTruncExpr);\n return m;\n }\n\n /**\n * Comprehensive list of StarRocks reserved keywords.\n * Reference: https://docs.starrocks.io/docs/sql-reference/sql-statements/keywords/#reserved-keywords\n */\n @cache\n static get RESERVED_KEYWORDS (): Set<string> {\n return new Set([\n 'add',\n 'all',\n 'alter',\n 'analyze',\n 'and',\n 'array',\n 'as',\n 'asc',\n 'between',\n 'bigint',\n 'bitmap',\n 'both',\n 'by',\n 'case',\n 'char',\n 'character',\n 'check',\n 'collate',\n 'column',\n 'compaction',\n 'convert',\n 'create',\n 'cross',\n 'cube',\n 'current_date',\n 'current_role',\n 'current_time',\n 'current_timestamp',\n 'current_user',\n 'database',\n 'databases',\n 'decimal',\n 'decimalv2',\n 'decimal32',\n 'decimal64',\n 'decimal128',\n 'default',\n 'deferred',\n 'delete',\n 'dense_rank',\n 'desc',\n 'describe',\n 'distinct',\n 'double',\n 'drop',\n 'dual',\n 'else',\n 'except',\n 'exists',\n 'explain',\n 'false',\n 'first_value',\n 'float',\n 'for',\n 'force',\n 'from',\n 'full',\n 'function',\n 'grant',\n 'group',\n 'grouping',\n 'grouping_id',\n 'groups',\n 'having',\n 'hll',\n 'host',\n 'if',\n 'ignore',\n 'immediate',\n 'in',\n 'index',\n 'infile',\n 'inner',\n 'insert',\n 'int',\n 'integer',\n 'intersect',\n 'into',\n 'is',\n 'join',\n 'json',\n 'key',\n 'keys',\n 'kill',\n 'lag',\n 'largeint',\n 'last_value',\n 'lateral',\n 'lead',\n 'left',\n 'like',\n 'limit',\n 'load',\n 'localtime',\n 'localtimestamp',\n 'maxvalue',\n 'minus',\n 'mod',\n 'not',\n 'ntile',\n 'undefined',\n 'on',\n 'or',\n 'order',\n 'outer',\n 'outfile',\n 'over',\n 'partition',\n 'percentile',\n 'primary',\n 'procedure',\n 'qualify',\n 'range',\n 'rank',\n 'read',\n 'regexp',\n 'release',\n 'rename',\n 'replace',\n 'revoke',\n 'right',\n 'rlike',\n 'row',\n 'row_number',\n 'rows',\n 'schema',\n 'schemas',\n 'select',\n 'set',\n 'set_var',\n 'show',\n 'smallint',\n 'system',\n 'table',\n 'terminated',\n 'text',\n 'then',\n 'tinyint',\n 'to',\n 'true',\n 'union',\n 'unique',\n 'unsigned',\n 'update',\n 'use',\n 'using',\n 'values',\n 'varchar',\n 'when',\n 'where',\n 'with',\n ]);\n }\n\n /**\n * Overrides table creation to move Primary Keys from the schema into properties.\n * In StarRocks, PKs are defined as part of the table properties (often after the ENGINE).\n */\n public createSql (expression: CreateExpr): string {\n const schema = expression.args.this;\n\n if (schema instanceof SchemaExpr) {\n const primaryKey = schema.find(PrimaryKeyExpr);\n\n if (primaryKey) {\n let props = expression.args.properties;\n\n if (!props) {\n props = new PropertiesExpr({\n expressions: [\n ],\n });\n expression.setArgKey('properties', props);\n }\n\n // StarRocks typically wants the PK property right after the ENGINE property\n const engine = props.find(EnginePropertyExpr);\n const engineIndex = engine?.index !== undefined ? engine.index : -1;\n\n // Move the Primary Key from the schema to the properties list at the correct index\n props.setArgKey('expressions', [\n primaryKey.pop(),\n ], engineIndex + 1, {\n overwrite: false,\n });\n }\n }\n\n return super.createSql(expression);\n }\n\n /**\n * Generates the PARTITION BY clause.\n * Handles specific parenthesis requirements for Materialized Views.\n */\n public partitionedByPropertySql (expression: PartitionedByPropertyExpr): string {\n const thisExpr = expression.args.this;\n\n if (thisExpr instanceof SchemaExpr) {\n // StarRocks requires outer parentheses for MVs or simple column lists.\n const create = expression.findAncestor(CreateExpr);\n\n let sqlResult = this.expressions(thisExpr, {\n flat: true,\n });\n const isSimpleColumnList = thisExpr.args.expressions?.every(\n (col) => col instanceof ColumnExpr || col instanceof IdentifierExpr,\n );\n\n if ((create && create.args.kind === CreateExprKind.VIEW) || isSimpleColumnList) {\n sqlResult = `(${sqlResult})`;\n }\n\n return `PARTITION BY ${sqlResult}`;\n }\n\n return `PARTITION BY ${this.sql(thisExpr)}`;\n }\n\n /**\n * Generates StarRocks ORDER BY clause for clustering.\n */\n public clusterSql (expression: Expression): string {\n const expressions = this.expressions(expression, {\n flat: true,\n });\n return expressions ? `ORDER BY (${expressions})` : '';\n }\n\n /**\n * Generates the REFRESH clause for materialized views.\n */\n public refreshTriggerPropertySql (expression: RefreshTriggerPropertyExpr): string {\n let method = this.sql(expression, 'method');\n method = method ? ` ${method}` : '';\n\n let kind = this.sql(expression, 'kind');\n kind = kind ? ` ${kind}` : '';\n\n let starts = this.sql(expression, 'starts');\n starts = starts ? ` START (${starts})` : '';\n\n const everyValue = this.sql(expression, 'every');\n const unitValue = this.sql(expression, 'unit');\n const every = (everyValue && unitValue) ? ` EVERY (INTERVAL ${everyValue} ${unitValue})` : '';\n\n return `REFRESH${method}${kind}${starts}${every}`;\n }\n}\n\nexport class StarRocks extends MySQL {\n static DIALECT_NAME = Dialects.STARROCKS;\n static STRICT_JSON_PATH_SYNTAX = false;\n static INDEX_OFFSET = 1;\n\n static Tokenizer = StarRocksTokenizer;\n static Parser = StarRocksParser;\n static Generator = StarRocksGenerator;\n}\nDialect.register(Dialects.STARROCKS, StarRocks);\n"],"mappings":"2jBAqDO,SAASA,GAA0BC,EAAoC,CAC5E,IAAMC,EAAQD,EAAW,UAAU,OAAO,EAE1C,GAAIC,aAAiBC,EACnB,QAAWC,KAAWF,EAAM,QAAQG,CAAW,EAAG,CAChD,IAAMC,EAAMF,EAAQ,KAAK,IACnBG,EAAOH,EAAQ,KAAK,KAE1BA,EAAQ,QACN,IAAII,GAAQ,CACV,KAAM,IAAIC,EAAQ,CAChB,KAAML,EAAQ,KAAK,MAAM,KAAK,EAC9B,WAAYE,CACd,CAAC,EACD,WAAY,IAAII,EAAQ,CACtB,KAAMN,EAAQ,KAAK,MAAM,KAAK,EAC9B,WAAYG,CACd,CAAC,CACH,CAAC,CACH,CACF,CAGF,OAAON,CACT,CAMO,SAASU,GAAmCV,EAAoC,CACrF,IAAMW,EAASX,EAAW,KAAK,KACzBY,EAASZ,EAAW,KAAK,WAEzBa,EAAU,KAAK,KAAK,OAAQ,CAChCF,CACF,CAAC,EACKG,EAAU,KAAK,KAAK,OAAQ,CAChCH,CACF,CAAC,EACKI,EAAU,KAAK,KAAK,OAAQ,CAChCH,CACF,CAAC,EACKI,EAAU,KAAK,KAAK,OAAQ,CAChCJ,CACF,CAAC,EAED,OAAO,KAAK,KAAK,qBAAsB,CACrCC,EACAC,EACAC,EACAC,CACF,CAAC,CACH,CA1GA,IAAAC,GAAAC,GAAAC,EA4GMC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A,CAAC,CAC7B,CAAC,EACDV,EAAE,IAAImB,GAAgBzF,EAAgB,EACtCsE,EAAE,IACAoB,GACA,SAA2BV,EAA0B,CACnD,OAAO,KAAK,KAAK,iBAAkB,CACjCA,EAAE,KAAK,KACP,KAAK,WAAWA,CAAC,CACnB,CAAC,CACH,CACF,EACAV,EAAE,IACAqB,GACA,SAA2BX,EAA+B,CACxD,OAAO,KAAK,KAAK,aAAc,CAC7BC,EAAUD,CAAC,EACXA,EAAE,KAAK,IACT,CAAC,CACH,CACF,EACAV,EAAE,IAAIsB,GAAmBlB,EAAW,SAAS,CAAC,EAC9CJ,EAAE,IACAuB,GACA,SAA2Bb,EAA0B,CACnD,OAAO,KAAK,KAAK,gBAAiB,CAChCA,EAAE,KAAK,KACP,KAAK,WAAWA,CAAC,CACnB,CAAC,CACH,CACF,EACAV,EAAE,IAAIwB,GAAgBpB,EAAW,eAAe,CAAC,EAEjDJ,EAAE,OAAOyB,EAAa,EACfzB,CACT,CAOA,WAAW,mBAAkC,CAC3C,OAAO,IAAI,IAAI,CACb,MACA,MACA,QACA,UACA,MACA,QACA,KACA,MACA,UACA,SACA,SACA,OACA,KACA,OACA,OACA,YACA,QACA,UACA,SACA,aACA,UACA,SACA,QACA,OACA,eACA,eACA,eACA,oBACA,eACA,WACA,YACA,UACA,YACA,YACA,YACA,aACA,UACA,WACA,SACA,aACA,OACA,WACA,WACA,SACA,OACA,OACA,OACA,SACA,SACA,UACA,QACA,cACA,QACA,MACA,QACA,OACA,OACA,WACA,QACA,QACA,WACA,cACA,SACA,SACA,MACA,OACA,KACA,SACA,YACA,KACA,QACA,SACA,QACA,SACA,MACA,UACA,YACA,OACA,KACA,OACA,OACA,MACA,OACA,OACA,MACA,WACA,aACA,UACA,OACA,OACA,OACA,QACA,OACA,YACA,iBACA,WACA,QACA,MACA,MACA,QACA,YACA,KACA,KACA,QACA,QACA,UACA,OACA,YACA,aACA,UACA,YACA,UACA,QACA,OACA,OACA,SACA,UACA,SACA,UACA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AA0B,GAFtBA,EAGJ,aAAe,EAHXA,EAKJ,UAAYpG,EALRoG,EAMJ,OAASxF,EANLwF,EAOJ,UAAY1C,EAErB2C,GAAQ,qBAA6BD,CAAS","names":["eliminateBetweenInDelete","expression","where","Expression","between","BetweenExpr","low","high","AndExpr","GteExpr","LteExpr","stDistanceSphere","point1","point2","point1X","point1Y","point2X","point2Y","_ORIGINAL_KEYWORDS_dec","_a","_init","StarRocksTokenizer","MySQL","cache","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","_TABLE_ALIAS_TOKENS_dec","_PROPERTY_PARSERS_dec","_FUNCTIONS_dec","_NO_PAREN_FUNCTIONS_dec","_ID_VAR_TOKENS_dec","StarRocksParser","Parser","noParenFunctions","buildTimestampTrunc","args","DateDiffExpr","seqGet","LiteralExpr","FlattenExpr","RegexpLikeExpr","UniqueKeyPropertyExpr","parseRollupIndex","RollupIndexExpr","PropertiesExpr","RollupPropertyExpr","create","CreateExpr","SchemaExpr","props","primaryKey","PrimaryKeyExpr","options","unnest","aliasObj","narrowInstanceOf","TableAliasExpr","toIdentifier","PartitionedByPropertyExpr","expr","PropertyExpr","createExpressions","PartitionByRangePropertyExpr","start","end","every","PartitionByRangePropertyDynamicExpr","method","kind","unit","RefreshTriggerPropertyExpr","_RESERVED_KEYWORDS_dec","_ORIGINAL_TRANSFORMS_dec","_PROPERTIES_LOCATION_dec","_TYPE_MAPPING_dec","_CAST_MAPPING_dec","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","StarRocksGenerator","modifiers","m","ArrayExpr","inlineArraySql","ArrayAggExpr","renameFunc","ArrayFilterExpr","ArrayToStringExpr","ApproxDistinctExpr","approxCountDistinctSql","CurrentVersionExpr","e","unitToStr","DeleteExpr","preprocess","JsonExtractScalarExpr","arrowJsonExtractSql","JsonExtractExpr","propertySql","SchemaCommentPropertyExpr","StDistanceExpr","StrToUnixExpr","TimestampTruncExpr","TimeStrToDateExpr","UnixToStrExpr","UnixToTimeExpr","DateTruncExpr","schema","engine","EnginePropertyExpr","engineIndex","thisExpr","sqlResult","isSimpleColumnList","col","ColumnExpr","IdentifierExpr","expressions","starts","everyValue","unitValue","StarRocks","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(); } }var _chunk2Z3O2CFMcjs = require('../chunk-2Z3O2CFM.cjs');var w,q,K,R,E= exports.TableauTokenizer =class extends(K=_chunk2Z3O2CFMcjs.Xq,q=[_chunk2Z3O2CFMcjs.r],w=[_chunk2Z3O2CFMcjs.r],K){static get IDENTIFIERS(){return[["[","]"]]}static get QUOTES(){return["'",'"']}};R=_chunk2Z3O2CFMcjs.a.call(void 0, K),_chunk2Z3O2CFMcjs.d.call(void 0, R,10,"IDENTIFIERS",q,E),_chunk2Z3O2CFMcjs.d.call(void 0, R,10,"QUOTES",w,E),_chunk2Z3O2CFMcjs.b.call(void 0, R,E),_chunk2Z3O2CFMcjs.c.call(void 0, R,3,E);var B,V,Y,k,J,p,o= exports.TableauParser =class extends(J=_chunk2Z3O2CFMcjs.za,k=[_chunk2Z3O2CFMcjs.r],Y=[_chunk2Z3O2CFMcjs.r],V=[_chunk2Z3O2CFMcjs.r],B=[_chunk2Z3O2CFMcjs.r],J){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,COUNTD:t=>new (0, _chunk2Z3O2CFMcjs.en)({this:new (0, _chunk2Z3O2CFMcjs.nc)({expressions:t})}),FIND:t=>_chunk2Z3O2CFMcjs.tl.fromArgList(t),FINDNTH:t=>new (0, _chunk2Z3O2CFMcjs.tl)({this:_chunk2Z3O2CFMcjs.ca.call(void 0, t,0),substr:_chunk2Z3O2CFMcjs.ca.call(void 0, t,1),occurrence:_chunk2Z3O2CFMcjs.ca.call(void 0, t,2)})}}static get TABLE_ALIAS_TOKENS(){return new Set([..._chunk2Z3O2CFMcjs.za.TABLE_ALIAS_TOKENS,"straightJoin"])}};p=_chunk2Z3O2CFMcjs.a.call(void 0, J),_chunk2Z3O2CFMcjs.d.call(void 0, p,10,"ID_VAR_TOKENS",k,o),_chunk2Z3O2CFMcjs.d.call(void 0, p,10,"NO_PAREN_FUNCTIONS",Y,o),_chunk2Z3O2CFMcjs.d.call(void 0, p,10,"FUNCTIONS",V,o),_chunk2Z3O2CFMcjs.d.call(void 0, p,10,"TABLE_ALIAS_TOKENS",B,o),_chunk2Z3O2CFMcjs.b.call(void 0, p,o),_chunk2Z3O2CFMcjs.c.call(void 0, p,3,o),o.NO_PAREN_IF_COMMANDS=!1;var $,G,Q,u,Z,S,s= exports.TableauGenerator =class extends(Z=_chunk2Z3O2CFMcjs.lp,u=[_chunk2Z3O2CFMcjs.r],Q=[_chunk2Z3O2CFMcjs.r],G=[_chunk2Z3O2CFMcjs.r],$=[_chunk2Z3O2CFMcjs.r],Z){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let t=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(i=>t.delete(i)),t}static get PROPERTIES_LOCATION(){let t=new Map(_chunk2Z3O2CFMcjs.lp.PROPERTIES_LOCATION);return t.set(_chunk2Z3O2CFMcjs.Od,"unsupported"),t}static get TYPE_MAPPING(){return new Map(_chunk2Z3O2CFMcjs.lp.TYPE_MAPPING)}static get ORIGINAL_TRANSFORMS(){let t=new Map(_chunk2Z3O2CFMcjs.lp.TRANSFORMS);return t.set(_chunk2Z3O2CFMcjs.Jg,_chunk2Z3O2CFMcjs.pp.call(void 0, "IFNULL")),t.set(_chunk2Z3O2CFMcjs._i,function(i){return`IF ${this.sql(i,"this")} THEN ${this.sql(i,"true")} ELSE ${this.sql(i,"false")} END`}),t.set(_chunk2Z3O2CFMcjs.Wd,_chunk2Z3O2CFMcjs.Po.call(void 0, [_chunk2Z3O2CFMcjs.So])),t}countSql(t){let i=t.args.this;return i instanceof _chunk2Z3O2CFMcjs.nc?this.func("COUNTD",_nullishCoalesce(i.args.expressions, () => ([]))):this.func("COUNT",[i])}strPositionSql(t){let i=t.args.occurrence!==void 0;return _chunk2Z3O2CFMcjs.Ep.call(this,t,{funcName:i?"FINDNTH":"FIND",supportsOccurrence:i})}};S=_chunk2Z3O2CFMcjs.a.call(void 0, Z),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",u,s),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"PROPERTIES_LOCATION",Q,s),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"TYPE_MAPPING",G,s),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"ORIGINAL_TRANSFORMS",$,s),_chunk2Z3O2CFMcjs.b.call(void 0, S,s),_chunk2Z3O2CFMcjs.c.call(void 0, S,3,s),s.SUPPORTS_DECODE_CASE=!1,s.SELECT_KINDS=[],s.TRY_SUPPORTED=!1,s.SUPPORTS_UESCAPE=!1,s.JOIN_HINTS=!1,s.TABLE_HINTS=!1,s.QUERY_HINTS=!1;var j,l,D,e= exports.Tableau =class extends(l=_chunk2Z3O2CFMcjs.op,j=[_chunk2Z3O2CFMcjs.r],l){static get NORMALIZATION_STRATEGY(){return"caseInsensitive"}};D=_chunk2Z3O2CFMcjs.a.call(void 0, l),_chunk2Z3O2CFMcjs.d.call(void 0, D,10,"NORMALIZATION_STRATEGY",j,e),_chunk2Z3O2CFMcjs.b.call(void 0, D,e),_chunk2Z3O2CFMcjs.c.call(void 0, D,3,e),e.DIALECT_NAME="tableau",e.LOG_BASE_FIRST=!1,e.Tokenizer=E,e.Parser=o,e.Generator=s;_chunk2Z3O2CFMcjs.op.register("tableau",e);exports.Tableau = e; exports.TableauGenerator = s; exports.TableauParser = o; exports.TableauTokenizer = E;
|
|
2
|
+
//# sourceMappingURL=tableau.cjs.map
|