@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.
Files changed (243) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.repo.md +1 -2
  3. package/dist/chunk-2YNOERAO.cjs +2 -0
  4. package/dist/chunk-2YNOERAO.cjs.map +1 -0
  5. package/dist/chunk-2Z3O2CFM.cjs +19 -0
  6. package/dist/chunk-2Z3O2CFM.cjs.map +1 -0
  7. package/dist/chunk-4ZMKB6PV.cjs +2 -0
  8. package/dist/chunk-4ZMKB6PV.cjs.map +1 -0
  9. package/dist/chunk-53OWF4GG.js +2 -0
  10. package/dist/chunk-53OWF4GG.js.map +1 -0
  11. package/dist/chunk-C4CLTVOW.cjs +2 -0
  12. package/dist/chunk-C4CLTVOW.cjs.map +1 -0
  13. package/dist/chunk-DOKMTZYO.cjs +4 -0
  14. package/dist/chunk-DOKMTZYO.cjs.map +1 -0
  15. package/dist/chunk-FCGUTI7Y.js +2 -0
  16. package/dist/chunk-FCGUTI7Y.js.map +1 -0
  17. package/dist/chunk-IPCIXWCY.js +2 -0
  18. package/dist/chunk-IPCIXWCY.js.map +1 -0
  19. package/dist/chunk-KCNOE4DZ.js +19 -0
  20. package/dist/chunk-KCNOE4DZ.js.map +1 -0
  21. package/dist/chunk-NRJHX2GZ.js +2 -0
  22. package/dist/chunk-NRJHX2GZ.js.map +1 -0
  23. package/dist/chunk-O2J5RKBN.js +2 -0
  24. package/dist/chunk-O2J5RKBN.js.map +1 -0
  25. package/dist/chunk-PXUASP5I.js +2 -0
  26. package/dist/chunk-PXUASP5I.js.map +1 -0
  27. package/dist/chunk-R7C3ZHVK.cjs +2 -0
  28. package/dist/chunk-R7C3ZHVK.cjs.map +1 -0
  29. package/dist/chunk-UHWHUDLE.cjs +2 -0
  30. package/dist/chunk-UHWHUDLE.cjs.map +1 -0
  31. package/dist/chunk-WRNYJ54A.cjs +2 -0
  32. package/dist/chunk-WRNYJ54A.cjs.map +1 -0
  33. package/dist/chunk-XZQFOICX.cjs +3 -0
  34. package/dist/chunk-XZQFOICX.cjs.map +1 -0
  35. package/dist/chunk-YLOQRUXC.js +2 -0
  36. package/dist/chunk-YLOQRUXC.js.map +1 -0
  37. package/dist/chunk-YSS2WVCM.cjs +2 -0
  38. package/dist/chunk-YSS2WVCM.cjs.map +1 -0
  39. package/dist/chunk-Z5V6VOIN.js +3 -0
  40. package/dist/chunk-Z5V6VOIN.js.map +1 -0
  41. package/dist/chunk-ZBFGQPJR.js +4 -0
  42. package/dist/chunk-ZBFGQPJR.js.map +1 -0
  43. package/dist/dialects/athena.cjs +2 -0
  44. package/dist/dialects/athena.cjs.map +1 -0
  45. package/dist/dialects/athena.d.cts +66 -0
  46. package/dist/dialects/athena.d.ts +66 -0
  47. package/dist/dialects/athena.js +2 -0
  48. package/dist/dialects/athena.js.map +1 -0
  49. package/dist/dialects/bigquery.cjs +3 -0
  50. package/dist/dialects/bigquery.cjs.map +1 -0
  51. package/dist/dialects/bigquery.d.cts +651 -0
  52. package/dist/dialects/bigquery.d.ts +651 -0
  53. package/dist/dialects/bigquery.js +3 -0
  54. package/dist/dialects/bigquery.js.map +1 -0
  55. package/dist/dialects/clickhouse.cjs +2 -0
  56. package/dist/dialects/clickhouse.cjs.map +1 -0
  57. package/dist/dialects/clickhouse.d.cts +634 -0
  58. package/dist/dialects/clickhouse.d.ts +634 -0
  59. package/dist/dialects/clickhouse.js +2 -0
  60. package/dist/dialects/clickhouse.js.map +1 -0
  61. package/dist/dialects/databricks.cjs +2 -0
  62. package/dist/dialects/databricks.cjs.map +1 -0
  63. package/dist/dialects/databricks.d.cts +484 -0
  64. package/dist/dialects/databricks.d.ts +484 -0
  65. package/dist/dialects/databricks.js +2 -0
  66. package/dist/dialects/databricks.js.map +1 -0
  67. package/dist/dialects/doris.cjs +2 -0
  68. package/dist/dialects/doris.cjs.map +1 -0
  69. package/dist/dialects/doris.d.cts +484 -0
  70. package/dist/dialects/doris.d.ts +484 -0
  71. package/dist/dialects/doris.js +2 -0
  72. package/dist/dialects/doris.js.map +1 -0
  73. package/dist/dialects/dremio.cjs +2 -0
  74. package/dist/dialects/dremio.cjs.map +1 -0
  75. package/dist/dialects/dremio.d.cts +522 -0
  76. package/dist/dialects/dremio.d.ts +522 -0
  77. package/dist/dialects/dremio.js +2 -0
  78. package/dist/dialects/dremio.js.map +1 -0
  79. package/dist/dialects/drill.cjs +2 -0
  80. package/dist/dialects/drill.cjs.map +1 -0
  81. package/dist/dialects/drill.d.cts +512 -0
  82. package/dist/dialects/drill.d.ts +512 -0
  83. package/dist/dialects/drill.js +2 -0
  84. package/dist/dialects/drill.js.map +1 -0
  85. package/dist/dialects/druid.cjs +2 -0
  86. package/dist/dialects/druid.cjs.map +1 -0
  87. package/dist/dialects/druid.d.cts +17 -0
  88. package/dist/dialects/druid.d.ts +17 -0
  89. package/dist/dialects/druid.js +2 -0
  90. package/dist/dialects/druid.js.map +1 -0
  91. package/dist/dialects/duckdb.cjs +86 -0
  92. package/dist/dialects/duckdb.cjs.map +1 -0
  93. package/dist/dialects/duckdb.d.cts +756 -0
  94. package/dist/dialects/duckdb.d.ts +756 -0
  95. package/dist/dialects/duckdb.js +86 -0
  96. package/dist/dialects/duckdb.js.map +1 -0
  97. package/dist/dialects/dune.cjs +2 -0
  98. package/dist/dialects/dune.cjs.map +1 -0
  99. package/dist/dialects/dune.d.cts +21 -0
  100. package/dist/dialects/dune.d.ts +21 -0
  101. package/dist/dialects/dune.js +2 -0
  102. package/dist/dialects/dune.js.map +1 -0
  103. package/dist/dialects/exasol.cjs +2 -0
  104. package/dist/dialects/exasol.cjs.map +1 -0
  105. package/dist/dialects/exasol.d.cts +507 -0
  106. package/dist/dialects/exasol.d.ts +507 -0
  107. package/dist/dialects/exasol.js +2 -0
  108. package/dist/dialects/exasol.js.map +1 -0
  109. package/dist/dialects/fabric.cjs +2 -0
  110. package/dist/dialects/fabric.cjs.map +1 -0
  111. package/dist/dialects/fabric.d.cts +463 -0
  112. package/dist/dialects/fabric.d.ts +463 -0
  113. package/dist/dialects/fabric.js +2 -0
  114. package/dist/dialects/fabric.js.map +1 -0
  115. package/dist/dialects/hive.cjs +2 -0
  116. package/dist/dialects/hive.cjs.map +1 -0
  117. package/dist/dialects/hive.d.cts +585 -0
  118. package/dist/dialects/hive.d.ts +585 -0
  119. package/dist/dialects/hive.js +2 -0
  120. package/dist/dialects/hive.js.map +1 -0
  121. package/dist/dialects/materialize.cjs +2 -0
  122. package/dist/dialects/materialize.cjs.map +1 -0
  123. package/dist/dialects/materialize.d.cts +890 -0
  124. package/dist/dialects/materialize.d.ts +890 -0
  125. package/dist/dialects/materialize.js +2 -0
  126. package/dist/dialects/materialize.js.map +1 -0
  127. package/dist/dialects/mysql.cjs +2 -0
  128. package/dist/dialects/mysql.cjs.map +1 -0
  129. package/dist/dialects/mysql.d.cts +292 -0
  130. package/dist/dialects/mysql.d.ts +292 -0
  131. package/dist/dialects/mysql.js +2 -0
  132. package/dist/dialects/mysql.js.map +1 -0
  133. package/dist/dialects/oracle.cjs +2 -0
  134. package/dist/dialects/oracle.cjs.map +1 -0
  135. package/dist/dialects/oracle.d.cts +539 -0
  136. package/dist/dialects/oracle.d.ts +539 -0
  137. package/dist/dialects/oracle.js +2 -0
  138. package/dist/dialects/oracle.js.map +1 -0
  139. package/dist/dialects/postgres.cjs +2 -0
  140. package/dist/dialects/postgres.cjs.map +1 -0
  141. package/dist/dialects/postgres.d.cts +587 -0
  142. package/dist/dialects/postgres.d.ts +587 -0
  143. package/dist/dialects/postgres.js +2 -0
  144. package/dist/dialects/postgres.js.map +1 -0
  145. package/dist/dialects/presto.cjs +2 -0
  146. package/dist/dialects/presto.cjs.map +1 -0
  147. package/dist/dialects/presto.d.cts +173 -0
  148. package/dist/dialects/presto.d.ts +173 -0
  149. package/dist/dialects/presto.js +2 -0
  150. package/dist/dialects/presto.js.map +1 -0
  151. package/dist/dialects/prql.cjs +2 -0
  152. package/dist/dialects/prql.cjs.map +1 -0
  153. package/dist/dialects/prql.d.cts +496 -0
  154. package/dist/dialects/prql.d.ts +496 -0
  155. package/dist/dialects/prql.js +2 -0
  156. package/dist/dialects/prql.js.map +1 -0
  157. package/dist/dialects/redshift.cjs +2 -0
  158. package/dist/dialects/redshift.cjs.map +1 -0
  159. package/dist/dialects/redshift.d.cts +132 -0
  160. package/dist/dialects/redshift.d.ts +132 -0
  161. package/dist/dialects/redshift.js +2 -0
  162. package/dist/dialects/redshift.js.map +1 -0
  163. package/dist/dialects/risingwave.cjs +2 -0
  164. package/dist/dialects/risingwave.cjs.map +1 -0
  165. package/dist/dialects/risingwave.d.cts +478 -0
  166. package/dist/dialects/risingwave.d.ts +478 -0
  167. package/dist/dialects/risingwave.js +2 -0
  168. package/dist/dialects/risingwave.js.map +1 -0
  169. package/dist/dialects/singlestore.cjs +2 -0
  170. package/dist/dialects/singlestore.cjs.map +1 -0
  171. package/dist/dialects/singlestore.d.cts +73 -0
  172. package/dist/dialects/singlestore.d.ts +73 -0
  173. package/dist/dialects/singlestore.js +2 -0
  174. package/dist/dialects/singlestore.js.map +1 -0
  175. package/dist/dialects/snowflake.cjs +3 -0
  176. package/dist/dialects/snowflake.cjs.map +1 -0
  177. package/dist/dialects/snowflake.d.cts +320 -0
  178. package/dist/dialects/snowflake.d.ts +320 -0
  179. package/dist/dialects/snowflake.js +3 -0
  180. package/dist/dialects/snowflake.js.map +1 -0
  181. package/dist/dialects/solr.cjs +2 -0
  182. package/dist/dialects/solr.cjs.map +1 -0
  183. package/dist/dialects/solr.d.cts +458 -0
  184. package/dist/dialects/solr.d.ts +458 -0
  185. package/dist/dialects/solr.js +2 -0
  186. package/dist/dialects/solr.js.map +1 -0
  187. package/dist/dialects/spark.cjs +2 -0
  188. package/dist/dialects/spark.cjs.map +1 -0
  189. package/dist/dialects/spark.d.cts +484 -0
  190. package/dist/dialects/spark.d.ts +484 -0
  191. package/dist/dialects/spark.js +2 -0
  192. package/dist/dialects/spark.js.map +1 -0
  193. package/dist/dialects/spark2.cjs +2 -0
  194. package/dist/dialects/spark2.cjs.map +1 -0
  195. package/dist/dialects/spark2.d.cts +486 -0
  196. package/dist/dialects/spark2.d.ts +486 -0
  197. package/dist/dialects/spark2.js +2 -0
  198. package/dist/dialects/spark2.js.map +1 -0
  199. package/dist/dialects/sqlite.cjs +2 -0
  200. package/dist/dialects/sqlite.cjs.map +1 -0
  201. package/dist/dialects/sqlite.d.cts +510 -0
  202. package/dist/dialects/sqlite.d.ts +510 -0
  203. package/dist/dialects/sqlite.js +2 -0
  204. package/dist/dialects/sqlite.js.map +1 -0
  205. package/dist/dialects/starrocks.cjs +2 -0
  206. package/dist/dialects/starrocks.cjs.map +1 -0
  207. package/dist/dialects/starrocks.d.cts +518 -0
  208. package/dist/dialects/starrocks.d.ts +518 -0
  209. package/dist/dialects/starrocks.js +2 -0
  210. package/dist/dialects/starrocks.js.map +1 -0
  211. package/dist/dialects/tableau.cjs +2 -0
  212. package/dist/dialects/tableau.cjs.map +1 -0
  213. package/dist/dialects/tableau.d.cts +466 -0
  214. package/dist/dialects/tableau.d.ts +466 -0
  215. package/dist/dialects/tableau.js +2 -0
  216. package/dist/dialects/tableau.js.map +1 -0
  217. package/dist/dialects/teradata.cjs +2 -0
  218. package/dist/dialects/teradata.cjs.map +1 -0
  219. package/dist/dialects/teradata.d.cts +539 -0
  220. package/dist/dialects/teradata.d.ts +539 -0
  221. package/dist/dialects/teradata.js +2 -0
  222. package/dist/dialects/teradata.js.map +1 -0
  223. package/dist/dialects/trino.cjs +2 -0
  224. package/dist/dialects/trino.cjs.map +1 -0
  225. package/dist/dialects/trino.d.cts +465 -0
  226. package/dist/dialects/trino.d.ts +465 -0
  227. package/dist/dialects/trino.js +2 -0
  228. package/dist/dialects/trino.js.map +1 -0
  229. package/dist/dialects/tsql.cjs +2 -0
  230. package/dist/dialects/tsql.cjs.map +1 -0
  231. package/dist/dialects/tsql.d.cts +703 -0
  232. package/dist/dialects/tsql.d.ts +703 -0
  233. package/dist/dialects/tsql.js +2 -0
  234. package/dist/dialects/tsql.js.map +1 -0
  235. package/dist/index.cjs +5 -25
  236. package/dist/index.cjs.map +1 -1
  237. package/dist/index.d.cts +3 -14178
  238. package/dist/index.d.ts +3 -14178
  239. package/dist/index.js +5 -25
  240. package/dist/index.js.map +1 -1
  241. package/dist/tokens-VcMD09XM.d.cts +15805 -0
  242. package/dist/tokens-VcMD09XM.d.ts +15805 -0
  243. package/package.json +171 -5
@@ -0,0 +1,512 @@
1
+ import { c as Dialect, d as Dialects, a1 as NormalizeFunctions, aH as NullOrdering, m as Tokenizer, l as TokenType, i as Parser, E as Expression, G as Generator, aj as PropertiesLocation, b0 as StrToDateExpr } from '../tokens-VcMD09XM.js';
2
+
3
+ declare class DrillTokenizer extends Tokenizer {
4
+ static get IDENTIFIERS(): string[];
5
+ static get STRING_ESCAPES(): string[];
6
+ static get KEYWORDS(): Record<string, TokenType>;
7
+ }
8
+ declare class DrillParser extends Parser {
9
+ static get ID_VAR_TOKENS(): Set<TokenType>;
10
+ static get NO_PAREN_FUNCTIONS(): {
11
+ lParen?: typeof Expression | undefined;
12
+ rParen?: typeof Expression | undefined;
13
+ lBracket?: typeof Expression | undefined;
14
+ rBracket?: typeof Expression | undefined;
15
+ lBrace?: typeof Expression | undefined;
16
+ rBrace?: typeof Expression | undefined;
17
+ comma?: typeof Expression | undefined;
18
+ dot?: typeof Expression | undefined;
19
+ dash?: typeof Expression | undefined;
20
+ plus?: typeof Expression | undefined;
21
+ colon?: typeof Expression | undefined;
22
+ dotcolon?: typeof Expression | undefined;
23
+ dcolon?: typeof Expression | undefined;
24
+ dcolondollar?: typeof Expression | undefined;
25
+ dcolonpercent?: typeof Expression | undefined;
26
+ dcolonqmark?: typeof Expression | undefined;
27
+ dqmark?: typeof Expression | undefined;
28
+ semicolon?: typeof Expression | undefined;
29
+ star?: typeof Expression | undefined;
30
+ backslash?: typeof Expression | undefined;
31
+ slash?: typeof Expression | undefined;
32
+ lt?: typeof Expression | undefined;
33
+ lte?: typeof Expression | undefined;
34
+ gt?: typeof Expression | undefined;
35
+ gte?: typeof Expression | undefined;
36
+ not?: typeof Expression | undefined;
37
+ eq?: typeof Expression | undefined;
38
+ neq?: typeof Expression | undefined;
39
+ nullsafeEq?: typeof Expression | undefined;
40
+ colonEq?: typeof Expression | undefined;
41
+ colonGt?: typeof Expression | undefined;
42
+ ncolonGt?: typeof Expression | undefined;
43
+ and?: typeof Expression | undefined;
44
+ or?: typeof Expression | undefined;
45
+ amp?: typeof Expression | undefined;
46
+ dpipe?: typeof Expression | undefined;
47
+ pipeGt?: typeof Expression | undefined;
48
+ pipe?: typeof Expression | undefined;
49
+ pipeSlash?: typeof Expression | undefined;
50
+ dpipeSlash?: typeof Expression | undefined;
51
+ caret?: typeof Expression | undefined;
52
+ caretAt?: typeof Expression | undefined;
53
+ tilde?: typeof Expression | undefined;
54
+ arrow?: typeof Expression | undefined;
55
+ darrow?: typeof Expression | undefined;
56
+ farrow?: typeof Expression | undefined;
57
+ hash?: typeof Expression | undefined;
58
+ hashArrow?: typeof Expression | undefined;
59
+ dhashArrow?: typeof Expression | undefined;
60
+ lrArrow?: typeof Expression | undefined;
61
+ dat?: typeof Expression | undefined;
62
+ ltAt?: typeof Expression | undefined;
63
+ atGt?: typeof Expression | undefined;
64
+ dollar?: typeof Expression | undefined;
65
+ parameter?: typeof Expression | undefined;
66
+ session?: typeof Expression | undefined;
67
+ sessionParameter?: typeof Expression | undefined;
68
+ sessionUser?: typeof Expression | undefined;
69
+ damp?: typeof Expression | undefined;
70
+ ampLt?: typeof Expression | undefined;
71
+ ampGt?: typeof Expression | undefined;
72
+ adjacent?: typeof Expression | undefined;
73
+ xor?: typeof Expression | undefined;
74
+ dstar?: typeof Expression | undefined;
75
+ qmarkAmp?: typeof Expression | undefined;
76
+ qmarkPipe?: typeof Expression | undefined;
77
+ hashDash?: typeof Expression | undefined;
78
+ exclamation?: typeof Expression | undefined;
79
+ uriStart?: typeof Expression | undefined;
80
+ blockStart?: typeof Expression | undefined;
81
+ blockEnd?: typeof Expression | undefined;
82
+ space?: typeof Expression | undefined;
83
+ break?: typeof Expression | undefined;
84
+ string?: typeof Expression | undefined;
85
+ number?: typeof Expression | undefined;
86
+ identifier?: typeof Expression | undefined;
87
+ database?: typeof Expression | undefined;
88
+ column?: typeof Expression | undefined;
89
+ columnDef?: typeof Expression | undefined;
90
+ schema?: typeof Expression | undefined;
91
+ table?: typeof Expression | undefined;
92
+ warehouse?: typeof Expression | undefined;
93
+ stage?: typeof Expression | undefined;
94
+ streamlit?: typeof Expression | undefined;
95
+ var?: typeof Expression | undefined;
96
+ bitString?: typeof Expression | undefined;
97
+ hexString?: typeof Expression | undefined;
98
+ byteString?: typeof Expression | undefined;
99
+ nationalString?: typeof Expression | undefined;
100
+ rawString?: typeof Expression | undefined;
101
+ heredocString?: typeof Expression | undefined;
102
+ unicodeString?: typeof Expression | undefined;
103
+ bit?: typeof Expression | undefined;
104
+ boolean?: typeof Expression | undefined;
105
+ tinyint?: typeof Expression | undefined;
106
+ utinyint?: typeof Expression | undefined;
107
+ smallint?: typeof Expression | undefined;
108
+ usmallint?: typeof Expression | undefined;
109
+ mediumint?: typeof Expression | undefined;
110
+ umediumint?: typeof Expression | undefined;
111
+ int?: typeof Expression | undefined;
112
+ uint?: typeof Expression | undefined;
113
+ bigint?: typeof Expression | undefined;
114
+ ubigint?: typeof Expression | undefined;
115
+ bignum?: typeof Expression | undefined;
116
+ int128?: typeof Expression | undefined;
117
+ uint128?: typeof Expression | undefined;
118
+ int256?: typeof Expression | undefined;
119
+ uint256?: typeof Expression | undefined;
120
+ float?: typeof Expression | undefined;
121
+ double?: typeof Expression | undefined;
122
+ udouble?: typeof Expression | undefined;
123
+ decimal?: typeof Expression | undefined;
124
+ decimal32?: typeof Expression | undefined;
125
+ decimal64?: typeof Expression | undefined;
126
+ decimal128?: typeof Expression | undefined;
127
+ decimal256?: typeof Expression | undefined;
128
+ decfloat?: typeof Expression | undefined;
129
+ udecimal?: typeof Expression | undefined;
130
+ bigdecimal?: typeof Expression | undefined;
131
+ char?: typeof Expression | undefined;
132
+ nchar?: typeof Expression | undefined;
133
+ varchar?: typeof Expression | undefined;
134
+ nvarchar?: typeof Expression | undefined;
135
+ bpchar?: typeof Expression | undefined;
136
+ text?: typeof Expression | undefined;
137
+ mediumtext?: typeof Expression | undefined;
138
+ longtext?: typeof Expression | undefined;
139
+ blob?: typeof Expression | undefined;
140
+ mediumblob?: typeof Expression | undefined;
141
+ longblob?: typeof Expression | undefined;
142
+ tinyblob?: typeof Expression | undefined;
143
+ tinytext?: typeof Expression | undefined;
144
+ name?: typeof Expression | undefined;
145
+ binary?: typeof Expression | undefined;
146
+ varbinary?: typeof Expression | undefined;
147
+ json?: typeof Expression | undefined;
148
+ jsonb?: typeof Expression | undefined;
149
+ time?: typeof Expression | undefined;
150
+ timetz?: typeof Expression | undefined;
151
+ timeNs?: typeof Expression | undefined;
152
+ timestamp?: typeof Expression | undefined;
153
+ timestamptz?: typeof Expression | undefined;
154
+ timestampltz?: typeof Expression | undefined;
155
+ timestampntz?: typeof Expression | undefined;
156
+ timestampS?: typeof Expression | undefined;
157
+ timestampMs?: typeof Expression | undefined;
158
+ timestampNs?: typeof Expression | undefined;
159
+ datetime?: typeof Expression | undefined;
160
+ datetime2?: typeof Expression | undefined;
161
+ datetime64?: typeof Expression | undefined;
162
+ smalldatetime?: typeof Expression | undefined;
163
+ date?: typeof Expression | undefined;
164
+ date32?: typeof Expression | undefined;
165
+ int4range?: typeof Expression | undefined;
166
+ int4multirange?: typeof Expression | undefined;
167
+ int8range?: typeof Expression | undefined;
168
+ int8multirange?: typeof Expression | undefined;
169
+ numrange?: typeof Expression | undefined;
170
+ nummultirange?: typeof Expression | undefined;
171
+ tsrange?: typeof Expression | undefined;
172
+ tsmultirange?: typeof Expression | undefined;
173
+ tstzrange?: typeof Expression | undefined;
174
+ tstzmultirange?: typeof Expression | undefined;
175
+ daterange?: typeof Expression | undefined;
176
+ datemultirange?: typeof Expression | undefined;
177
+ uuid?: typeof Expression | undefined;
178
+ geography?: typeof Expression | undefined;
179
+ geographypoint?: typeof Expression | undefined;
180
+ nullable?: typeof Expression | undefined;
181
+ geometry?: typeof Expression | undefined;
182
+ point?: typeof Expression | undefined;
183
+ ring?: typeof Expression | undefined;
184
+ linestring?: typeof Expression | undefined;
185
+ localtime?: typeof Expression | undefined;
186
+ localtimestamp?: typeof Expression | undefined;
187
+ systimestamp?: typeof Expression | undefined;
188
+ multilinestring?: typeof Expression | undefined;
189
+ polygon?: typeof Expression | undefined;
190
+ multipolygon?: typeof Expression | undefined;
191
+ hllsketch?: typeof Expression | undefined;
192
+ hstore?: typeof Expression | undefined;
193
+ super?: typeof Expression | undefined;
194
+ serial?: typeof Expression | undefined;
195
+ smallserial?: typeof Expression | undefined;
196
+ bigserial?: typeof Expression | undefined;
197
+ xml?: typeof Expression | undefined;
198
+ year?: typeof Expression | undefined;
199
+ userdefined?: typeof Expression | undefined;
200
+ money?: typeof Expression | undefined;
201
+ smallmoney?: typeof Expression | undefined;
202
+ rowversion?: typeof Expression | undefined;
203
+ image?: typeof Expression | undefined;
204
+ variant?: typeof Expression | undefined;
205
+ object?: typeof Expression | undefined;
206
+ inet?: typeof Expression | undefined;
207
+ ipaddress?: typeof Expression | undefined;
208
+ ipprefix?: typeof Expression | undefined;
209
+ ipv4?: typeof Expression | undefined;
210
+ ipv6?: typeof Expression | undefined;
211
+ enum?: typeof Expression | undefined;
212
+ enum8?: typeof Expression | undefined;
213
+ enum16?: typeof Expression | undefined;
214
+ fixedstring?: typeof Expression | undefined;
215
+ lowcardinality?: typeof Expression | undefined;
216
+ nested?: typeof Expression | undefined;
217
+ aggregatefunction?: typeof Expression | undefined;
218
+ simpleaggregatefunction?: typeof Expression | undefined;
219
+ tdigest?: typeof Expression | undefined;
220
+ unknown?: typeof Expression | undefined;
221
+ vector?: typeof Expression | undefined;
222
+ dynamic?: typeof Expression | undefined;
223
+ void?: typeof Expression | undefined;
224
+ alias?: typeof Expression | undefined;
225
+ alter?: typeof Expression | undefined;
226
+ all?: typeof Expression | undefined;
227
+ anti?: typeof Expression | undefined;
228
+ any?: typeof Expression | undefined;
229
+ apply?: typeof Expression | undefined;
230
+ array?: typeof Expression | undefined;
231
+ asc?: typeof Expression | undefined;
232
+ asof?: typeof Expression | undefined;
233
+ attach?: typeof Expression | undefined;
234
+ autoIncrement?: typeof Expression | undefined;
235
+ begin?: typeof Expression | undefined;
236
+ between?: typeof Expression | undefined;
237
+ bulkCollectInto?: typeof Expression | undefined;
238
+ cache?: typeof Expression | undefined;
239
+ case?: typeof Expression | undefined;
240
+ characterSet?: typeof Expression | undefined;
241
+ clusterBy?: typeof Expression | undefined;
242
+ collate?: typeof Expression | undefined;
243
+ command?: typeof Expression | undefined;
244
+ comment?: typeof Expression | undefined;
245
+ commit?: typeof Expression | undefined;
246
+ connectBy?: typeof Expression | undefined;
247
+ constraint?: typeof Expression | undefined;
248
+ copy?: typeof Expression | undefined;
249
+ create?: typeof Expression | undefined;
250
+ cross?: typeof Expression | undefined;
251
+ cube?: typeof Expression | undefined;
252
+ currentDate?: typeof Expression | undefined;
253
+ currentDatetime?: typeof Expression | undefined;
254
+ currentSchema?: typeof Expression | undefined;
255
+ currentTime?: typeof Expression | undefined;
256
+ currentTimestamp?: typeof Expression | undefined;
257
+ currentUser?: typeof Expression | undefined;
258
+ currentRole?: typeof Expression | undefined;
259
+ currentCatalog?: typeof Expression | undefined;
260
+ declare?: typeof Expression | undefined;
261
+ default?: typeof Expression | undefined;
262
+ delete?: typeof Expression | undefined;
263
+ desc?: typeof Expression | undefined;
264
+ describe?: typeof Expression | undefined;
265
+ detach?: typeof Expression | undefined;
266
+ dictionary?: typeof Expression | undefined;
267
+ distinct?: typeof Expression | undefined;
268
+ distributeBy?: typeof Expression | undefined;
269
+ div?: typeof Expression | undefined;
270
+ drop?: typeof Expression | undefined;
271
+ else?: typeof Expression | undefined;
272
+ end?: typeof Expression | undefined;
273
+ escape?: typeof Expression | undefined;
274
+ except?: typeof Expression | undefined;
275
+ execute?: typeof Expression | undefined;
276
+ exists?: typeof Expression | undefined;
277
+ false?: typeof Expression | undefined;
278
+ fetch?: typeof Expression | undefined;
279
+ file?: typeof Expression | undefined;
280
+ fileFormat?: typeof Expression | undefined;
281
+ filter?: typeof Expression | undefined;
282
+ final?: typeof Expression | undefined;
283
+ first?: typeof Expression | undefined;
284
+ for?: typeof Expression | undefined;
285
+ force?: typeof Expression | undefined;
286
+ foreignKey?: typeof Expression | undefined;
287
+ format?: typeof Expression | undefined;
288
+ from?: typeof Expression | undefined;
289
+ full?: typeof Expression | undefined;
290
+ function?: typeof Expression | undefined;
291
+ get?: typeof Expression | undefined;
292
+ glob?: typeof Expression | undefined;
293
+ global?: typeof Expression | undefined;
294
+ grant?: typeof Expression | undefined;
295
+ groupBy?: typeof Expression | undefined;
296
+ groupingSets?: typeof Expression | undefined;
297
+ having?: typeof Expression | undefined;
298
+ hint?: typeof Expression | undefined;
299
+ ignore?: typeof Expression | undefined;
300
+ ilike?: typeof Expression | undefined;
301
+ in?: typeof Expression | undefined;
302
+ index?: typeof Expression | undefined;
303
+ indexedBy?: typeof Expression | undefined;
304
+ inner?: typeof Expression | undefined;
305
+ insert?: typeof Expression | undefined;
306
+ install?: typeof Expression | undefined;
307
+ intersect?: typeof Expression | undefined;
308
+ interval?: typeof Expression | undefined;
309
+ into?: typeof Expression | undefined;
310
+ introducer?: typeof Expression | undefined;
311
+ irlike?: typeof Expression | undefined;
312
+ is?: typeof Expression | undefined;
313
+ isnull?: typeof Expression | undefined;
314
+ join?: typeof Expression | undefined;
315
+ joinMarker?: typeof Expression | undefined;
316
+ keep?: typeof Expression | undefined;
317
+ key?: typeof Expression | undefined;
318
+ kill?: typeof Expression | undefined;
319
+ language?: typeof Expression | undefined;
320
+ lateral?: typeof Expression | undefined;
321
+ left?: typeof Expression | undefined;
322
+ like?: typeof Expression | undefined;
323
+ limit?: typeof Expression | undefined;
324
+ list?: typeof Expression | undefined;
325
+ load?: typeof Expression | undefined;
326
+ lock?: typeof Expression | undefined;
327
+ map?: typeof Expression | undefined;
328
+ match?: typeof Expression | undefined;
329
+ matchCondition?: typeof Expression | undefined;
330
+ matchRecognize?: typeof Expression | undefined;
331
+ memberOf?: typeof Expression | undefined;
332
+ merge?: typeof Expression | undefined;
333
+ mod?: typeof Expression | undefined;
334
+ model?: typeof Expression | undefined;
335
+ natural?: typeof Expression | undefined;
336
+ next?: typeof Expression | undefined;
337
+ nothing?: typeof Expression | undefined;
338
+ notnull?: typeof Expression | undefined;
339
+ null?: typeof Expression | undefined;
340
+ objectIdentifier?: typeof Expression | undefined;
341
+ offset?: typeof Expression | undefined;
342
+ on?: typeof Expression | undefined;
343
+ only?: typeof Expression | undefined;
344
+ operator?: typeof Expression | undefined;
345
+ orderBy?: typeof Expression | undefined;
346
+ orderSiblingsBy?: typeof Expression | undefined;
347
+ ordered?: typeof Expression | undefined;
348
+ ordinality?: typeof Expression | undefined;
349
+ out?: typeof Expression | undefined;
350
+ inout?: typeof Expression | undefined;
351
+ outer?: typeof Expression | undefined;
352
+ over?: typeof Expression | undefined;
353
+ overlaps?: typeof Expression | undefined;
354
+ overwrite?: typeof Expression | undefined;
355
+ partition?: typeof Expression | undefined;
356
+ partitionBy?: typeof Expression | undefined;
357
+ percent?: typeof Expression | undefined;
358
+ pivot?: typeof Expression | undefined;
359
+ placeholder?: typeof Expression | undefined;
360
+ positional?: typeof Expression | undefined;
361
+ pragma?: typeof Expression | undefined;
362
+ prewhere?: typeof Expression | undefined;
363
+ primaryKey?: typeof Expression | undefined;
364
+ procedure?: typeof Expression | undefined;
365
+ properties?: typeof Expression | undefined;
366
+ pseudoType?: typeof Expression | undefined;
367
+ put?: typeof Expression | undefined;
368
+ qualify?: typeof Expression | undefined;
369
+ quote?: typeof Expression | undefined;
370
+ qdcolon?: typeof Expression | undefined;
371
+ range?: typeof Expression | undefined;
372
+ recursive?: typeof Expression | undefined;
373
+ refresh?: typeof Expression | undefined;
374
+ rename?: typeof Expression | undefined;
375
+ replace?: typeof Expression | undefined;
376
+ returning?: typeof Expression | undefined;
377
+ revoke?: typeof Expression | undefined;
378
+ references?: typeof Expression | undefined;
379
+ right?: typeof Expression | undefined;
380
+ rlike?: typeof Expression | undefined;
381
+ rollback?: typeof Expression | undefined;
382
+ rollup?: typeof Expression | undefined;
383
+ row?: typeof Expression | undefined;
384
+ rows?: typeof Expression | undefined;
385
+ select?: typeof Expression | undefined;
386
+ semi?: typeof Expression | undefined;
387
+ separator?: typeof Expression | undefined;
388
+ sequence?: typeof Expression | undefined;
389
+ serdeProperties?: typeof Expression | undefined;
390
+ set?: typeof Expression | undefined;
391
+ settings?: typeof Expression | undefined;
392
+ show?: typeof Expression | undefined;
393
+ similarTo?: typeof Expression | undefined;
394
+ some?: typeof Expression | undefined;
395
+ sortBy?: typeof Expression | undefined;
396
+ soundsLike?: typeof Expression | undefined;
397
+ startWith?: typeof Expression | undefined;
398
+ storageIntegration?: typeof Expression | undefined;
399
+ straightJoin?: typeof Expression | undefined;
400
+ struct?: typeof Expression | undefined;
401
+ summarize?: typeof Expression | undefined;
402
+ tableSample?: typeof Expression | undefined;
403
+ tag?: typeof Expression | undefined;
404
+ temporary?: typeof Expression | undefined;
405
+ top?: typeof Expression | undefined;
406
+ then?: typeof Expression | undefined;
407
+ true?: typeof Expression | undefined;
408
+ truncate?: typeof Expression | undefined;
409
+ uncache?: typeof Expression | undefined;
410
+ union?: typeof Expression | undefined;
411
+ unnest?: typeof Expression | undefined;
412
+ unpivot?: typeof Expression | undefined;
413
+ update?: typeof Expression | undefined;
414
+ use?: typeof Expression | undefined;
415
+ using?: typeof Expression | undefined;
416
+ values?: typeof Expression | undefined;
417
+ variadic?: typeof Expression | undefined;
418
+ view?: typeof Expression | undefined;
419
+ semanticView?: typeof Expression | undefined;
420
+ volatile?: typeof Expression | undefined;
421
+ when?: typeof Expression | undefined;
422
+ where?: typeof Expression | undefined;
423
+ window?: typeof Expression | undefined;
424
+ with?: typeof Expression | undefined;
425
+ unique?: typeof Expression | undefined;
426
+ utcDate?: typeof Expression | undefined;
427
+ utcTime?: typeof Expression | undefined;
428
+ utcTimestamp?: typeof Expression | undefined;
429
+ versionSnapshot?: typeof Expression | undefined;
430
+ timestampSnapshot?: typeof Expression | undefined;
431
+ option?: typeof Expression | undefined;
432
+ sink?: typeof Expression | undefined;
433
+ source?: typeof Expression | undefined;
434
+ analyze?: typeof Expression | undefined;
435
+ namespace?: typeof Expression | undefined;
436
+ export?: typeof Expression | undefined;
437
+ hiveTokenStream?: typeof Expression | undefined;
438
+ };
439
+ static STRICT_CAST: boolean;
440
+ static LOG_DEFAULTS_TO_LN: boolean;
441
+ static get FUNCTIONS(): Record<string, (args: Expression[], options: {
442
+ dialect: Dialect;
443
+ }) => Expression>;
444
+ static get TABLE_ALIAS_TOKENS(): Set<TokenType>;
445
+ }
446
+ declare class DrillGenerator extends Generator {
447
+ static get AFTER_HAVING_MODIFIER_TRANSFORMS(): Map<string, (this: Generator, e: Expression) => string>;
448
+ static SUPPORTS_DECODE_CASE: boolean;
449
+ static readonly SELECT_KINDS: string[];
450
+ static TRY_SUPPORTED: boolean;
451
+ static SUPPORTS_UESCAPE: boolean;
452
+ static JOIN_HINTS: boolean;
453
+ static TABLE_HINTS: boolean;
454
+ static QUERY_HINTS: boolean;
455
+ static NVL2_SUPPORTED: boolean;
456
+ static LAST_DAY_SUPPORTS_DATE_PART: boolean;
457
+ static SUPPORTS_CREATE_TABLE_LIKE: boolean;
458
+ static ARRAY_SIZE_NAME: string;
459
+ static get TYPE_MAPPING(): Map<string, string>;
460
+ static get PROPERTIES_LOCATION(): Map<typeof Expression, PropertiesLocation>;
461
+ static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: any) => string>;
462
+ strToDate(expression: StrToDateExpr): string;
463
+ }
464
+ declare class Drill extends Dialect {
465
+ static DIALECT_NAME: Dialects;
466
+ static get NORMALIZE_FUNCTIONS(): NormalizeFunctions;
467
+ static PRESERVE_ORIGINAL_NAMES: boolean;
468
+ static get NULL_ORDERING(): NullOrdering;
469
+ static DATE_FORMAT: string;
470
+ static DATEINT_FORMAT: string;
471
+ static TIME_FORMAT: string;
472
+ static SUPPORTS_USER_DEFINED_TYPES: boolean;
473
+ static SUPPORTS_SEMI_ANTI_JOIN: boolean;
474
+ static TYPED_DIVISION: boolean;
475
+ static CONCAT_COALESCE: boolean;
476
+ static get TIME_MAPPING(): {
477
+ y: string;
478
+ Y: string;
479
+ YYYY: string;
480
+ yyyy: string;
481
+ YY: string;
482
+ yy: string;
483
+ MMMM: string;
484
+ MMM: string;
485
+ MM: string;
486
+ M: string;
487
+ dd: string;
488
+ d: string;
489
+ HH: string;
490
+ H: string;
491
+ hh: string;
492
+ h: string;
493
+ mm: string;
494
+ m: string;
495
+ ss: string;
496
+ s: string;
497
+ SSSSSS: string;
498
+ a: string;
499
+ DD: string;
500
+ D: string;
501
+ E: string;
502
+ EE: string;
503
+ EEE: string;
504
+ EEEE: string;
505
+ '\'\'T\'\'': string;
506
+ };
507
+ static Tokenizer: typeof DrillTokenizer;
508
+ static Parser: typeof DrillParser;
509
+ static Generator: typeof DrillGenerator;
510
+ }
511
+
512
+ export { Drill };
@@ -0,0 +1,2 @@
1
+ import{g as y}from"../chunk-O2J5RKBN.js";import{Ap as St,Cg as m,Ep as At,Hl as f,Ie as w,Il as z,Ja as U,Jl as l,Kl as C,Kp as at,Lk as v,Ll as tt,Nl as st,Od as Y,Po as x,Qf as G,Rj as P,So as Et,Tl as Tt,Ub as F,Wd as H,Wp as ot,Xp as It,Xq as d,_i as X,a as I,ac as u,b as R,bn as et,bp as it,c,d as E,fe as D,fh as B,gp as rt,ji as b,ki as k,kp as nt,lp as N,mg as q,op as L,pp as S,r as i,ri as J,tl as W,ud as h,uh as K,wh as $,wl as j,xg as V,xl as Q,za as A,zk as Z}from"../chunk-KCNOE4DZ.js";var Rt,ct,Nt,_t,_,n=class extends(_t=d,Nt=[i],ct=[i],Rt=[i],_t){static get IDENTIFIERS(){return["`"]}static get STRING_ESCAPES(){return["\\"]}static get KEYWORDS(){let T={...d.KEYWORDS};return delete T["/*+"],T}};_=I(_t),E(_,10,"IDENTIFIERS",Nt,n),E(_,10,"STRING_ESCAPES",ct,n),E(_,10,"KEYWORDS",Rt,n),R(_,n),c(_,3,n);var pt,Ot,Mt,ut,ht,a,r=class extends(ht=A,ut=[i],Mt=[i],Ot=[i],pt=[i],ht){static get ID_VAR_TOKENS(){return new Set([...A.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let T={...A.NO_PAREN_FUNCTIONS};return delete T.localtime,delete T.localtimestamp,T}static get FUNCTIONS(){return{...A.FUNCTIONS,REPEATED_COUNT:T=>V.fromArgList(T),TO_TIMESTAMP:T=>C.fromArgList(T),TO_CHAR:at(f,{dialect:"drill"}),LEVENSHTEIN_DISTANCE:T=>P.fromArgList(T)}}static get TABLE_ALIAS_TOKENS(){return new Set([...A.TABLE_ALIAS_TOKENS,"straightJoin"])}};a=I(ht),E(a,10,"ID_VAR_TOKENS",ut,r),E(a,10,"NO_PAREN_FUNCTIONS",Mt,r),E(a,10,"FUNCTIONS",Ot,r),E(a,10,"TABLE_ALIAS_TOKENS",pt,r),R(a,r),c(a,3,r),r.STRICT_CAST=!1,r.LOG_DEFAULTS_TO_LN=!0;var mt,Pt,ft,Ct,xt,o,e=class extends(xt=N,Ct=[i],ft=[i],Pt=[i],mt=[i],xt){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let T=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(t=>T.delete(t)),T}static get TYPE_MAPPING(){return new Map([...N.TYPE_MAPPING,["int","INTEGER"],["smallint","INTEGER"],["tinyint","INTEGER"],["binary","VARBINARY"],["text","VARCHAR"],["nchar","VARCHAR"],["timestampltz","TIMESTAMP"],["timestamptz","TIMESTAMP"],["datetime","TIMESTAMP"]])}static get PROPERTIES_LOCATION(){return new Map([...N.PROPERTIES_LOCATION,[h,"postSchema"],[Y,"unsupported"]])}static get ORIGINAL_TRANSFORMS(){return new Map([...N.TRANSFORMS,[B,()=>"CURRENT_TIMESTAMP"],[q,S("REPEATED_CONTAINS")],[U,x([rt])],[K,y("ADD")],[b,It],[$,y("SUB")],[k,function(t){return`CAST(TO_DATE(${this.sql(t,"this")}, ${s.DATEINT_FORMAT}) AS INT)`}],[J,function(t){return`TO_DATE(CAST(${this.sql(t,"this")} AS VARCHAR), ${s.DATEINT_FORMAT})`}],[X,function(t){return`\`IF\`(${this.formatArgs([t.args.this,t.args.true,t.args.false])})`}],[w,function(t){return this.binary(t,"`ILIKE`")}],[P,function(t){return nt.call(this,t,"insCost","delCost","subCost","maxDist"),S("LEVENSHTEIN_DISTANCE").call(this,t)}],[h,function(t){return`PARTITION BY ${this.sql(t,"this")}`}],[v,S("REGEXP_MATCHES")],[j,function(t){return this.strToDate(t)}],[Z,S("POW")],[H,x([Et,it])],[W,At],[Q,function(t){return this.func("TO_TIMESTAMP",[t.args.this,this.formatTime(t)])}],[l,function(t){return this.sql(new m({this:t.args.this,to:new u({this:"date"})}))}],[C,ot],[tt,S("UNIX_TIMESTAMP")],[f,function(t){return this.func("TO_CHAR",[t.args.this,this.formatTime(t)])}],[z,S("UNIX_TIMESTAMP")],[G,function(t){return this.functionFallbackSql(t)}],[et,St],[st,function(t){return`DATE_ADD(CAST(${this.sql(t,"this")} AS DATE), ${this.sql(new D({this:t.args.expression,unit:new F({this:"DAY"})}))})`}],[Tt,function(t){return`CAST(SUBSTR(REPLACE(CAST(${this.sql(t,"this")} AS VARCHAR), '-', ''), 1, 8) AS INT)`}]])}strToDate(T){let t=this.sql(T,"this"),g=this.formatTime(T);return g===s.DATE_FORMAT?this.sql(new m({this:T.args.this,to:new u({this:"date"})})):this.func("TO_DATE",[t,g])}};o=I(xt),E(o,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",Ct,e),E(o,10,"TYPE_MAPPING",ft,e),E(o,10,"PROPERTIES_LOCATION",Pt,e),E(o,10,"ORIGINAL_TRANSFORMS",mt,e),R(o,e),c(o,3,e),e.SUPPORTS_DECODE_CASE=!1,e.SELECT_KINDS=[],e.TRY_SUPPORTED=!1,e.SUPPORTS_UESCAPE=!1,e.JOIN_HINTS=!1,e.TABLE_HINTS=!1,e.QUERY_HINTS=!1,e.NVL2_SUPPORTED=!1,e.LAST_DAY_SUPPORTS_DATE_PART=!1,e.SUPPORTS_CREATE_TABLE_LIKE=!1,e.ARRAY_SIZE_NAME="REPEATED_COUNT";var Lt,dt,yt,gt,p,s=class extends(gt=L,yt=[i],dt=[i],Lt=[i],gt){static get NORMALIZE_FUNCTIONS(){return""}static get NULL_ORDERING(){return"nulls_are_last"}static get TIME_MAPPING(){return{y:"%Y",Y:"%Y",YYYY:"%Y",yyyy:"%Y",YY:"%y",yy:"%y",MMMM:"%B",MMM:"%b",MM:"%m",M:"%-m",dd:"%d",d:"%-d",HH:"%H",H:"%-H",hh:"%I",h:"%-I",mm:"%M",m:"%-M",ss:"%S",s:"%-S",SSSSSS:"%f",a:"%p",DD:"%j",D:"%-j",E:"%a",EE:"%a",EEE:"%a",EEEE:"%A","''T''":"T"}}};p=I(gt),E(p,10,"NORMALIZE_FUNCTIONS",yt,s),E(p,10,"NULL_ORDERING",dt,s),E(p,10,"TIME_MAPPING",Lt,s),R(p,s),c(p,3,s),s.DIALECT_NAME="drill",s.PRESERVE_ORIGINAL_NAMES=!0,s.DATE_FORMAT="'yyyy-MM-dd'",s.DATEINT_FORMAT="'yyyyMMdd'",s.TIME_FORMAT="'yyyy-MM-dd HH:mm:ss'",s.SUPPORTS_USER_DEFINED_TYPES=!1,s.SUPPORTS_SEMI_ANTI_JOIN=!1,s.TYPED_DIVISION=!0,s.CONCAT_COALESCE=!0,s.Tokenizer=n,s.Parser=r,s.Generator=e;L.register("drill",s);export{s as Drill};
2
+ //# sourceMappingURL=drill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/dialects/drill.ts"],"sourcesContent":["import {\n cache,\n} from '../port_internals';\nimport type {\n Expression,\n} from '../expressions';\nimport {\n ArrayContainsExpr,\n ArraySizeExpr,\n CastExpr,\n CreateExpr,\n CurrentTimestampExpr,\n DataTypeExpr,\n DataTypeExprKind,\n DateAddExpr,\n DateStrToDateExpr,\n DateSubExpr,\n DateToDiExpr,\n DiToDateExpr,\n IfExpr,\n ILikeExpr,\n IntervalExpr,\n LevenshteinExpr,\n PartitionedByPropertyExpr,\n PowExpr,\n PropertiesLocation,\n RegexpLikeExpr,\n SelectExpr,\n StrPositionExpr,\n StrToDateExpr,\n StrToTimeExpr,\n TimeStrToDateExpr,\n TimeStrToTimeExpr,\n TimeStrToUnixExpr,\n TimeToStrExpr,\n TimeToUnixExpr,\n ToCharExpr,\n TryCastExpr,\n TsOrDiToDiExpr,\n TsOrDsAddExpr,\n VarExpr,\n VolatilePropertyExpr,\n} from '../expressions';\nimport {\n Generator, unsupportedArgs,\n} from '../generator';\nimport {\n Parser,\n} from '../parser';\nimport {\n TokenType, Tokenizer,\n} from '../tokens';\nimport {\n eliminateDistinctOn, eliminateSemiAndAntiJoins, moveSchemaColumnsToPartitionedBy, preprocess,\n} from '../transforms';\nimport {\n buildFormattedTime,\n dateStrToDateSql,\n Dialect, Dialects,\n noTrycastSql,\n renameFunc,\n strPositionSql,\n timeStrToTimeSql,\n NullOrdering,\n NormalizeFunctions,\n} from './dialect';\nimport {\n dateAddSql,\n} from './mysql';\n\nclass DrillTokenizer extends Tokenizer {\n @cache\n static get IDENTIFIERS () {\n return [\n '`',\n ];\n }\n\n @cache\n static get STRING_ESCAPES () {\n return [\n '\\\\',\n ];\n }\n\n @cache\n static get KEYWORDS (): Record<string, TokenType> {\n const keywords = {\n ...Tokenizer.KEYWORDS,\n };\n delete keywords['/*+'];\n return keywords;\n }\n}\n\nclass DrillParser extends Parser {\n @cache\n static get ID_VAR_TOKENS (): Set<TokenType> {\n return new Set([\n ...Parser.ID_VAR_TOKENS,\n TokenType.SESSION_USER,\n TokenType.CURRENT_CATALOG,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get NO_PAREN_FUNCTIONS () {\n const noParenFunctions = {\n ...Parser.NO_PAREN_FUNCTIONS,\n };\n delete noParenFunctions[TokenType.LOCALTIME];\n delete noParenFunctions[TokenType.LOCALTIMESTAMP];\n return noParenFunctions;\n }\n\n static STRICT_CAST = false;\n static LOG_DEFAULTS_TO_LN = true;\n @cache\n static get FUNCTIONS (): Record<string, (args: Expression[], options: {dialect: Dialect}) => Expression> {\n return {\n ...Parser.FUNCTIONS,\n REPEATED_COUNT: (args: unknown[]) => ArraySizeExpr.fromArgList(args),\n TO_TIMESTAMP: (args: unknown[]) => TimeStrToTimeExpr.fromArgList(args),\n TO_CHAR: buildFormattedTime(TimeToStrExpr, {\n dialect: 'drill',\n }),\n LEVENSHTEIN_DISTANCE: (args: unknown[]) => LevenshteinExpr.fromArgList(args),\n };\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get TABLE_ALIAS_TOKENS (): Set<TokenType> {\n return new Set([\n ...Parser.TABLE_ALIAS_TOKENS,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n}\nclass DrillGenerator extends Generator {\n // port from _Dialect metaclass logic\n @cache\n static get AFTER_HAVING_MODIFIER_TRANSFORMS () {\n const modifiers = new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);\n [\n 'cluster',\n 'distribute',\n 'sort',\n ].forEach((m) => modifiers.delete(m));\n return modifiers;\n }\n\n // port from _Dialect metaclass logic\n static SUPPORTS_DECODE_CASE = false;\n // port from _Dialect metaclass logic\n static readonly SELECT_KINDS: string[] = [\n ];\n // port from _Dialect metaclass logic\n static TRY_SUPPORTED = false;\n // port from _Dialect metaclass logic\n static SUPPORTS_UESCAPE = false;\n static JOIN_HINTS = false;\n static TABLE_HINTS = false;\n static QUERY_HINTS = false;\n static NVL2_SUPPORTED = false;\n static LAST_DAY_SUPPORTS_DATE_PART = false;\n static SUPPORTS_CREATE_TABLE_LIKE = false;\n static ARRAY_SIZE_NAME = 'REPEATED_COUNT';\n\n @cache\n static get TYPE_MAPPING () {\n return new Map([\n ...Generator.TYPE_MAPPING,\n [\n DataTypeExprKind.INT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.SMALLINT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.TINYINT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.BINARY,\n 'VARBINARY',\n ],\n [\n DataTypeExprKind.TEXT,\n 'VARCHAR',\n ],\n [\n DataTypeExprKind.NCHAR,\n 'VARCHAR',\n ],\n [\n DataTypeExprKind.TIMESTAMPLTZ,\n 'TIMESTAMP',\n ],\n [\n DataTypeExprKind.TIMESTAMPTZ,\n 'TIMESTAMP',\n ],\n [\n DataTypeExprKind.DATETIME,\n 'TIMESTAMP',\n ],\n ]);\n }\n\n @cache\n static get PROPERTIES_LOCATION () {\n return new Map<typeof Expression, PropertiesLocation>([\n ...Generator.PROPERTIES_LOCATION,\n [\n PartitionedByPropertyExpr,\n PropertiesLocation.POST_SCHEMA,\n ],\n [\n VolatilePropertyExpr,\n PropertiesLocation.UNSUPPORTED,\n ],\n ]);\n }\n\n @cache\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static get ORIGINAL_TRANSFORMS (): Map<typeof Expression, (this: Generator, e: any) => string> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const transforms = new Map<typeof Expression, (this: Generator, e: any) => string>([\n ...Generator.TRANSFORMS,\n [\n CurrentTimestampExpr,\n () => 'CURRENT_TIMESTAMP',\n ],\n [\n ArrayContainsExpr,\n renameFunc('REPEATED_CONTAINS'),\n ],\n [\n CreateExpr,\n preprocess([\n moveSchemaColumnsToPartitionedBy,\n ]),\n ],\n [\n DateAddExpr,\n dateAddSql('ADD'),\n ],\n [\n DateStrToDateExpr,\n dateStrToDateSql,\n ],\n [\n DateSubExpr,\n dateAddSql('SUB'),\n ],\n [\n DateToDiExpr,\n function (this: Generator, e) {\n return `CAST(TO_DATE(${this.sql(e, 'this')}, ${Drill.DATEINT_FORMAT}) AS INT)`;\n },\n ],\n [\n DiToDateExpr,\n function (this: Generator, e) {\n return `TO_DATE(CAST(${this.sql(e, 'this')} AS VARCHAR), ${Drill.DATEINT_FORMAT})`;\n },\n ],\n [\n IfExpr,\n function (this: Generator, e) {\n return `\\`IF\\`(${this.formatArgs([\n e.args.this,\n e.args.true,\n e.args.false,\n ])})`;\n },\n ],\n [\n ILikeExpr,\n function (this: Generator, e) {\n return this.binary(e, '`ILIKE`');\n },\n ],\n [\n LevenshteinExpr,\n function (this: Generator, e) {\n unsupportedArgs.call(this, e, 'insCost', 'delCost', 'subCost', 'maxDist');\n return renameFunc('LEVENSHTEIN_DISTANCE').call(this, e);\n },\n ],\n [\n PartitionedByPropertyExpr,\n function (this: Generator, e) {\n return `PARTITION BY ${this.sql(e, 'this')}`;\n },\n ],\n [\n RegexpLikeExpr,\n renameFunc('REGEXP_MATCHES'),\n ],\n [\n StrToDateExpr,\n function (this: Generator, e) {\n return (this as DrillGenerator).strToDate(e);\n },\n ],\n [\n PowExpr,\n renameFunc('POW'),\n ],\n [\n SelectExpr,\n preprocess([\n eliminateDistinctOn,\n eliminateSemiAndAntiJoins,\n ]),\n ],\n [\n StrPositionExpr,\n strPositionSql,\n ],\n [\n StrToTimeExpr,\n function (this: Generator, e) {\n return this.func('TO_TIMESTAMP', [\n e.args.this,\n this.formatTime(e),\n ]);\n },\n ],\n [\n TimeStrToDateExpr,\n function (this: Generator, e) {\n return this.sql(new CastExpr({\n this: e.args.this,\n to: new DataTypeExpr({\n this: DataTypeExprKind.DATE,\n }),\n }));\n },\n ],\n [\n TimeStrToTimeExpr,\n timeStrToTimeSql,\n ],\n [\n TimeStrToUnixExpr,\n renameFunc('UNIX_TIMESTAMP'),\n ],\n [\n TimeToStrExpr,\n function (this: Generator, e) {\n return this.func('TO_CHAR', [\n e.args.this,\n this.formatTime(e),\n ]);\n },\n ],\n [\n TimeToUnixExpr,\n renameFunc('UNIX_TIMESTAMP'),\n ],\n [\n ToCharExpr,\n function (this: Generator, e) {\n return this.functionFallbackSql(e);\n },\n ],\n [\n TryCastExpr,\n noTrycastSql,\n ],\n [\n TsOrDsAddExpr,\n function (this: Generator, e) {\n return `DATE_ADD(CAST(${this.sql(e, 'this')} AS DATE), ${this.sql(new IntervalExpr({\n this: e.args.expression,\n unit: new VarExpr({\n this: 'DAY',\n }),\n }))})`;\n },\n ],\n [\n TsOrDiToDiExpr,\n function (this: Generator, e) {\n return `CAST(SUBSTR(REPLACE(CAST(${this.sql(e, 'this')} AS VARCHAR), '-', ''), 1, 8) AS INT)`;\n },\n ],\n ]);\n return transforms;\n }\n\n strToDate (expression: StrToDateExpr): string {\n const thisSql = this.sql(expression, 'this');\n const timeFormat = this.formatTime(expression);\n if (timeFormat === Drill.DATE_FORMAT) {\n return this.sql(new CastExpr({\n this: expression.args.this,\n to: new DataTypeExpr({\n this: DataTypeExprKind.DATE,\n }),\n }));\n }\n return this.func('TO_DATE', [\n thisSql,\n timeFormat,\n ]);\n }\n}\n\nexport class Drill extends Dialect {\n static DIALECT_NAME = Dialects.DRILL;\n\n @cache\n static get NORMALIZE_FUNCTIONS () {\n return NormalizeFunctions.NONE;\n }\n\n static PRESERVE_ORIGINAL_NAMES = true;\n\n @cache\n static get NULL_ORDERING () {\n return NullOrdering.NULLS_ARE_LAST;\n }\n\n static DATE_FORMAT = '\\'yyyy-MM-dd\\'';\n static DATEINT_FORMAT = '\\'yyyyMMdd\\'';\n static TIME_FORMAT = '\\'yyyy-MM-dd HH:mm:ss\\'';\n static SUPPORTS_USER_DEFINED_TYPES = false;\n static SUPPORTS_SEMI_ANTI_JOIN = false;\n static TYPED_DIVISION = true;\n static CONCAT_COALESCE = true;\n\n @cache\n static get TIME_MAPPING () {\n return {\n 'y': '%Y',\n 'Y': '%Y',\n 'YYYY': '%Y',\n 'yyyy': '%Y',\n 'YY': '%y',\n 'yy': '%y',\n 'MMMM': '%B',\n 'MMM': '%b',\n 'MM': '%m',\n 'M': '%-m',\n 'dd': '%d',\n 'd': '%-d',\n 'HH': '%H',\n 'H': '%-H',\n 'hh': '%I',\n 'h': '%-I',\n 'mm': '%M',\n 'm': '%-M',\n 'ss': '%S',\n 's': '%-S',\n 'SSSSSS': '%f',\n 'a': '%p',\n 'DD': '%j',\n 'D': '%-j',\n 'E': '%a',\n 'EE': '%a',\n 'EEE': '%a',\n 'EEEE': '%A',\n '\\'\\'T\\'\\'': 'T',\n };\n }\n\n static Tokenizer = DrillTokenizer;\n static Parser = DrillParser;\n static Generator = DrillGenerator;\n}\n\nDialect.register(Dialects.DRILL, Drill);\n"],"mappings":"sfAAA,IAAAA,GAAAC,GAAAC,GAAAC,GAAAC,EAsEMC,EAAN,cAA6BF,GAAAG,EAC3BJ,GAAA,CAACK,GAODN,GAAA,CAACM,GAODP,GAAA,CAACO,GAf0BJ,GAAU,CAErC,WAAW,aAAe,CACxB,MAAO,CACL,GACF,CACF,CAGA,WAAW,gBAAkB,CAC3B,MAAO,CACL,IACF,CACF,CAGA,WAAW,UAAuC,CAChD,IAAMK,EAAW,CACf,GAAGF,EAAU,QACf,EACA,cAAOE,EAAS,KAAK,EACdA,CACT,CACF,EAvBAJ,EAAAK,EAAAN,IAEEO,EAAAN,EAAA,GAAW,cADXF,GADIG,GASJK,EAAAN,EAAA,GAAW,iBADXH,GARII,GAgBJK,EAAAN,EAAA,GAAW,WADXJ,GAfIK,GAANM,EAAAP,EAAMC,GAANO,EAAAR,EAAA,EAAMC,GAtEN,IAAAQ,GAAAC,GAAAC,GAAAC,GAAAb,GAAAC,EA+FMa,EAAN,cAA0Bd,GAAAe,EACxBF,GAAA,CAACT,GAWDQ,GAAA,CAACR,GAYDO,GAAA,CAACP,GAcDM,GAAA,CAACN,GAtCuBJ,GAAO,CAE/B,WAAW,eAAiC,CAC1C,OAAO,IAAI,IAAI,C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EAAK,KACL,GAAM,KACN,EAAK,MACL,EAAK,KACL,GAAM,KACN,IAAO,KACP,KAAQ,KACR,QAAa,GACf,CACF,CAKF,EA7DOC,EAAAK,EAAAN,IAILO,EAAAN,EAAA,GAAW,sBADX6E,GAHWhC,GAWXvC,EAAAN,EAAA,GAAW,gBADX4E,GAVW/B,GAwBXvC,EAAAN,EAAA,GAAW,eADX2E,GAvBW9B,GAANtC,EAAAP,EAAM6C,GAANrC,EAAAR,EAAA,EAAM6C,KACJ,aAAe,QADXA,EAQJ,wBAA0B,GARtBA,EAeJ,YAAc,eAfVA,EAgBJ,eAAiB,aAhBbA,EAiBJ,YAAc,wBAjBVA,EAkBJ,4BAA8B,GAlB1BA,EAmBJ,wBAA0B,GAnBtBA,EAoBJ,eAAiB,GApBbA,EAqBJ,gBAAkB,GArBdA,EA0DJ,UAAY5C,EA1DR4C,EA2DJ,OAAShC,EA3DLgC,EA4DJ,UAAYnB,EAGrBoD,EAAQ,iBAAyBjC,CAAK","names":["_KEYWORDS_dec","_STRING_ESCAPES_dec","_IDENTIFIERS_dec","_a","_init","DrillTokenizer","Tokenizer","cache","keywords","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","_TABLE_ALIAS_TOKENS_dec","_FUNCTIONS_dec","_NO_PAREN_FUNCTIONS_dec","_ID_VAR_TOKENS_dec","DrillParser","Parser","noParenFunctions","args","ArraySizeExpr","TimeStrToTimeExpr","buildFormattedTime","TimeToStrExpr","LevenshteinExpr","_ORIGINAL_TRANSFORMS_dec","_PROPERTIES_LOCATION_dec","_TYPE_MAPPING_dec","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","DrillGenerator","Generator","modifiers","m","PartitionedByPropertyExpr","VolatilePropertyExpr","CurrentTimestampExpr","ArrayContainsExpr","renameFunc","CreateExpr","preprocess","moveSchemaColumnsToPartitionedBy","DateAddExpr","dateAddSql","DateStrToDateExpr","dateStrToDateSql","DateSubExpr","DateToDiExpr","e","Drill","DiToDateExpr","IfExpr","ILikeExpr","unsupportedArgs","RegexpLikeExpr","StrToDateExpr","PowExpr","SelectExpr","eliminateDistinctOn","eliminateSemiAndAntiJoins","StrPositionExpr","strPositionSql","StrToTimeExpr","TimeStrToDateExpr","CastExpr","DataTypeExpr","timeStrToTimeSql","TimeStrToUnixExpr","TimeToUnixExpr","ToCharExpr","TryCastExpr","noTrycastSql","TsOrDsAddExpr","IntervalExpr","VarExpr","TsOrDiToDiExpr","expression","thisSql","timeFormat","_TIME_MAPPING_dec","_NULL_ORDERING_dec","_NORMALIZE_FUNCTIONS_dec","Dialect"]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2Z3O2CFMcjs = require('../chunk-2Z3O2CFM.cjs');var M,N,m,x,e,s= exports.DruidGenerator =class extends(x=_chunk2Z3O2CFMcjs.lp,m=[_chunk2Z3O2CFMcjs.r],N=[_chunk2Z3O2CFMcjs.r],M=[_chunk2Z3O2CFMcjs.r],x){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let t=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(n=>t.delete(n)),t}static get TYPE_MAPPING(){let t=new Map(_chunk2Z3O2CFMcjs.lp.TYPE_MAPPING);return t.set("nchar","STRING"),t.set("nvarchar","STRING"),t.set("text","STRING"),t.set("uuid","STRING"),t}static get ORIGINAL_TRANSFORMS(){let t=new Map(_chunk2Z3O2CFMcjs.lp.TRANSFORMS);return t.set(_chunk2Z3O2CFMcjs.fh,()=>"CURRENT_TIMESTAMP"),t.set(_chunk2Z3O2CFMcjs.Pe,_chunk2Z3O2CFMcjs.pp.call(void 0, "MOD")),t.set(_chunk2Z3O2CFMcjs.Mf,function(n){return`ARRAY[${this.expressions(n)}]`}),t}};e=_chunk2Z3O2CFMcjs.a.call(void 0, x),_chunk2Z3O2CFMcjs.d.call(void 0, e,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",m,s),_chunk2Z3O2CFMcjs.d.call(void 0, e,10,"TYPE_MAPPING",N,s),_chunk2Z3O2CFMcjs.d.call(void 0, e,10,"ORIGINAL_TRANSFORMS",M,s),_chunk2Z3O2CFMcjs.b.call(void 0, e,s),_chunk2Z3O2CFMcjs.c.call(void 0, e,3,s),s.SUPPORTS_DECODE_CASE=!1,s.SELECT_KINDS=[],s.TRY_SUPPORTED=!1,s.SUPPORTS_UESCAPE=!1;var p=class extends _chunk2Z3O2CFMcjs.op{};p.DIALECT_NAME="druid",p.Generator=s;_chunk2Z3O2CFMcjs.op.register("druid",p);exports.Druid = p; exports.DruidGenerator = s;
2
+ //# sourceMappingURL=druid.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/huydna/projects/sqlingo.js/dist/dialects/druid.cjs","../../src/dialects/druid.ts"],"names":["_ORIGINAL_TRANSFORMS_dec","_TYPE_MAPPING_dec","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","_a","_init","DruidGenerator","Generator","cache","modifiers","m","mapping","CurrentTimestampExpr","ModExpr","renameFunc","ArrayExpr","e","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","Druid","Dialect"],"mappings":"AAAA,kIAAgH,ICAhHA,CAAAA,CAAAC,CAAAA,CAAAC,CAAAA,CAAAC,CAAAA,CAAAC,CAAAA,CAoBaC,CAAAA,0BAAN,MAAA,OAAA,CAA6BF,CAAAA,CAAAG,oBAAAA,CAClCJ,CAAAA,CAAA,CAACK,mBAAAA,CAAAA,CAqBDN,CAAAA,CAAA,CAACM,mBAAAA,CAAAA,CAUDP,CAAAA,CAAA,CAACO,mBAAAA,CAAAA,CAhCiCJ,CAAAA,CAAU,CAE5C,OAAA,IAAW,gCAAA,CAAA,CAAoC,CAC7C,IAAMK,CAAAA,CAAY,IAAI,GAAA,CAAI,KAAA,CAAM,gCAAgC,CAAA,CAChE,MAAA,CACE,SAAA,CACA,YAAA,CACA,MACF,CAAA,CAAE,OAAA,CAASC,CAAAA,EAAMD,CAAAA,CAAU,MA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,iCAAAA,CAAAf,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAaJ,oBAAA,CAAuB,CAAA,CAAA,CAbnBA,CAAAA,CAeK,YAAA,CAAyB,CACzC,CAAA,CAhBWA,CAAAA,CAkBJ,aAAA,CAAgB,CAAA,CAAA,CAlBZA,CAAAA,CAoBJ,gBAAA,CAAmB,CAAA,CAAA,CAwBrB,IAAMe,CAAAA,CAAN,MAAA,QAAoBC,oBAAQ,CAGnC,CAAA,CAHaD,CAAAA,CACJ,YAAA,CAAe,OAAA,CADXA,CAAAA,CAEJ,SAAA,CAAYf,CAAAA,CAGrBgB,oBAAAA,CAAQ,QAAA,CAAA,OAAA,CAAyBD,CAAK,CAAA,CAAA,8CAAA","file":"/home/huydna/projects/sqlingo.js/dist/dialects/druid.cjs","sourcesContent":[null,"import {\n Generator,\n} from '../generator';\nimport type {\n Expression,\n} from '../expressions';\nimport {\n CurrentTimestampExpr,\n ModExpr,\n ArrayExpr,\n DataTypeExprKind,\n} from '../expressions';\nimport {\n cache,\n} from '../port_internals';\nimport {\n Dialect, Dialects,\n renameFunc,\n} from './dialect';\n\nexport class DruidGenerator extends Generator {\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 @cache\n static get TYPE_MAPPING (): Map<DataTypeExprKind | string, string> {\n const mapping = new Map(Generator.TYPE_MAPPING);\n mapping.set(DataTypeExprKind.NCHAR, 'STRING');\n mapping.set(DataTypeExprKind.NVARCHAR, 'STRING');\n mapping.set(DataTypeExprKind.TEXT, 'STRING');\n mapping.set(DataTypeExprKind.UUID, 'STRING');\n return mapping;\n }\n\n @cache\n static get ORIGINAL_TRANSFORMS (): Map<typeof Expression, (this: Generator, e: Expression) => string> {\n const m = new Map<typeof Expression, (this: Generator, e: Expression) => string>(Generator.TRANSFORMS);\n m.set(CurrentTimestampExpr, () => 'CURRENT_TIMESTAMP');\n m.set(ModExpr, renameFunc('MOD'));\n m.set(ArrayExpr, function (this: Generator, e) {\n return `ARRAY[${this.expressions(e)}]`;\n });\n return m;\n };\n}\n\nexport class Druid extends Dialect {\n static DIALECT_NAME = Dialects.DRUID;\n static Generator = DruidGenerator;\n}\n\nDialect.register(Dialects.DRUID, Druid);\n"]}
@@ -0,0 +1,17 @@
1
+ import { c as Dialect, d as Dialects, G as Generator, E as Expression, $ as DataTypeExprKind } from '../tokens-VcMD09XM.cjs';
2
+
3
+ declare class DruidGenerator extends Generator {
4
+ static get AFTER_HAVING_MODIFIER_TRANSFORMS(): Map<string, (this: Generator, e: Expression) => string>;
5
+ static SUPPORTS_DECODE_CASE: boolean;
6
+ static readonly SELECT_KINDS: string[];
7
+ static TRY_SUPPORTED: boolean;
8
+ static SUPPORTS_UESCAPE: boolean;
9
+ static get TYPE_MAPPING(): Map<DataTypeExprKind | string, string>;
10
+ static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: Expression) => string>;
11
+ }
12
+ declare class Druid extends Dialect {
13
+ static DIALECT_NAME: Dialects;
14
+ static Generator: typeof DruidGenerator;
15
+ }
16
+
17
+ export { Druid, DruidGenerator };
@@ -0,0 +1,17 @@
1
+ import { c as Dialect, d as Dialects, G as Generator, E as Expression, $ as DataTypeExprKind } from '../tokens-VcMD09XM.js';
2
+
3
+ declare class DruidGenerator extends Generator {
4
+ static get AFTER_HAVING_MODIFIER_TRANSFORMS(): Map<string, (this: Generator, e: Expression) => string>;
5
+ static SUPPORTS_DECODE_CASE: boolean;
6
+ static readonly SELECT_KINDS: string[];
7
+ static TRY_SUPPORTED: boolean;
8
+ static SUPPORTS_UESCAPE: boolean;
9
+ static get TYPE_MAPPING(): Map<DataTypeExprKind | string, string>;
10
+ static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: Expression) => string>;
11
+ }
12
+ declare class Druid extends Dialect {
13
+ static DIALECT_NAME: Dialects;
14
+ static Generator: typeof DruidGenerator;
15
+ }
16
+
17
+ export { Druid, DruidGenerator };
@@ -0,0 +1,2 @@
1
+ import{Mf as A,Pe as c,a,b as T,c as o,d as E,fh as S,lp as i,op as r,pp as I,r as R}from"../chunk-KCNOE4DZ.js";var M,N,m,x,e,s=class extends(x=i,m=[R],N=[R],M=[R],x){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let t=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(n=>t.delete(n)),t}static get TYPE_MAPPING(){let t=new Map(i.TYPE_MAPPING);return t.set("nchar","STRING"),t.set("nvarchar","STRING"),t.set("text","STRING"),t.set("uuid","STRING"),t}static get ORIGINAL_TRANSFORMS(){let t=new Map(i.TRANSFORMS);return t.set(S,()=>"CURRENT_TIMESTAMP"),t.set(c,I("MOD")),t.set(A,function(n){return`ARRAY[${this.expressions(n)}]`}),t}};e=a(x),E(e,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",m,s),E(e,10,"TYPE_MAPPING",N,s),E(e,10,"ORIGINAL_TRANSFORMS",M,s),T(e,s),o(e,3,s),s.SUPPORTS_DECODE_CASE=!1,s.SELECT_KINDS=[],s.TRY_SUPPORTED=!1,s.SUPPORTS_UESCAPE=!1;var p=class extends r{};p.DIALECT_NAME="druid",p.Generator=s;r.register("druid",p);export{p as Druid,s as DruidGenerator};
2
+ //# sourceMappingURL=druid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/dialects/druid.ts"],"sourcesContent":["import {\n Generator,\n} from '../generator';\nimport type {\n Expression,\n} from '../expressions';\nimport {\n CurrentTimestampExpr,\n ModExpr,\n ArrayExpr,\n DataTypeExprKind,\n} from '../expressions';\nimport {\n cache,\n} from '../port_internals';\nimport {\n Dialect, Dialects,\n renameFunc,\n} from './dialect';\n\nexport class DruidGenerator extends Generator {\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 @cache\n static get TYPE_MAPPING (): Map<DataTypeExprKind | string, string> {\n const mapping = new Map(Generator.TYPE_MAPPING);\n mapping.set(DataTypeExprKind.NCHAR, 'STRING');\n mapping.set(DataTypeExprKind.NVARCHAR, 'STRING');\n mapping.set(DataTypeExprKind.TEXT, 'STRING');\n mapping.set(DataTypeExprKind.UUID, 'STRING');\n return mapping;\n }\n\n @cache\n static get ORIGINAL_TRANSFORMS (): Map<typeof Expression, (this: Generator, e: Expression) => string> {\n const m = new Map<typeof Expression, (this: Generator, e: Expression) => string>(Generator.TRANSFORMS);\n m.set(CurrentTimestampExpr, () => 'CURRENT_TIMESTAMP');\n m.set(ModExpr, renameFunc('MOD'));\n m.set(ArrayExpr, function (this: Generator, e) {\n return `ARRAY[${this.expressions(e)}]`;\n });\n return m;\n };\n}\n\nexport class Druid extends Dialect {\n static DIALECT_NAME = Dialects.DRUID;\n static Generator = DruidGenerator;\n}\n\nDialect.register(Dialects.DRUID, Druid);\n"],"mappings":"gHAAA,IAAAA,EAAAC,EAAAC,EAAAC,EAAAC,EAoBaC,EAAN,cAA6BF,EAAAG,EAClCJ,EAAA,CAACK,GAqBDN,EAAA,CAACM,GAUDP,EAAA,CAACO,GAhCiCJ,EAAU,CAE5C,WAAW,kCAAoC,CAC7C,IAAMK,EAAY,IAAI,IAAI,MAAM,gCAAgC,EAChE,OACE,UACA,aACA,MACF,EAAE,QAASC,GAAMD,EAAU,OAAOC,CAAC,CAAC,EAC7BD,CACT,CAaA,WAAW,cAAwD,CACjE,IAAME,EAAU,IAAI,IAAIJ,EAAU,YAAY,EAC9C,OAAAI,EAAQ,YAA4B,QAAQ,EAC5CA,EAAQ,eAA+B,QAAQ,EAC/CA,EAAQ,WAA2B,QAAQ,EAC3CA,EAAQ,WAA2B,QAAQ,EACpCA,CACT,CAGA,WAAW,qBAA2F,CACpG,IAAMD,EAAI,IAAI,IAAmEH,EAAU,UAAU,EACrG,OAAAG,EAAE,IAAIE,EAAsB,IAAM,mBAAmB,EACrDF,EAAE,IAAIG,EAASC,EAAW,KAAK,CAAC,EAChCJ,EAAE,IAAIK,EAAW,SAA2BC,EAAG,CAC7C,MAAO,SAAS,KAAK,YAAYA,CAAC,CAAC,GACrC,CAAC,EACMN,CACT,CACF,EA1COL,EAAAY,EAAAb,GAELc,EAAAb,EAAA,GAAW,mCADXF,EADWG,GAuBXY,EAAAb,EAAA,GAAW,eADXH,EAtBWI,GAiCXY,EAAAb,EAAA,GAAW,sBADXJ,EAhCWK,GAANa,EAAAd,EAAMC,GAANc,EAAAf,EAAA,EAAMC,KAaJ,qBAAuB,GAbnBA,EAeK,aAAyB,CACzC,EAhBWA,EAkBJ,cAAgB,GAlBZA,EAoBJ,iBAAmB,GAwBrB,IAAMe,EAAN,cAAoBC,CAAQ,CAGnC,EAHaD,EACJ,aAAe,QADXA,EAEJ,UAAYf,EAGrBgB,EAAQ,iBAAyBD,CAAK","names":["_ORIGINAL_TRANSFORMS_dec","_TYPE_MAPPING_dec","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","_a","_init","DruidGenerator","Generator","cache","modifiers","m","mapping","CurrentTimestampExpr","ModExpr","renameFunc","ArrayExpr","e","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","Druid","Dialect"]}