@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,496 @@
|
|
|
1
|
+
import { c as Dialect, d as Dialects, m as Tokenizer, l as TokenType, i as Parser, E as Expression, Q as QueryExpr, cN as OrderedExpr, cO as SelectExpr, cP as FromExpr, G as Generator } from '../tokens-VcMD09XM.js';
|
|
2
|
+
|
|
3
|
+
declare class PRQLTokenizer extends Tokenizer {
|
|
4
|
+
static get IDENTIFIERS(): string[];
|
|
5
|
+
static get QUOTES(): string[];
|
|
6
|
+
static get SINGLE_TOKENS(): {
|
|
7
|
+
'=': TokenType;
|
|
8
|
+
'\'': TokenType;
|
|
9
|
+
'"': TokenType;
|
|
10
|
+
'`': TokenType;
|
|
11
|
+
'#': TokenType;
|
|
12
|
+
};
|
|
13
|
+
static get ORIGINAL_KEYWORDS(): {
|
|
14
|
+
[x: string]: TokenType;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare class PRQLParser extends Parser {
|
|
18
|
+
static get ID_VAR_TOKENS(): Set<TokenType>;
|
|
19
|
+
static get NO_PAREN_FUNCTIONS(): {
|
|
20
|
+
lParen?: typeof Expression | undefined;
|
|
21
|
+
rParen?: typeof Expression | undefined;
|
|
22
|
+
lBracket?: typeof Expression | undefined;
|
|
23
|
+
rBracket?: typeof Expression | undefined;
|
|
24
|
+
lBrace?: typeof Expression | undefined;
|
|
25
|
+
rBrace?: typeof Expression | undefined;
|
|
26
|
+
comma?: typeof Expression | undefined;
|
|
27
|
+
dot?: typeof Expression | undefined;
|
|
28
|
+
dash?: typeof Expression | undefined;
|
|
29
|
+
plus?: typeof Expression | undefined;
|
|
30
|
+
colon?: typeof Expression | undefined;
|
|
31
|
+
dotcolon?: typeof Expression | undefined;
|
|
32
|
+
dcolon?: typeof Expression | undefined;
|
|
33
|
+
dcolondollar?: typeof Expression | undefined;
|
|
34
|
+
dcolonpercent?: typeof Expression | undefined;
|
|
35
|
+
dcolonqmark?: typeof Expression | undefined;
|
|
36
|
+
dqmark?: typeof Expression | undefined;
|
|
37
|
+
semicolon?: typeof Expression | undefined;
|
|
38
|
+
star?: typeof Expression | undefined;
|
|
39
|
+
backslash?: typeof Expression | undefined;
|
|
40
|
+
slash?: typeof Expression | undefined;
|
|
41
|
+
lt?: typeof Expression | undefined;
|
|
42
|
+
lte?: typeof Expression | undefined;
|
|
43
|
+
gt?: typeof Expression | undefined;
|
|
44
|
+
gte?: typeof Expression | undefined;
|
|
45
|
+
not?: typeof Expression | undefined;
|
|
46
|
+
eq?: typeof Expression | undefined;
|
|
47
|
+
neq?: typeof Expression | undefined;
|
|
48
|
+
nullsafeEq?: typeof Expression | undefined;
|
|
49
|
+
colonEq?: typeof Expression | undefined;
|
|
50
|
+
colonGt?: typeof Expression | undefined;
|
|
51
|
+
ncolonGt?: typeof Expression | undefined;
|
|
52
|
+
and?: typeof Expression | undefined;
|
|
53
|
+
or?: typeof Expression | undefined;
|
|
54
|
+
amp?: typeof Expression | undefined;
|
|
55
|
+
dpipe?: typeof Expression | undefined;
|
|
56
|
+
pipeGt?: typeof Expression | undefined;
|
|
57
|
+
pipe?: typeof Expression | undefined;
|
|
58
|
+
pipeSlash?: typeof Expression | undefined;
|
|
59
|
+
dpipeSlash?: typeof Expression | undefined;
|
|
60
|
+
caret?: typeof Expression | undefined;
|
|
61
|
+
caretAt?: typeof Expression | undefined;
|
|
62
|
+
tilde?: typeof Expression | undefined;
|
|
63
|
+
arrow?: typeof Expression | undefined;
|
|
64
|
+
darrow?: typeof Expression | undefined;
|
|
65
|
+
farrow?: typeof Expression | undefined;
|
|
66
|
+
hash?: typeof Expression | undefined;
|
|
67
|
+
hashArrow?: typeof Expression | undefined;
|
|
68
|
+
dhashArrow?: typeof Expression | undefined;
|
|
69
|
+
lrArrow?: typeof Expression | undefined;
|
|
70
|
+
dat?: typeof Expression | undefined;
|
|
71
|
+
ltAt?: typeof Expression | undefined;
|
|
72
|
+
atGt?: typeof Expression | undefined;
|
|
73
|
+
dollar?: typeof Expression | undefined;
|
|
74
|
+
parameter?: typeof Expression | undefined;
|
|
75
|
+
session?: typeof Expression | undefined;
|
|
76
|
+
sessionParameter?: typeof Expression | undefined;
|
|
77
|
+
sessionUser?: typeof Expression | undefined;
|
|
78
|
+
damp?: typeof Expression | undefined;
|
|
79
|
+
ampLt?: typeof Expression | undefined;
|
|
80
|
+
ampGt?: typeof Expression | undefined;
|
|
81
|
+
adjacent?: typeof Expression | undefined;
|
|
82
|
+
xor?: typeof Expression | undefined;
|
|
83
|
+
dstar?: typeof Expression | undefined;
|
|
84
|
+
qmarkAmp?: typeof Expression | undefined;
|
|
85
|
+
qmarkPipe?: typeof Expression | undefined;
|
|
86
|
+
hashDash?: typeof Expression | undefined;
|
|
87
|
+
exclamation?: typeof Expression | undefined;
|
|
88
|
+
uriStart?: typeof Expression | undefined;
|
|
89
|
+
blockStart?: typeof Expression | undefined;
|
|
90
|
+
blockEnd?: typeof Expression | undefined;
|
|
91
|
+
space?: typeof Expression | undefined;
|
|
92
|
+
break?: typeof Expression | undefined;
|
|
93
|
+
string?: typeof Expression | undefined;
|
|
94
|
+
number?: typeof Expression | undefined;
|
|
95
|
+
identifier?: typeof Expression | undefined;
|
|
96
|
+
database?: typeof Expression | undefined;
|
|
97
|
+
column?: typeof Expression | undefined;
|
|
98
|
+
columnDef?: typeof Expression | undefined;
|
|
99
|
+
schema?: typeof Expression | undefined;
|
|
100
|
+
table?: typeof Expression | undefined;
|
|
101
|
+
warehouse?: typeof Expression | undefined;
|
|
102
|
+
stage?: typeof Expression | undefined;
|
|
103
|
+
streamlit?: typeof Expression | undefined;
|
|
104
|
+
var?: typeof Expression | undefined;
|
|
105
|
+
bitString?: typeof Expression | undefined;
|
|
106
|
+
hexString?: typeof Expression | undefined;
|
|
107
|
+
byteString?: typeof Expression | undefined;
|
|
108
|
+
nationalString?: typeof Expression | undefined;
|
|
109
|
+
rawString?: typeof Expression | undefined;
|
|
110
|
+
heredocString?: typeof Expression | undefined;
|
|
111
|
+
unicodeString?: typeof Expression | undefined;
|
|
112
|
+
bit?: typeof Expression | undefined;
|
|
113
|
+
boolean?: typeof Expression | undefined;
|
|
114
|
+
tinyint?: typeof Expression | undefined;
|
|
115
|
+
utinyint?: typeof Expression | undefined;
|
|
116
|
+
smallint?: typeof Expression | undefined;
|
|
117
|
+
usmallint?: typeof Expression | undefined;
|
|
118
|
+
mediumint?: typeof Expression | undefined;
|
|
119
|
+
umediumint?: typeof Expression | undefined;
|
|
120
|
+
int?: typeof Expression | undefined;
|
|
121
|
+
uint?: typeof Expression | undefined;
|
|
122
|
+
bigint?: typeof Expression | undefined;
|
|
123
|
+
ubigint?: typeof Expression | undefined;
|
|
124
|
+
bignum?: typeof Expression | undefined;
|
|
125
|
+
int128?: typeof Expression | undefined;
|
|
126
|
+
uint128?: typeof Expression | undefined;
|
|
127
|
+
int256?: typeof Expression | undefined;
|
|
128
|
+
uint256?: typeof Expression | undefined;
|
|
129
|
+
float?: typeof Expression | undefined;
|
|
130
|
+
double?: typeof Expression | undefined;
|
|
131
|
+
udouble?: typeof Expression | undefined;
|
|
132
|
+
decimal?: typeof Expression | undefined;
|
|
133
|
+
decimal32?: typeof Expression | undefined;
|
|
134
|
+
decimal64?: typeof Expression | undefined;
|
|
135
|
+
decimal128?: typeof Expression | undefined;
|
|
136
|
+
decimal256?: typeof Expression | undefined;
|
|
137
|
+
decfloat?: typeof Expression | undefined;
|
|
138
|
+
udecimal?: typeof Expression | undefined;
|
|
139
|
+
bigdecimal?: typeof Expression | undefined;
|
|
140
|
+
char?: typeof Expression | undefined;
|
|
141
|
+
nchar?: typeof Expression | undefined;
|
|
142
|
+
varchar?: typeof Expression | undefined;
|
|
143
|
+
nvarchar?: typeof Expression | undefined;
|
|
144
|
+
bpchar?: typeof Expression | undefined;
|
|
145
|
+
text?: typeof Expression | undefined;
|
|
146
|
+
mediumtext?: typeof Expression | undefined;
|
|
147
|
+
longtext?: typeof Expression | undefined;
|
|
148
|
+
blob?: typeof Expression | undefined;
|
|
149
|
+
mediumblob?: typeof Expression | undefined;
|
|
150
|
+
longblob?: typeof Expression | undefined;
|
|
151
|
+
tinyblob?: typeof Expression | undefined;
|
|
152
|
+
tinytext?: typeof Expression | undefined;
|
|
153
|
+
name?: typeof Expression | undefined;
|
|
154
|
+
binary?: typeof Expression | undefined;
|
|
155
|
+
varbinary?: typeof Expression | undefined;
|
|
156
|
+
json?: typeof Expression | undefined;
|
|
157
|
+
jsonb?: typeof Expression | undefined;
|
|
158
|
+
time?: typeof Expression | undefined;
|
|
159
|
+
timetz?: typeof Expression | undefined;
|
|
160
|
+
timeNs?: typeof Expression | undefined;
|
|
161
|
+
timestamp?: typeof Expression | undefined;
|
|
162
|
+
timestamptz?: typeof Expression | undefined;
|
|
163
|
+
timestampltz?: typeof Expression | undefined;
|
|
164
|
+
timestampntz?: typeof Expression | undefined;
|
|
165
|
+
timestampS?: typeof Expression | undefined;
|
|
166
|
+
timestampMs?: typeof Expression | undefined;
|
|
167
|
+
timestampNs?: typeof Expression | undefined;
|
|
168
|
+
datetime?: typeof Expression | undefined;
|
|
169
|
+
datetime2?: typeof Expression | undefined;
|
|
170
|
+
datetime64?: typeof Expression | undefined;
|
|
171
|
+
smalldatetime?: typeof Expression | undefined;
|
|
172
|
+
date?: typeof Expression | undefined;
|
|
173
|
+
date32?: typeof Expression | undefined;
|
|
174
|
+
int4range?: typeof Expression | undefined;
|
|
175
|
+
int4multirange?: typeof Expression | undefined;
|
|
176
|
+
int8range?: typeof Expression | undefined;
|
|
177
|
+
int8multirange?: typeof Expression | undefined;
|
|
178
|
+
numrange?: typeof Expression | undefined;
|
|
179
|
+
nummultirange?: typeof Expression | undefined;
|
|
180
|
+
tsrange?: typeof Expression | undefined;
|
|
181
|
+
tsmultirange?: typeof Expression | undefined;
|
|
182
|
+
tstzrange?: typeof Expression | undefined;
|
|
183
|
+
tstzmultirange?: typeof Expression | undefined;
|
|
184
|
+
daterange?: typeof Expression | undefined;
|
|
185
|
+
datemultirange?: typeof Expression | undefined;
|
|
186
|
+
uuid?: typeof Expression | undefined;
|
|
187
|
+
geography?: typeof Expression | undefined;
|
|
188
|
+
geographypoint?: typeof Expression | undefined;
|
|
189
|
+
nullable?: typeof Expression | undefined;
|
|
190
|
+
geometry?: typeof Expression | undefined;
|
|
191
|
+
point?: typeof Expression | undefined;
|
|
192
|
+
ring?: typeof Expression | undefined;
|
|
193
|
+
linestring?: typeof Expression | undefined;
|
|
194
|
+
localtime?: typeof Expression | undefined;
|
|
195
|
+
localtimestamp?: typeof Expression | undefined;
|
|
196
|
+
systimestamp?: typeof Expression | undefined;
|
|
197
|
+
multilinestring?: typeof Expression | undefined;
|
|
198
|
+
polygon?: typeof Expression | undefined;
|
|
199
|
+
multipolygon?: typeof Expression | undefined;
|
|
200
|
+
hllsketch?: typeof Expression | undefined;
|
|
201
|
+
hstore?: typeof Expression | undefined;
|
|
202
|
+
super?: typeof Expression | undefined;
|
|
203
|
+
serial?: typeof Expression | undefined;
|
|
204
|
+
smallserial?: typeof Expression | undefined;
|
|
205
|
+
bigserial?: typeof Expression | undefined;
|
|
206
|
+
xml?: typeof Expression | undefined;
|
|
207
|
+
year?: typeof Expression | undefined;
|
|
208
|
+
userdefined?: typeof Expression | undefined;
|
|
209
|
+
money?: typeof Expression | undefined;
|
|
210
|
+
smallmoney?: typeof Expression | undefined;
|
|
211
|
+
rowversion?: typeof Expression | undefined;
|
|
212
|
+
image?: typeof Expression | undefined;
|
|
213
|
+
variant?: typeof Expression | undefined;
|
|
214
|
+
object?: typeof Expression | undefined;
|
|
215
|
+
inet?: typeof Expression | undefined;
|
|
216
|
+
ipaddress?: typeof Expression | undefined;
|
|
217
|
+
ipprefix?: typeof Expression | undefined;
|
|
218
|
+
ipv4?: typeof Expression | undefined;
|
|
219
|
+
ipv6?: typeof Expression | undefined;
|
|
220
|
+
enum?: typeof Expression | undefined;
|
|
221
|
+
enum8?: typeof Expression | undefined;
|
|
222
|
+
enum16?: typeof Expression | undefined;
|
|
223
|
+
fixedstring?: typeof Expression | undefined;
|
|
224
|
+
lowcardinality?: typeof Expression | undefined;
|
|
225
|
+
nested?: typeof Expression | undefined;
|
|
226
|
+
aggregatefunction?: typeof Expression | undefined;
|
|
227
|
+
simpleaggregatefunction?: typeof Expression | undefined;
|
|
228
|
+
tdigest?: typeof Expression | undefined;
|
|
229
|
+
unknown?: typeof Expression | undefined;
|
|
230
|
+
vector?: typeof Expression | undefined;
|
|
231
|
+
dynamic?: typeof Expression | undefined;
|
|
232
|
+
void?: typeof Expression | undefined;
|
|
233
|
+
alias?: typeof Expression | undefined;
|
|
234
|
+
alter?: typeof Expression | undefined;
|
|
235
|
+
all?: typeof Expression | undefined;
|
|
236
|
+
anti?: typeof Expression | undefined;
|
|
237
|
+
any?: typeof Expression | undefined;
|
|
238
|
+
apply?: typeof Expression | undefined;
|
|
239
|
+
array?: typeof Expression | undefined;
|
|
240
|
+
asc?: typeof Expression | undefined;
|
|
241
|
+
asof?: typeof Expression | undefined;
|
|
242
|
+
attach?: typeof Expression | undefined;
|
|
243
|
+
autoIncrement?: typeof Expression | undefined;
|
|
244
|
+
begin?: typeof Expression | undefined;
|
|
245
|
+
between?: typeof Expression | undefined;
|
|
246
|
+
bulkCollectInto?: typeof Expression | undefined;
|
|
247
|
+
cache?: typeof Expression | undefined;
|
|
248
|
+
case?: typeof Expression | undefined;
|
|
249
|
+
characterSet?: typeof Expression | undefined;
|
|
250
|
+
clusterBy?: typeof Expression | undefined;
|
|
251
|
+
collate?: typeof Expression | undefined;
|
|
252
|
+
command?: typeof Expression | undefined;
|
|
253
|
+
comment?: typeof Expression | undefined;
|
|
254
|
+
commit?: typeof Expression | undefined;
|
|
255
|
+
connectBy?: typeof Expression | undefined;
|
|
256
|
+
constraint?: typeof Expression | undefined;
|
|
257
|
+
copy?: typeof Expression | undefined;
|
|
258
|
+
create?: typeof Expression | undefined;
|
|
259
|
+
cross?: typeof Expression | undefined;
|
|
260
|
+
cube?: typeof Expression | undefined;
|
|
261
|
+
currentDate?: typeof Expression | undefined;
|
|
262
|
+
currentDatetime?: typeof Expression | undefined;
|
|
263
|
+
currentSchema?: typeof Expression | undefined;
|
|
264
|
+
currentTime?: typeof Expression | undefined;
|
|
265
|
+
currentTimestamp?: typeof Expression | undefined;
|
|
266
|
+
currentUser?: typeof Expression | undefined;
|
|
267
|
+
currentRole?: typeof Expression | undefined;
|
|
268
|
+
currentCatalog?: typeof Expression | undefined;
|
|
269
|
+
declare?: typeof Expression | undefined;
|
|
270
|
+
default?: typeof Expression | undefined;
|
|
271
|
+
delete?: typeof Expression | undefined;
|
|
272
|
+
desc?: typeof Expression | undefined;
|
|
273
|
+
describe?: typeof Expression | undefined;
|
|
274
|
+
detach?: typeof Expression | undefined;
|
|
275
|
+
dictionary?: typeof Expression | undefined;
|
|
276
|
+
distinct?: typeof Expression | undefined;
|
|
277
|
+
distributeBy?: typeof Expression | undefined;
|
|
278
|
+
div?: typeof Expression | undefined;
|
|
279
|
+
drop?: typeof Expression | undefined;
|
|
280
|
+
else?: typeof Expression | undefined;
|
|
281
|
+
end?: typeof Expression | undefined;
|
|
282
|
+
escape?: typeof Expression | undefined;
|
|
283
|
+
except?: typeof Expression | undefined;
|
|
284
|
+
execute?: typeof Expression | undefined;
|
|
285
|
+
exists?: typeof Expression | undefined;
|
|
286
|
+
false?: typeof Expression | undefined;
|
|
287
|
+
fetch?: typeof Expression | undefined;
|
|
288
|
+
file?: typeof Expression | undefined;
|
|
289
|
+
fileFormat?: typeof Expression | undefined;
|
|
290
|
+
filter?: typeof Expression | undefined;
|
|
291
|
+
final?: typeof Expression | undefined;
|
|
292
|
+
first?: typeof Expression | undefined;
|
|
293
|
+
for?: typeof Expression | undefined;
|
|
294
|
+
force?: typeof Expression | undefined;
|
|
295
|
+
foreignKey?: typeof Expression | undefined;
|
|
296
|
+
format?: typeof Expression | undefined;
|
|
297
|
+
from?: typeof Expression | undefined;
|
|
298
|
+
full?: typeof Expression | undefined;
|
|
299
|
+
function?: typeof Expression | undefined;
|
|
300
|
+
get?: typeof Expression | undefined;
|
|
301
|
+
glob?: typeof Expression | undefined;
|
|
302
|
+
global?: typeof Expression | undefined;
|
|
303
|
+
grant?: typeof Expression | undefined;
|
|
304
|
+
groupBy?: typeof Expression | undefined;
|
|
305
|
+
groupingSets?: typeof Expression | undefined;
|
|
306
|
+
having?: typeof Expression | undefined;
|
|
307
|
+
hint?: typeof Expression | undefined;
|
|
308
|
+
ignore?: typeof Expression | undefined;
|
|
309
|
+
ilike?: typeof Expression | undefined;
|
|
310
|
+
in?: typeof Expression | undefined;
|
|
311
|
+
index?: typeof Expression | undefined;
|
|
312
|
+
indexedBy?: typeof Expression | undefined;
|
|
313
|
+
inner?: typeof Expression | undefined;
|
|
314
|
+
insert?: typeof Expression | undefined;
|
|
315
|
+
install?: typeof Expression | undefined;
|
|
316
|
+
intersect?: typeof Expression | undefined;
|
|
317
|
+
interval?: typeof Expression | undefined;
|
|
318
|
+
into?: typeof Expression | undefined;
|
|
319
|
+
introducer?: typeof Expression | undefined;
|
|
320
|
+
irlike?: typeof Expression | undefined;
|
|
321
|
+
is?: typeof Expression | undefined;
|
|
322
|
+
isnull?: typeof Expression | undefined;
|
|
323
|
+
join?: typeof Expression | undefined;
|
|
324
|
+
joinMarker?: typeof Expression | undefined;
|
|
325
|
+
keep?: typeof Expression | undefined;
|
|
326
|
+
key?: typeof Expression | undefined;
|
|
327
|
+
kill?: typeof Expression | undefined;
|
|
328
|
+
language?: typeof Expression | undefined;
|
|
329
|
+
lateral?: typeof Expression | undefined;
|
|
330
|
+
left?: typeof Expression | undefined;
|
|
331
|
+
like?: typeof Expression | undefined;
|
|
332
|
+
limit?: typeof Expression | undefined;
|
|
333
|
+
list?: typeof Expression | undefined;
|
|
334
|
+
load?: typeof Expression | undefined;
|
|
335
|
+
lock?: typeof Expression | undefined;
|
|
336
|
+
map?: typeof Expression | undefined;
|
|
337
|
+
match?: typeof Expression | undefined;
|
|
338
|
+
matchCondition?: typeof Expression | undefined;
|
|
339
|
+
matchRecognize?: typeof Expression | undefined;
|
|
340
|
+
memberOf?: typeof Expression | undefined;
|
|
341
|
+
merge?: typeof Expression | undefined;
|
|
342
|
+
mod?: typeof Expression | undefined;
|
|
343
|
+
model?: typeof Expression | undefined;
|
|
344
|
+
natural?: typeof Expression | undefined;
|
|
345
|
+
next?: typeof Expression | undefined;
|
|
346
|
+
nothing?: typeof Expression | undefined;
|
|
347
|
+
notnull?: typeof Expression | undefined;
|
|
348
|
+
null?: typeof Expression | undefined;
|
|
349
|
+
objectIdentifier?: typeof Expression | undefined;
|
|
350
|
+
offset?: typeof Expression | undefined;
|
|
351
|
+
on?: typeof Expression | undefined;
|
|
352
|
+
only?: typeof Expression | undefined;
|
|
353
|
+
operator?: typeof Expression | undefined;
|
|
354
|
+
orderBy?: typeof Expression | undefined;
|
|
355
|
+
orderSiblingsBy?: typeof Expression | undefined;
|
|
356
|
+
ordered?: typeof Expression | undefined;
|
|
357
|
+
ordinality?: typeof Expression | undefined;
|
|
358
|
+
out?: typeof Expression | undefined;
|
|
359
|
+
inout?: typeof Expression | undefined;
|
|
360
|
+
outer?: typeof Expression | undefined;
|
|
361
|
+
over?: typeof Expression | undefined;
|
|
362
|
+
overlaps?: typeof Expression | undefined;
|
|
363
|
+
overwrite?: typeof Expression | undefined;
|
|
364
|
+
partition?: typeof Expression | undefined;
|
|
365
|
+
partitionBy?: typeof Expression | undefined;
|
|
366
|
+
percent?: typeof Expression | undefined;
|
|
367
|
+
pivot?: typeof Expression | undefined;
|
|
368
|
+
placeholder?: typeof Expression | undefined;
|
|
369
|
+
positional?: typeof Expression | undefined;
|
|
370
|
+
pragma?: typeof Expression | undefined;
|
|
371
|
+
prewhere?: typeof Expression | undefined;
|
|
372
|
+
primaryKey?: typeof Expression | undefined;
|
|
373
|
+
procedure?: typeof Expression | undefined;
|
|
374
|
+
properties?: typeof Expression | undefined;
|
|
375
|
+
pseudoType?: typeof Expression | undefined;
|
|
376
|
+
put?: typeof Expression | undefined;
|
|
377
|
+
qualify?: typeof Expression | undefined;
|
|
378
|
+
quote?: typeof Expression | undefined;
|
|
379
|
+
qdcolon?: typeof Expression | undefined;
|
|
380
|
+
range?: typeof Expression | undefined;
|
|
381
|
+
recursive?: typeof Expression | undefined;
|
|
382
|
+
refresh?: typeof Expression | undefined;
|
|
383
|
+
rename?: typeof Expression | undefined;
|
|
384
|
+
replace?: typeof Expression | undefined;
|
|
385
|
+
returning?: typeof Expression | undefined;
|
|
386
|
+
revoke?: typeof Expression | undefined;
|
|
387
|
+
references?: typeof Expression | undefined;
|
|
388
|
+
right?: typeof Expression | undefined;
|
|
389
|
+
rlike?: typeof Expression | undefined;
|
|
390
|
+
rollback?: typeof Expression | undefined;
|
|
391
|
+
rollup?: typeof Expression | undefined;
|
|
392
|
+
row?: typeof Expression | undefined;
|
|
393
|
+
rows?: typeof Expression | undefined;
|
|
394
|
+
select?: typeof Expression | undefined;
|
|
395
|
+
semi?: typeof Expression | undefined;
|
|
396
|
+
separator?: typeof Expression | undefined;
|
|
397
|
+
sequence?: typeof Expression | undefined;
|
|
398
|
+
serdeProperties?: typeof Expression | undefined;
|
|
399
|
+
set?: typeof Expression | undefined;
|
|
400
|
+
settings?: typeof Expression | undefined;
|
|
401
|
+
show?: typeof Expression | undefined;
|
|
402
|
+
similarTo?: typeof Expression | undefined;
|
|
403
|
+
some?: typeof Expression | undefined;
|
|
404
|
+
sortBy?: typeof Expression | undefined;
|
|
405
|
+
soundsLike?: typeof Expression | undefined;
|
|
406
|
+
startWith?: typeof Expression | undefined;
|
|
407
|
+
storageIntegration?: typeof Expression | undefined;
|
|
408
|
+
straightJoin?: typeof Expression | undefined;
|
|
409
|
+
struct?: typeof Expression | undefined;
|
|
410
|
+
summarize?: typeof Expression | undefined;
|
|
411
|
+
tableSample?: typeof Expression | undefined;
|
|
412
|
+
tag?: typeof Expression | undefined;
|
|
413
|
+
temporary?: typeof Expression | undefined;
|
|
414
|
+
top?: typeof Expression | undefined;
|
|
415
|
+
then?: typeof Expression | undefined;
|
|
416
|
+
true?: typeof Expression | undefined;
|
|
417
|
+
truncate?: typeof Expression | undefined;
|
|
418
|
+
uncache?: typeof Expression | undefined;
|
|
419
|
+
union?: typeof Expression | undefined;
|
|
420
|
+
unnest?: typeof Expression | undefined;
|
|
421
|
+
unpivot?: typeof Expression | undefined;
|
|
422
|
+
update?: typeof Expression | undefined;
|
|
423
|
+
use?: typeof Expression | undefined;
|
|
424
|
+
using?: typeof Expression | undefined;
|
|
425
|
+
values?: typeof Expression | undefined;
|
|
426
|
+
variadic?: typeof Expression | undefined;
|
|
427
|
+
view?: typeof Expression | undefined;
|
|
428
|
+
semanticView?: typeof Expression | undefined;
|
|
429
|
+
volatile?: typeof Expression | undefined;
|
|
430
|
+
when?: typeof Expression | undefined;
|
|
431
|
+
where?: typeof Expression | undefined;
|
|
432
|
+
window?: typeof Expression | undefined;
|
|
433
|
+
with?: typeof Expression | undefined;
|
|
434
|
+
unique?: typeof Expression | undefined;
|
|
435
|
+
utcDate?: typeof Expression | undefined;
|
|
436
|
+
utcTime?: typeof Expression | undefined;
|
|
437
|
+
utcTimestamp?: typeof Expression | undefined;
|
|
438
|
+
versionSnapshot?: typeof Expression | undefined;
|
|
439
|
+
timestampSnapshot?: typeof Expression | undefined;
|
|
440
|
+
option?: typeof Expression | undefined;
|
|
441
|
+
sink?: typeof Expression | undefined;
|
|
442
|
+
source?: typeof Expression | undefined;
|
|
443
|
+
analyze?: typeof Expression | undefined;
|
|
444
|
+
namespace?: typeof Expression | undefined;
|
|
445
|
+
export?: typeof Expression | undefined;
|
|
446
|
+
hiveTokenStream?: typeof Expression | undefined;
|
|
447
|
+
};
|
|
448
|
+
static get CONJUNCTION(): Partial<Record<TokenType, typeof Expression>>;
|
|
449
|
+
static get DISJUNCTION(): Partial<Record<TokenType, typeof Expression>>;
|
|
450
|
+
static get TRANSFORM_PARSERS(): Record<string, (this: Parser, query: any) => QueryExpr | undefined>;
|
|
451
|
+
static get FUNCTIONS(): Record<string, (args: Expression[], options: {
|
|
452
|
+
dialect: Dialect;
|
|
453
|
+
}) => Expression>;
|
|
454
|
+
parseEquality(): Expression | undefined;
|
|
455
|
+
parseStatement(): Expression | undefined;
|
|
456
|
+
parseQuery(): QueryExpr | undefined;
|
|
457
|
+
parseSelection(query: QueryExpr, options?: {
|
|
458
|
+
parseMethod?: () => Expression | undefined;
|
|
459
|
+
append?: boolean;
|
|
460
|
+
}): QueryExpr;
|
|
461
|
+
static get TABLE_ALIAS_TOKENS(): Set<TokenType>;
|
|
462
|
+
parseTake(query: QueryExpr): QueryExpr | undefined;
|
|
463
|
+
parseOrdered(parseMethod?: () => Expression | undefined): OrderedExpr | undefined;
|
|
464
|
+
parseOrderBy(query: SelectExpr): QueryExpr;
|
|
465
|
+
parseAggregate(): Expression | undefined;
|
|
466
|
+
parseExpression(): Expression | undefined;
|
|
467
|
+
parseTable(_options?: {
|
|
468
|
+
schema?: boolean;
|
|
469
|
+
joins?: boolean;
|
|
470
|
+
aliasTokens?: Set<TokenType>;
|
|
471
|
+
parseBracket?: boolean;
|
|
472
|
+
isDbReference?: boolean;
|
|
473
|
+
parsePartition?: boolean;
|
|
474
|
+
consumePipe?: boolean;
|
|
475
|
+
}): Expression | undefined;
|
|
476
|
+
parseFrom(options?: {
|
|
477
|
+
joins?: boolean;
|
|
478
|
+
skipFromToken?: boolean;
|
|
479
|
+
}): FromExpr | undefined;
|
|
480
|
+
}
|
|
481
|
+
declare class PRQLGenerator extends Generator {
|
|
482
|
+
static get AFTER_HAVING_MODIFIER_TRANSFORMS(): Map<string, (this: Generator, e: Expression) => string>;
|
|
483
|
+
static SUPPORTS_DECODE_CASE: boolean;
|
|
484
|
+
static readonly SELECT_KINDS: string[];
|
|
485
|
+
static TRY_SUPPORTED: boolean;
|
|
486
|
+
static SUPPORTS_UESCAPE: boolean;
|
|
487
|
+
}
|
|
488
|
+
declare class PRQL extends Dialect {
|
|
489
|
+
static DIALECT_NAME: Dialects;
|
|
490
|
+
static DPIPE_IS_STRING_CONCAT: boolean;
|
|
491
|
+
static Tokenizer: typeof PRQLTokenizer;
|
|
492
|
+
static Parser: typeof PRQLParser;
|
|
493
|
+
static Generator: typeof PRQLGenerator;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export { PRQL, PRQLGenerator };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$d as _,Ce as O,Fb as b,Ic as k,Ke as g,On as V,Re as w,Tm as B,Ue as R,Xq as I,a as S,b as T,c as A,ca as U,d as t,hc as m,jo as N,kn as K,ln as L,lp as q,no as G,op as C,pb as M,r as n,za as u}from"../chunk-KCNOE4DZ.js";function D(d){return d?N("*").from(d,{copy:!1}):void 0}var j,v,J,H,Y,l,E=class extends(Y=I,H=[n],J=[n],v=[n],j=[n],Y){static get IDENTIFIERS(){return["`"]}static get QUOTES(){return["'",'"']}static get SINGLE_TOKENS(){return{...I.SINGLE_TOKENS,"=":"alias","'":"quote",'"':"quote","`":"identifier","#":"comment"}}static get ORIGINAL_KEYWORDS(){return{...I.KEYWORDS}}};l=S(Y),t(l,10,"IDENTIFIERS",H,E),t(l,10,"QUOTES",J,E),t(l,10,"SINGLE_TOKENS",v,E),t(l,10,"ORIGINAL_KEYWORDS",j,E),T(l,E),A(l,3,E);var W,$,X,Z,Q,z,ee,se,c,o=class extends(se=u,ee=[n],z=[n],Q=[n],Z=[n],X=[n],$=[n],W=[n],se){static get ID_VAR_TOKENS(){return new Set([...u.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let e={...u.NO_PAREN_FUNCTIONS};return delete e.localtime,delete e.localtimestamp,e}static get CONJUNCTION(){return{...u.CONJUNCTION,damp:K}}static get DISJUNCTION(){return{...u.DISJUNCTION,dpipe:L}}static get TRANSFORM_PARSERS(){return{DERIVE:function(e){return this.parseSelection(e)},SELECT:function(e){return this.parseSelection(e,{append:!1})},TAKE:function(e){return this.parseTake(e)},FILTER:function(e){return e.where(this.parseDisjunction())},APPEND:function(e){return e.union(D(this.parseTable()),{distinct:!1,copy:!1})},REMOVE:function(e){return e.except(D(this.parseTable()),{distinct:!1,copy:!1})},INTERSECT:function(e){return e.intersect(D(this.parseTable()),{distinct:!1,copy:!1})},SORT:function(e){return this.parseOrderBy(e)},AGGREGATE:function(e){return this.parseSelection(e,{parseMethod:this.parseAggregate,append:!1})}}}static get FUNCTIONS(){return{...u.FUNCTIONS,AVERAGE:e=>B.fromArgList(e),SUM:e=>G("COALESCE",new V({this:U(e,0),expression:0}))}}parseEquality(){let e=this.parseTokens(()=>this.parseComparison(),this._constructor.EQUALITY);if(!(e instanceof O||e instanceof w))return e;if(e.args.expression instanceof _){let s=new g({this:e.args.this,expression:e.args.expression});return e instanceof O?s:new R({this:s})}if(e.args.this instanceof _){let s=new g({this:e.args.expression,expression:e.args.this});return e instanceof O?s:new R({this:s})}return e}parseStatement(){let e=this.parseExpression();return e||this.parseQuery()}parseQuery(){let e=this.parseFrom();if(!e)return;let s=N("*").from(e,{copy:!1});for(;this.matchTexts(Object.keys(this._constructor.TRANSFORM_PARSERS));){let r=this._constructor.TRANSFORM_PARSERS[this.prev?.text.toUpperCase()??""].call(this,s);r&&(s=r)}return s}parseSelection(e,s={}){let{parseMethod:i=()=>this.parseExpression(),append:r=!0}=s,h;if(this.match("lBrace"))h=this.parseCsv(i),this.match("rBrace")||this.raiseError("Expecting }");else{let a=i();h=a?[a]:[]}let y={};e.args.expressions?.forEach(a=>{y[a.aliasOrName]=a instanceof m?a.args.this??a:a});let ne=h.map(a=>a&&a.transform(x=>x instanceof k&&y[x.name]?y[x.name].copy():x,{copy:!1}));return N(...ne,{append:r,copy:!1})}static get TABLE_ALIAS_TOKENS(){return new Set([...u.TABLE_ALIAS_TOKENS,"straightJoin"])}parseTake(e){let s=this.parseNumber();return s?e.limit(s):void 0}parseOrdered(e){let s=this.match("plus"),i=this.match("dash")||s&&!1,r=super.parseOrdered(e);return r&&i&&(r.setArgKey("desc",!0),r.setArgKey("nullsFirst",!1)),r}parseOrderBy(e){let s=this.match("lBrace"),i=this.parseCsv(()=>this.parseOrdered());return s&&!this.match("rBrace")&&this.raiseError("Expecting }"),e.orderBy(new b({expressions:i.filter(Boolean)}),{copy:!1})}parseAggregate(){let e;this.next&&this.next.tokenType==="alias"&&(e=this.parseIdVar({anyToken:!0})?.name,this.match("alias"));let s=this.curr?.text.toUpperCase()??"",i=this._constructor.FUNCTIONS[s],r;if(i){this.advance();let h=this.parseColumn();r=i(h?[h]:[],{dialect:this.dialect})}else{this.raiseError(`Unsupported aggregation function ${s}`);return}return e?new m({this:r,alias:e}):r}parseExpression(){if(this.next&&this.next.tokenType==="alias"){let e=this.parseIdVar({anyToken:!0})?.name;this.match("alias");let s=this.parseAssignment();return s?new m({this:s,alias:e}):void 0}return this.parseAssignment()}parseTable(e={}){return this.parseTableParts()}parseFrom(e={}){let{joins:s=!1,skipFromToken:i=!1}=e;if(!(!i&&!this.match("from")))return this.expression(M,{comments:this.prevComments,this:this.parseTable({joins:s})})}};c=S(se),t(c,10,"ID_VAR_TOKENS",ee,o),t(c,10,"NO_PAREN_FUNCTIONS",z,o),t(c,10,"CONJUNCTION",Q,o),t(c,10,"DISJUNCTION",Z,o),t(c,10,"TRANSFORM_PARSERS",X,o),t(c,10,"FUNCTIONS",$,o),t(c,10,"TABLE_ALIAS_TOKENS",W,o),T(c,o),A(c,3,o);var re,te,F,p=class extends(te=q,re=[n],te){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let e=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(s=>e.delete(s)),e}};F=S(te),t(F,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",re,p),T(F,p),A(F,3,p),p.SUPPORTS_DECODE_CASE=!1,p.SELECT_KINDS=[],p.TRY_SUPPORTED=!1,p.SUPPORTS_UESCAPE=!1;var f=class extends C{};f.DIALECT_NAME="prql",f.DPIPE_IS_STRING_CONCAT=!1,f.Tokenizer=E,f.Parser=o,f.Generator=p;C.register("prql",f);export{f as PRQL,p as PRQLGenerator};
|
|
2
|
+
//# sourceMappingURL=prql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/dialects/prql.ts"],"sourcesContent":["import {\n cache,\n} from '../port_internals';\nimport type {\n Expression, OrderedExpr, QueryExpr, SelectExpr,\n} from '../expressions';\nimport {\n AliasExpr,\n AndExpr, AvgExpr, ColumnExpr, EqExpr, FromExpr, func, IsExpr, NeqExpr, NotExpr, NullExpr, OrderExpr, OrExpr, select, SumExpr,\n} from '../expressions';\nimport {\n seqGet,\n} from '../helper';\nimport {\n Parser,\n} from '../parser';\nimport {\n Tokenizer, TokenType,\n} from '../tokens';\nimport {\n Generator,\n} from '../generator';\nimport {\n Dialect, Dialects,\n} from './dialect';\n\nfunction selectAll (table: Expression | undefined): SelectExpr | undefined {\n return table\n ? select('*').from(table, {\n copy: false,\n })\n : undefined;\n}\n\nclass PRQLTokenizer extends Tokenizer {\n @cache\n static get IDENTIFIERS () {\n return [\n '`',\n ];\n }\n\n @cache\n static get QUOTES () {\n return [\n '\\'',\n '\"',\n ];\n }\n\n @cache\n static get SINGLE_TOKENS () {\n return {\n ...Tokenizer.SINGLE_TOKENS,\n '=': TokenType.ALIAS,\n '\\'': TokenType.QUOTE,\n '\"': TokenType.QUOTE,\n '`': TokenType.IDENTIFIER,\n '#': TokenType.COMMENT,\n };\n }\n\n @cache\n static get ORIGINAL_KEYWORDS () {\n return {\n ...Tokenizer.KEYWORDS,\n };\n }\n}\n\nclass PRQLParser 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 @cache\n static get CONJUNCTION (): Partial<Record<TokenType, typeof Expression>> {\n return {\n ...Parser.CONJUNCTION,\n [TokenType.DAMP]: AndExpr,\n };\n }\n\n @cache\n static get DISJUNCTION (): Partial<Record<TokenType, typeof Expression>> {\n return {\n ...Parser.DISJUNCTION,\n [TokenType.DPIPE]: OrExpr,\n };\n }\n\n @cache\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static get TRANSFORM_PARSERS (): Record<string, (this: Parser, query: any) => QueryExpr | undefined> {\n return {\n DERIVE: function (this: Parser, query) {\n return (this as PRQLParser).parseSelection(query);\n },\n SELECT: function (this: Parser, query) {\n return (this as PRQLParser).parseSelection(query, {\n append: false,\n });\n },\n TAKE: function (this: Parser, query) {\n return (this as PRQLParser).parseTake(query);\n },\n FILTER: function (this: Parser, query) {\n return query.where((this as PRQLParser).parseDisjunction());\n },\n APPEND: function (this: Parser, query) {\n return query.union(selectAll((this as PRQLParser).parseTable()), {\n distinct: false,\n copy: false,\n });\n },\n REMOVE: function (this: Parser, query) {\n return query.except(selectAll((this as PRQLParser).parseTable()), {\n distinct: false,\n copy: false,\n });\n },\n INTERSECT: function (this: Parser, query) {\n return query.intersect(selectAll((this as PRQLParser).parseTable()), {\n distinct: false,\n copy: false,\n });\n },\n SORT: function (this: Parser, query) {\n return (this as PRQLParser).parseOrderBy(query);\n },\n AGGREGATE: function (this: Parser, query) {\n return (this as PRQLParser).parseSelection(query, {\n parseMethod: (this as PRQLParser).parseAggregate,\n append: false,\n });\n },\n };\n }\n\n @cache\n static get FUNCTIONS (): Record<string, (args: Expression[], options: {dialect: Dialect}) => Expression> {\n return {\n ...Parser.FUNCTIONS,\n AVERAGE: (args: unknown[]) => AvgExpr.fromArgList(args),\n SUM: (args: Expression[]) => func('COALESCE', new SumExpr({\n this: seqGet(args, 0),\n expression: 0,\n })),\n };\n }\n\n parseEquality (): Expression | undefined {\n const eq = this.parseTokens(() => this.parseComparison(), (this._constructor as typeof PRQLParser).EQUALITY);\n if (!(eq instanceof EqExpr || eq instanceof NeqExpr)) {\n return eq;\n }\n\n if (eq.args.expression instanceof NullExpr) {\n const isExp = new IsExpr({\n this: eq.args.this,\n expression: eq.args.expression,\n });\n return eq instanceof EqExpr\n ? isExp\n : new NotExpr({\n this: isExp,\n });\n }\n if (eq.args.this instanceof NullExpr) {\n const isExp = new IsExpr({\n this: eq.args.expression,\n expression: eq.args.this,\n });\n return eq instanceof EqExpr\n ? isExp\n : new NotExpr({\n this: isExp,\n });\n }\n return eq;\n }\n\n parseStatement (): Expression | undefined {\n const expression = this.parseExpression();\n return expression ? expression : this.parseQuery();\n }\n\n parseQuery (): QueryExpr | undefined {\n const from = this.parseFrom();\n\n if (!from) {\n return undefined;\n }\n\n let query: QueryExpr = select('*').from(from, {\n copy: false,\n });\n\n while (this.matchTexts(Object.keys((this._constructor as typeof PRQLParser).TRANSFORM_PARSERS))) {\n const transform = (this._constructor as typeof PRQLParser).TRANSFORM_PARSERS[this.prev?.text.toUpperCase() ?? ''];\n const result = transform.call(this, query);\n if (result) {\n query = result;\n }\n }\n\n return query;\n }\n\n parseSelection (\n query: QueryExpr,\n options: {\n parseMethod?: () => Expression | undefined;\n append?: boolean;\n } = {},\n ): QueryExpr {\n const {\n parseMethod = () => this.parseExpression(), append = true,\n } = options;\n let selects: (Expression | undefined)[];\n\n if (this.match(TokenType.L_BRACE)) {\n selects = this.parseCsv(parseMethod);\n\n if (!this.match(TokenType.R_BRACE)) {\n this.raiseError('Expecting }');\n }\n } else {\n const expression = parseMethod();\n selects = expression\n ? [\n expression,\n ]\n : [\n ];\n }\n\n const projections: Record<string, Expression> = {};\n (query as SelectExpr).args.expressions?.forEach((select) => {\n projections[select.aliasOrName] = select instanceof AliasExpr ? (select.args.this ?? select) : select;\n });\n\n const transformedSelects = selects.map((select) => {\n if (!select) return select;\n return select.transform((s) => {\n if (s instanceof ColumnExpr && projections[s.name]) {\n return projections[s.name].copy();\n }\n return s;\n }, {\n copy: false,\n });\n }) as Expression[];\n\n return select(...transformedSelects, {\n append,\n copy: false,\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\n parseTake (query: QueryExpr): QueryExpr | undefined {\n const num = this.parseNumber();\n return num ? query.limit(num) : undefined;\n }\n\n parseOrdered (parseMethod?: () => Expression | undefined): OrderedExpr | undefined {\n const asc = this.match(TokenType.PLUS);\n const desc = this.match(TokenType.DASH) || (asc && false);\n const term = super.parseOrdered(parseMethod);\n if (term && desc) {\n term.setArgKey('desc', true);\n term.setArgKey('nullsFirst', false);\n }\n return term;\n }\n\n parseOrderBy (query: SelectExpr): QueryExpr {\n const lBrace = this.match(TokenType.L_BRACE);\n const expressions = this.parseCsv(() => this.parseOrdered());\n if (lBrace && !this.match(TokenType.R_BRACE)) {\n this.raiseError('Expecting }');\n }\n return query.orderBy(new OrderExpr({\n expressions: expressions.filter(Boolean),\n }), {\n copy: false,\n });\n }\n\n parseAggregate (): Expression | undefined {\n let alias: string | undefined = undefined;\n if (this.next && this.next.tokenType === TokenType.ALIAS) {\n alias = this.parseIdVar({\n anyToken: true,\n })?.name;\n this.match(TokenType.ALIAS);\n }\n\n const name = this.curr?.text.toUpperCase() ?? '';\n const funcBuilder = this._constructor.FUNCTIONS[name];\n let func: Expression;\n\n if (funcBuilder) {\n this.advance();\n const args = this.parseColumn();\n func = funcBuilder(args\n ? [\n args,\n ]\n : [\n ], {\n dialect: this.dialect,\n });\n } else {\n this.raiseError(`Unsupported aggregation function ${name}`);\n return undefined;\n }\n\n if (alias) {\n return new AliasExpr({\n this: func,\n alias,\n });\n }\n return func;\n }\n\n parseExpression (): Expression | undefined {\n if (this.next && this.next.tokenType === TokenType.ALIAS) {\n const alias = this.parseIdVar({\n anyToken: true,\n })?.name;\n this.match(TokenType.ALIAS);\n const parsedExpr = this.parseAssignment();\n if (!parsedExpr) return undefined;\n return new AliasExpr({\n this: parsedExpr,\n alias,\n });\n }\n return this.parseAssignment();\n }\n\n parseTable (_options: {\n schema?: boolean;\n joins?: boolean;\n aliasTokens?: Set<TokenType>;\n parseBracket?: boolean;\n isDbReference?: boolean;\n parsePartition?: boolean;\n consumePipe?: boolean;\n } = {}): Expression | undefined {\n return this.parseTableParts();\n }\n\n parseFrom (options: {\n joins?: boolean;\n skipFromToken?: boolean;\n } = {}): FromExpr | undefined {\n const {\n joins = false, skipFromToken = false,\n } = options;\n if (!skipFromToken && !this.match(TokenType.FROM)) {\n return undefined;\n }\n\n return this.expression(FromExpr, {\n comments: this.prevComments,\n this: this.parseTable({\n joins,\n }),\n });\n }\n};\n\nexport class PRQLGenerator 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}\n\nexport class PRQL extends Dialect {\n static DIALECT_NAME = Dialects.PRQL;\n static DPIPE_IS_STRING_CONCAT = false;\n\n static Tokenizer = PRQLTokenizer;\n\n static Parser = PRQLParser;\n\n static Generator = PRQLGenerator;\n}\n\nDialect.register(Dialects.PRQL, PRQL);\n"],"mappings":"qOA0BA,SAASA,EAAWC,EAAuD,CACzE,OAAOA,EACHC,EAAO,GAAG,EAAE,KAAKD,EAAO,CACxB,KAAM,EACR,CAAC,EACC,MACN,CAhCA,IAAAE,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAkCMC,EAAN,cAA4BF,EAAAG,EAC1BJ,EAAA,CAACK,GAODN,EAAA,CAACM,GAQDP,EAAA,CAACO,GAYDR,EAAA,CAACQ,GA5ByBJ,EAAU,CAEpC,WAAW,aAAe,CACxB,MAAO,CACL,GACF,CACF,CAGA,WAAW,QAAU,CACnB,MAAO,CACL,IACA,GACF,CACF,CAGA,WAAW,eAAiB,CAC1B,MAAO,CACL,GAAGG,EAAU,cACb,YACA,Y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AAoC,CAC7C,IAAMgE,EAAY,IAAI,IAAI,MAAM,gCAAgC,EAChE,OACE,UACA,aACA,MACF,EAAE,QAASC,GAAMD,EAAU,OAAOC,CAAC,CAAC,EAC7BD,CACT,CAWF,EAtBO/D,EAAAI,EAAAL,IAGLM,EAAAL,EAAA,GAAW,mCADX4D,GAFWC,GAANvD,EAAAN,EAAM6D,GAANtD,EAAAP,EAAA,EAAM6D,KAcJ,qBAAuB,GAdnBA,EAgBK,aAAyB,CACzC,EAjBWA,EAmBJ,cAAgB,GAnBZA,EAqBJ,iBAAmB,GAGrB,IAAMI,EAAN,cAAmBC,CAAQ,CASlC,EATaD,EACJ,aAAe,OADXA,EAEJ,uBAAyB,GAFrBA,EAIJ,UAAYhE,EAJRgE,EAMJ,OAASlD,EANLkD,EAQJ,UAAYJ,EAGrBK,EAAQ,gBAAwBD,CAAI","names":["selectAll","table","select","_ORIGINAL_KEYWORDS_dec","_SINGLE_TOKENS_dec","_QUOTES_dec","_IDENTIFIERS_dec","_a","_init","PRQLTokenizer","Tokenizer","cache","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","_TABLE_ALIAS_TOKENS_dec","_FUNCTIONS_dec","_TRANSFORM_PARSERS_dec","_DISJUNCTION_dec","_CONJUNCTION_dec","_NO_PAREN_FUNCTIONS_dec","_ID_VAR_TOKENS_dec","PRQLParser","Parser","noParenFunctions","AndExpr","OrExpr","query","args","AvgExpr","func","SumExpr","seqGet","eq","EqExpr","NeqExpr","NullExpr","isExp","IsExpr","NotExpr","expression","from","result","options","parseMethod","append","selects","projections","AliasExpr","transformedSelects","s","ColumnExpr","num","asc","desc","term","lBrace","expressions","OrderExpr","alias","name","funcBuilder","parsedExpr","_options","joins","skipFromToken","FromExpr","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","PRQLGenerator","Generator","modifiers","m","PRQL","Dialect"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkWRNYJ54Acjs = require('../chunk-WRNYJ54A.cjs');require('../chunk-DOKMTZYO.cjs');var _chunk2Z3O2CFMcjs = require('../chunk-2Z3O2CFM.cjs');var Ut={year:"year",years:"year",yyyy:"year",yy:"year",quarter:"quarter",quarters:"quarter",qq:"quarter",q:"quarter",month:"month",months:"month",mm:"month",m:"month",week:"week",weeks:"week",ww:"week",wk:"week",day:"day",days:"day",dd:"day",d:"day",hour:"hour",hours:"hour",hh:"hour",h:"hour",minute:"minute",minutes:"minute",mi:"minute",second:"second",seconds:"second",ss:"second",s:"second",millisecond:"millisecond",milliseconds:"millisecond",ms:"millisecond",microsecond:"microsecond",microseconds:"microsecond",us:"microsecond",nanosecond:"nanosecond",nanoseconds:"nanosecond",ns:"nanosecond"};function d(A){return l=>{let e=3<=l.length,t=e?l[2]:void 0,r=e?l[0]:void 0;if(r){let _=_optionalChain([r, 'access', _2 => _2.name, 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4()]);_&&Ut[_]&&(r=_chunk2Z3O2CFMcjs.Eo.call(void 0, Ut[_])),r instanceof _chunk2Z3O2CFMcjs.Ub&&(r=new (0, _chunk2Z3O2CFMcjs.Ub)({this:r.name.toUpperCase()}))}let o=new A({this:t,expression:_chunk2Z3O2CFMcjs.ca.call(void 0, l,1),unit:r});return A===_chunk2Z3O2CFMcjs.Nl&&o.setArgKey("returnType",_chunk2Z3O2CFMcjs.ac.build("TIMESTAMP")),o}}var Ft,Yt,qt,wt,bt,N,T=class extends(bt=_chunkWRNYJ54Acjs.b.Parser,wt=[_chunk2Z3O2CFMcjs.r],qt=[_chunk2Z3O2CFMcjs.r],Yt=[_chunk2Z3O2CFMcjs.r],Ft=[_chunk2Z3O2CFMcjs.r],bt){static get ID_VAR_TOKENS(){return new Set([..._chunk2Z3O2CFMcjs.za.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get FUNCTIONS(){return(()=>{let e={..._chunkWRNYJ54Acjs.b.Parser.FUNCTIONS,ADD_MONTHS:(t,r)=>new (0, _chunk2Z3O2CFMcjs.Nl)({this:_chunk2Z3O2CFMcjs.ca.call(void 0, t,0),expression:_chunk2Z3O2CFMcjs.ca.call(void 0, t,1),unit:_chunk2Z3O2CFMcjs.Eo.call(void 0, "MONTH"),returnType:_chunk2Z3O2CFMcjs.ac.build("TIMESTAMP")}),CONVERT_TIMEZONE:t=>_chunk2Z3O2CFMcjs.va.call(void 0, t,{defaultSourceTz:"UTC"}),DATEADD:d(_chunk2Z3O2CFMcjs.Nl),DATE_ADD:d(_chunk2Z3O2CFMcjs.Nl),DATEDIFF:d(_chunk2Z3O2CFMcjs.Ol),DATE_DIFF:d(_chunk2Z3O2CFMcjs.Ol),GETDATE:t=>_chunk2Z3O2CFMcjs.fh.fromArgList(t),LISTAGG:t=>_chunk2Z3O2CFMcjs.in.fromArgList(t),REGEXP_SUBSTR:t=>new (0, _chunk2Z3O2CFMcjs.Ik)({this:_chunk2Z3O2CFMcjs.ca.call(void 0, t,0),expression:_chunk2Z3O2CFMcjs.ca.call(void 0, t,1),position:_chunk2Z3O2CFMcjs.ca.call(void 0, t,2),occurrence:_chunk2Z3O2CFMcjs.ca.call(void 0, t,3),parameters:_chunk2Z3O2CFMcjs.ca.call(void 0, t,4)}),SPLIT_TO_ARRAY:t=>new (0, _chunk2Z3O2CFMcjs.vg)({this:_chunk2Z3O2CFMcjs.ca.call(void 0, t,0),expression:_chunk2Z3O2CFMcjs.ca.call(void 0, t,1)||_chunk2Z3O2CFMcjs.$c.string(",")}),STRTOL:t=>_chunk2Z3O2CFMcjs.Bl.fromArgList(t)};return delete e.GET_BIT,e})()}static get NO_PAREN_FUNCTION_PARSERS(){return{..._chunkWRNYJ54Acjs.b.Parser.NO_PAREN_FUNCTION_PARSERS,APPROXIMATE:function(){return this.parseApproximateCount()},SYSDATE:function(){return this.expression(_chunk2Z3O2CFMcjs.fh,{sysdate:!0})}}}parseTable(e={}){let t=this.match("unpivot"),r=super.parseTable(e);return t?this.expression(_chunk2Z3O2CFMcjs.Yb,{this:r,unpivot:!0}):r}parseConvert(e){let{safe:t}=e,r=this.parseTypes();this.match("comma");let o=this.parseBitwise();return this.expression(_chunk2Z3O2CFMcjs.bn,{this:o,to:r,safe:t})}parseApproximateCount(){let e=this.index-1,t=this.parseFunction();if(t instanceof _chunk2Z3O2CFMcjs.en&&t.args.this instanceof _chunk2Z3O2CFMcjs.nc)return this.expression(_chunk2Z3O2CFMcjs.Lm,{this:_chunk2Z3O2CFMcjs.ca.call(void 0, t.args.this.args.expressions||[],0)});this.retreat(e)}static get TABLE_ALIAS_TOKENS(){return new Set([..._chunkWRNYJ54Acjs.b.Parser.TABLE_ALIAS_TOKENS,"straightJoin"])}};N=_chunk2Z3O2CFMcjs.a.call(void 0, bt),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"ID_VAR_TOKENS",wt,T),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"FUNCTIONS",qt,T),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"NO_PAREN_FUNCTION_PARSERS",Yt,T),_chunk2Z3O2CFMcjs.d.call(void 0, N,10,"TABLE_ALIAS_TOKENS",Ft,T),_chunk2Z3O2CFMcjs.b.call(void 0, N,T),_chunk2Z3O2CFMcjs.c.call(void 0, N,3,T),T.SUPPORTS_IMPLICIT_UNNEST=!0;var Ht,kt,Gt,Vt,Bt,Kt,S,p=class extends(Kt=_chunkWRNYJ54Acjs.b.Tokenizer,Bt=[_chunk2Z3O2CFMcjs.r],Vt=[_chunk2Z3O2CFMcjs.r],Gt=[_chunk2Z3O2CFMcjs.r],kt=[_chunk2Z3O2CFMcjs.r],Ht=[_chunk2Z3O2CFMcjs.r],Kt){static get BIT_STRINGS(){return[]}static get HEX_STRINGS(){return[]}static get STRING_ESCAPES(){return["\\","'"]}static get ORIGINAL_KEYWORDS(){let e={..._chunkWRNYJ54Acjs.b.Tokenizer.KEYWORDS,"(+)":"joinMarker",HLLSKETCH:"hllsketch",MINUS:"except",SUPER:"super",TOP:"top",UNLOAD:"command",VARBYTE:"varbinary","BINARY VARYING":"varbinary"};return delete e.VALUES,e}static get SINGLE_TOKENS(){let e={..._chunkWRNYJ54Acjs.b.Tokenizer.SINGLE_TOKENS};return delete e["#"],e}};S=_chunk2Z3O2CFMcjs.a.call(void 0, Kt),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"BIT_STRINGS",Bt,p),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"HEX_STRINGS",Vt,p),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"STRING_ESCAPES",Gt,p),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"ORIGINAL_KEYWORDS",kt,p),_chunk2Z3O2CFMcjs.d.call(void 0, S,10,"SINGLE_TOKENS",Ht,p),_chunk2Z3O2CFMcjs.b.call(void 0, S,p),_chunk2Z3O2CFMcjs.c.call(void 0, S,3,p);var Xt,$t,vt,Wt,Jt,I,s=class extends(Jt=_chunkWRNYJ54Acjs.b.Generator,Wt=[_chunk2Z3O2CFMcjs.r],vt=[_chunk2Z3O2CFMcjs.r],$t=[_chunk2Z3O2CFMcjs.r],Xt=[_chunk2Z3O2CFMcjs.r],Jt){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 TYPE_MAPPING(){return new Map([..._chunkWRNYJ54Acjs.b.Generator.TYPE_MAPPING,["binary","VARBYTE"],["blob","VARBYTE"],["int","INTEGER"],["timetz","TIME"],["timestamptz","TIMESTAMP"],["varbinary","VARBYTE"],["rowversion","VARBYTE"]])}static get ORIGINAL_TRANSFORMS(){let e=new Map([..._chunkWRNYJ54Acjs.b.Generator.TRANSFORMS,[_chunk2Z3O2CFMcjs.hg,_chunk2Z3O2CFMcjs.Hp.call(void 0, "ARRAY_CONCAT")],[_chunk2Z3O2CFMcjs.Lg,_chunk2Z3O2CFMcjs.dq],[_chunk2Z3O2CFMcjs.dn,_chunk2Z3O2CFMcjs.eq],[_chunk2Z3O2CFMcjs.Lm,function(t){return`APPROXIMATE COUNT(DISTINCT ${this.sql(t,"this")})`}],[_chunk2Z3O2CFMcjs.fh,function(t){return t.args.sysdate?"SYSDATE":"GETDATE()"}],[_chunk2Z3O2CFMcjs.uh,_chunk2Z3O2CFMcjs.sq.call(void 0, "DATEADD")],[_chunk2Z3O2CFMcjs.xh,_chunk2Z3O2CFMcjs.sq.call(void 0, "DATEDIFF")],[_chunk2Z3O2CFMcjs.fd,function(t){return this.func("DISTKEY",[t.args.this])}],[_chunk2Z3O2CFMcjs.gd,function(t){return this.nakedProperty(t)}],[_chunk2Z3O2CFMcjs.yi,function(t){return this.explodeSql(t)}],[_chunk2Z3O2CFMcjs.Ff,_chunk2Z3O2CFMcjs.pp.call(void 0, "FARMFINGERPRINT64")],[_chunk2Z3O2CFMcjs.Bl,_chunk2Z3O2CFMcjs.pp.call(void 0, "STRTOL")],[_chunk2Z3O2CFMcjs.Pc,_chunk2Z3O2CFMcjs.pq],[_chunk2Z3O2CFMcjs.uj,_chunk2Z3O2CFMcjs.Aq.call(void 0, "JSON_EXTRACT_PATH_TEXT")],[_chunk2Z3O2CFMcjs.wj,_chunk2Z3O2CFMcjs.Aq.call(void 0, "JSON_EXTRACT_PATH_TEXT")],[_chunk2Z3O2CFMcjs.in,_chunk2Z3O2CFMcjs.pp.call(void 0, "LISTAGG")],[_chunk2Z3O2CFMcjs.Ri,function(t){return this.func("UPPER",[this.func("TO_HEX",[this.sql(t,"this")])])}],[_chunk2Z3O2CFMcjs.Ik,_chunk2Z3O2CFMcjs.pp.call(void 0, "REGEXP_SUBSTR")],[_chunk2Z3O2CFMcjs.Wd,_chunk2Z3O2CFMcjs.Po.call(void 0, [_chunk2Z3O2CFMcjs.ip,_chunk2Z3O2CFMcjs.So,_chunk2Z3O2CFMcjs.bp,_chunk2Z3O2CFMcjs.Vo,_chunk2Z3O2CFMcjs.Qo])],[_chunk2Z3O2CFMcjs.Hd,function(t){let r=t.args.this,o=r instanceof _chunk2Z3O2CFMcjs.Ca&&(r instanceof _chunk2Z3O2CFMcjs.Vb||r instanceof _chunk2Z3O2CFMcjs.Pb)?this.expressions(r,{flat:!0}):this.sql(r);return`${t.args.compound?"COMPOUND ":""}SORTKEY(${o})`}],[_chunk2Z3O2CFMcjs.rl,function(t){return`${this.sql(t.args.this)} LIKE ${this.sql(t.args.expression)} || '%'`}],[_chunk2Z3O2CFMcjs.vg,_chunk2Z3O2CFMcjs.pp.call(void 0, "SPLIT_TO_ARRAY")],[_chunk2Z3O2CFMcjs.Wb,_chunk2Z3O2CFMcjs.yp],[_chunk2Z3O2CFMcjs.Nl,_chunk2Z3O2CFMcjs.sq.call(void 0, "DATEADD")],[_chunk2Z3O2CFMcjs.Ol,_chunk2Z3O2CFMcjs.sq.call(void 0, "DATEDIFF")],[_chunk2Z3O2CFMcjs.Zl,function(t){return this.unixToTimeSql(t)}],[_chunk2Z3O2CFMcjs.il,function(t){return this.func("SHA2",[t.args.this,t.args.length||_chunk2Z3O2CFMcjs.$c.number(256)])}]]);return e.delete(_chunk2Z3O2CFMcjs.Yb),e.delete(_chunk2Z3O2CFMcjs.Fj),e.delete(_chunk2Z3O2CFMcjs.Um),e.delete(_chunk2Z3O2CFMcjs.Qh),e.delete(_chunk2Z3O2CFMcjs.gl),e.delete(_chunk2Z3O2CFMcjs.Pi),e.delete(_chunk2Z3O2CFMcjs.Uk),e}static get RESERVED_KEYWORDS(){return new Set(["aes128","aes256","all","allowoverwrite","analyse","analyze","and","any","array","as","asc","authorization","az64","backup","between","binary","blanksasnull","both","bytedict","bzip2","case","cast","check","collate","column","constraint","create","credentials","cross","current_date","current_time","current_timestamp","current_user","current_user_id","default","deferrable","deflate","defrag","delta","delta32k","desc","disable","distinct","do","else","emptyasnull","enable","encode","encrypt","encryption","end","except","explicit","false","for","foreign","freeze","from","full","globaldict256","globaldict64k","grant","group","gzip","having","identity","ignore","ilike","in","initially","inner","intersect","interval","into","is","isnull","join","leading","left","like","limit","localtime","localtimestamp","lun","luns","lzo","lzop","minus","mostly16","mostly32","mostly8","natural","new","not","notnull","null","nulls","off","offline","offset","oid","old","on","only","open","or","order","outer","overlaps","parallel","partition","percent","permissions","pivot","placing","primary","raw","readratio","recover","references","rejectlog","resort","respect","restore","right","select","session_user","similar","snapshot","some","sysdate","system","table","tag","tdes","text255","text32k","then","timestamp","to","top","trailing","true","truncatecolumns","type","union","unique","unnest","unpivot","user","using","verbose","wallet","when","where","with","without"])}unnestSql(e){let t=e.args.expressions||[],r=t.length;if(r!==1)return this.unsupported(`Unsupported number of arguments in UNNEST: ${r}`),"";if(e.findAncestor(_chunk2Z3O2CFMcjs.Wd)&&!e.findAncestor(_chunk2Z3O2CFMcjs.pb,_chunk2Z3O2CFMcjs.Bb))return this.unsupported("Unsupported UNNEST when not used in FROM/JOIN clauses"),"";let o=this.sql(_chunk2Z3O2CFMcjs.ca.call(void 0, t,0)),_=this.expressions(e.args.alias,{key:"columns",flat:!0});return _?`${o} AS ${_}`:o}castSql(e,t={}){let{safePrefix:r}=t;return _chunk2Z3O2CFMcjs.Lo.call(void 0, e.args.to,"json")?this.sql(e.args.this):super.castSql(e,{safePrefix:r})}dataTypeSql(e){if(e.isType("text")){e.setArgKey("this","varchar");let t=e.args.expressions;(!t||t.length===0)&&e.append("expressions",_chunk2Z3O2CFMcjs.Eo.call(void 0, "MAX"))}return super.dataTypeSql(e)}alterSetSql(e){let t=this.expressions(e,{flat:!0});t=t?` TABLE PROPERTIES (${t})`:"";let r=this.sql(e,"location");r=r?` LOCATION ${r}`:"";let o=this.expressions(e,{key:"fileFormat",flat:!0,sep:" "});return o=o?` FILE FORMAT ${o}`:"",`SET${t}${r}${o}`}arraySql(e){return e.args.bracketNotation?super.arraySql(e):_chunk2Z3O2CFMcjs.pp.call(void 0, "ARRAY").call(this,e)}explodeSql(e){return this.unsupported("Unsupported EXPLODE() function"),""}unixToTimeSql(e){let t=e.args.scale,r=this.sql(e.args.this);return t!==void 0&&t!==_chunk2Z3O2CFMcjs.Zl.SECONDS&&t.isNumber&&(r=`(${r} / POWER(10, ${t.args.this}))`),`(TIMESTAMP 'epoch' + ${r} * INTERVAL '1 SECOND')`}};I=_chunk2Z3O2CFMcjs.a.call(void 0, Jt),_chunk2Z3O2CFMcjs.d.call(void 0, I,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",Wt,s),_chunk2Z3O2CFMcjs.d.call(void 0, I,10,"TYPE_MAPPING",vt,s),_chunk2Z3O2CFMcjs.d.call(void 0, I,10,"ORIGINAL_TRANSFORMS",$t,s),_chunk2Z3O2CFMcjs.d.call(void 0, I,10,"RESERVED_KEYWORDS",Xt,s),_chunk2Z3O2CFMcjs.b.call(void 0, I,s),_chunk2Z3O2CFMcjs.c.call(void 0, I,3,s),s.TRY_SUPPORTED=!1,s.SUPPORTS_UESCAPE=!1,s.LOCKING_READS_SUPPORTED=!1,s.QUERY_HINTS=!1,s.VALUES_AS_TABLE=!1,s.TZ_TO_WITH_TIME_ZONE=!0,s.NVL2_SUPPORTED=!0,s.LAST_DAY_SUPPORTS_DATE_PART=!1,s.CAN_IMPLEMENT_ARRAY_ANY=!1,s.MULTI_ARG_DISTINCT=!0,s.COPY_PARAMS_ARE_WRAPPED=!1,s.HEX_FUNC="TO_HEX",s.PARSE_JSON_NAME="JSON_PARSE",s.ARRAY_CONCAT_IS_VAR_LEN=!1,s.SUPPORTS_CONVERT_TIMEZONE=!0,s.EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE=!1,s.SUPPORTS_MEDIAN=!0,s.ALTER_SET_TYPE="TYPE",s.SUPPORTS_DECODE_CASE=!0,s.SUPPORTS_BETWEEN_FLAGS=!1,s.LIMIT_FETCH="LIMIT",s.WITH_PROPERTIES_PREFIX=" ";var zt,Zt,jt,C,n= exports.Redshift =class extends(jt=_chunkWRNYJ54Acjs.b,Zt=[_chunk2Z3O2CFMcjs.r],zt=[_chunk2Z3O2CFMcjs.r],jt){static get NORMALIZATION_STRATEGY(){return"caseInsensitive"}static get TIME_MAPPING(){return{..._chunkWRNYJ54Acjs.b.TIME_MAPPING,MON:"%b",HH24:"%H",HH:"%I"}}};C=_chunk2Z3O2CFMcjs.a.call(void 0, jt),_chunk2Z3O2CFMcjs.d.call(void 0, C,10,"NORMALIZATION_STRATEGY",Zt,n),_chunk2Z3O2CFMcjs.d.call(void 0, C,10,"TIME_MAPPING",zt,n),_chunk2Z3O2CFMcjs.b.call(void 0, C,n),_chunk2Z3O2CFMcjs.c.call(void 0, C,3,n),n.DIALECT_NAME="redshift",n.SUPPORTS_USER_DEFINED_TYPES=!1,n.INDEX_OFFSET=0,n.COPY_PARAMS_ARE_CSV=!1,n.HEX_LOWERCASE=!0,n.HAS_DISTINCT_ARRAY_CONSTRUCTORS=!0,n.COALESCE_COMPARISON_NON_STANDARD=!0,n.REGEXP_EXTRACT_POSITION_OVERFLOW_RETURNS_NULL=!1,n.ARRAY_FUNCS_PROPAGATES_NULLS=!0,n.TIME_FORMAT="'YYYY-MM-DD HH24:MI:SS'",n.Tokenizer=p,n.Parser=T,n.Generator=s;_chunk2Z3O2CFMcjs.op.register("redshift",n);exports.Redshift = n;
|
|
2
|
+
//# sourceMappingURL=redshift.cjs.map
|