@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.
Files changed (245) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +8 -14
  3. package/README.npm.md +8 -14
  4. package/README.repo.md +1 -2
  5. package/dist/chunk-2YNOERAO.cjs +2 -0
  6. package/dist/chunk-2YNOERAO.cjs.map +1 -0
  7. package/dist/chunk-2Z3O2CFM.cjs +19 -0
  8. package/dist/chunk-2Z3O2CFM.cjs.map +1 -0
  9. package/dist/chunk-4ZMKB6PV.cjs +2 -0
  10. package/dist/chunk-4ZMKB6PV.cjs.map +1 -0
  11. package/dist/chunk-53OWF4GG.js +2 -0
  12. package/dist/chunk-53OWF4GG.js.map +1 -0
  13. package/dist/chunk-C4CLTVOW.cjs +2 -0
  14. package/dist/chunk-C4CLTVOW.cjs.map +1 -0
  15. package/dist/chunk-DOKMTZYO.cjs +4 -0
  16. package/dist/chunk-DOKMTZYO.cjs.map +1 -0
  17. package/dist/chunk-FCGUTI7Y.js +2 -0
  18. package/dist/chunk-FCGUTI7Y.js.map +1 -0
  19. package/dist/chunk-IPCIXWCY.js +2 -0
  20. package/dist/chunk-IPCIXWCY.js.map +1 -0
  21. package/dist/chunk-KCNOE4DZ.js +19 -0
  22. package/dist/chunk-KCNOE4DZ.js.map +1 -0
  23. package/dist/chunk-NRJHX2GZ.js +2 -0
  24. package/dist/chunk-NRJHX2GZ.js.map +1 -0
  25. package/dist/chunk-O2J5RKBN.js +2 -0
  26. package/dist/chunk-O2J5RKBN.js.map +1 -0
  27. package/dist/chunk-PXUASP5I.js +2 -0
  28. package/dist/chunk-PXUASP5I.js.map +1 -0
  29. package/dist/chunk-R7C3ZHVK.cjs +2 -0
  30. package/dist/chunk-R7C3ZHVK.cjs.map +1 -0
  31. package/dist/chunk-UHWHUDLE.cjs +2 -0
  32. package/dist/chunk-UHWHUDLE.cjs.map +1 -0
  33. package/dist/chunk-WRNYJ54A.cjs +2 -0
  34. package/dist/chunk-WRNYJ54A.cjs.map +1 -0
  35. package/dist/chunk-XZQFOICX.cjs +3 -0
  36. package/dist/chunk-XZQFOICX.cjs.map +1 -0
  37. package/dist/chunk-YLOQRUXC.js +2 -0
  38. package/dist/chunk-YLOQRUXC.js.map +1 -0
  39. package/dist/chunk-YSS2WVCM.cjs +2 -0
  40. package/dist/chunk-YSS2WVCM.cjs.map +1 -0
  41. package/dist/chunk-Z5V6VOIN.js +3 -0
  42. package/dist/chunk-Z5V6VOIN.js.map +1 -0
  43. package/dist/chunk-ZBFGQPJR.js +4 -0
  44. package/dist/chunk-ZBFGQPJR.js.map +1 -0
  45. package/dist/dialects/athena.cjs +2 -0
  46. package/dist/dialects/athena.cjs.map +1 -0
  47. package/dist/dialects/athena.d.cts +66 -0
  48. package/dist/dialects/athena.d.ts +66 -0
  49. package/dist/dialects/athena.js +2 -0
  50. package/dist/dialects/athena.js.map +1 -0
  51. package/dist/dialects/bigquery.cjs +3 -0
  52. package/dist/dialects/bigquery.cjs.map +1 -0
  53. package/dist/dialects/bigquery.d.cts +651 -0
  54. package/dist/dialects/bigquery.d.ts +651 -0
  55. package/dist/dialects/bigquery.js +3 -0
  56. package/dist/dialects/bigquery.js.map +1 -0
  57. package/dist/dialects/clickhouse.cjs +2 -0
  58. package/dist/dialects/clickhouse.cjs.map +1 -0
  59. package/dist/dialects/clickhouse.d.cts +634 -0
  60. package/dist/dialects/clickhouse.d.ts +634 -0
  61. package/dist/dialects/clickhouse.js +2 -0
  62. package/dist/dialects/clickhouse.js.map +1 -0
  63. package/dist/dialects/databricks.cjs +2 -0
  64. package/dist/dialects/databricks.cjs.map +1 -0
  65. package/dist/dialects/databricks.d.cts +484 -0
  66. package/dist/dialects/databricks.d.ts +484 -0
  67. package/dist/dialects/databricks.js +2 -0
  68. package/dist/dialects/databricks.js.map +1 -0
  69. package/dist/dialects/doris.cjs +2 -0
  70. package/dist/dialects/doris.cjs.map +1 -0
  71. package/dist/dialects/doris.d.cts +484 -0
  72. package/dist/dialects/doris.d.ts +484 -0
  73. package/dist/dialects/doris.js +2 -0
  74. package/dist/dialects/doris.js.map +1 -0
  75. package/dist/dialects/dremio.cjs +2 -0
  76. package/dist/dialects/dremio.cjs.map +1 -0
  77. package/dist/dialects/dremio.d.cts +522 -0
  78. package/dist/dialects/dremio.d.ts +522 -0
  79. package/dist/dialects/dremio.js +2 -0
  80. package/dist/dialects/dremio.js.map +1 -0
  81. package/dist/dialects/drill.cjs +2 -0
  82. package/dist/dialects/drill.cjs.map +1 -0
  83. package/dist/dialects/drill.d.cts +512 -0
  84. package/dist/dialects/drill.d.ts +512 -0
  85. package/dist/dialects/drill.js +2 -0
  86. package/dist/dialects/drill.js.map +1 -0
  87. package/dist/dialects/druid.cjs +2 -0
  88. package/dist/dialects/druid.cjs.map +1 -0
  89. package/dist/dialects/druid.d.cts +17 -0
  90. package/dist/dialects/druid.d.ts +17 -0
  91. package/dist/dialects/druid.js +2 -0
  92. package/dist/dialects/druid.js.map +1 -0
  93. package/dist/dialects/duckdb.cjs +86 -0
  94. package/dist/dialects/duckdb.cjs.map +1 -0
  95. package/dist/dialects/duckdb.d.cts +756 -0
  96. package/dist/dialects/duckdb.d.ts +756 -0
  97. package/dist/dialects/duckdb.js +86 -0
  98. package/dist/dialects/duckdb.js.map +1 -0
  99. package/dist/dialects/dune.cjs +2 -0
  100. package/dist/dialects/dune.cjs.map +1 -0
  101. package/dist/dialects/dune.d.cts +21 -0
  102. package/dist/dialects/dune.d.ts +21 -0
  103. package/dist/dialects/dune.js +2 -0
  104. package/dist/dialects/dune.js.map +1 -0
  105. package/dist/dialects/exasol.cjs +2 -0
  106. package/dist/dialects/exasol.cjs.map +1 -0
  107. package/dist/dialects/exasol.d.cts +507 -0
  108. package/dist/dialects/exasol.d.ts +507 -0
  109. package/dist/dialects/exasol.js +2 -0
  110. package/dist/dialects/exasol.js.map +1 -0
  111. package/dist/dialects/fabric.cjs +2 -0
  112. package/dist/dialects/fabric.cjs.map +1 -0
  113. package/dist/dialects/fabric.d.cts +463 -0
  114. package/dist/dialects/fabric.d.ts +463 -0
  115. package/dist/dialects/fabric.js +2 -0
  116. package/dist/dialects/fabric.js.map +1 -0
  117. package/dist/dialects/hive.cjs +2 -0
  118. package/dist/dialects/hive.cjs.map +1 -0
  119. package/dist/dialects/hive.d.cts +585 -0
  120. package/dist/dialects/hive.d.ts +585 -0
  121. package/dist/dialects/hive.js +2 -0
  122. package/dist/dialects/hive.js.map +1 -0
  123. package/dist/dialects/materialize.cjs +2 -0
  124. package/dist/dialects/materialize.cjs.map +1 -0
  125. package/dist/dialects/materialize.d.cts +890 -0
  126. package/dist/dialects/materialize.d.ts +890 -0
  127. package/dist/dialects/materialize.js +2 -0
  128. package/dist/dialects/materialize.js.map +1 -0
  129. package/dist/dialects/mysql.cjs +2 -0
  130. package/dist/dialects/mysql.cjs.map +1 -0
  131. package/dist/dialects/mysql.d.cts +292 -0
  132. package/dist/dialects/mysql.d.ts +292 -0
  133. package/dist/dialects/mysql.js +2 -0
  134. package/dist/dialects/mysql.js.map +1 -0
  135. package/dist/dialects/oracle.cjs +2 -0
  136. package/dist/dialects/oracle.cjs.map +1 -0
  137. package/dist/dialects/oracle.d.cts +539 -0
  138. package/dist/dialects/oracle.d.ts +539 -0
  139. package/dist/dialects/oracle.js +2 -0
  140. package/dist/dialects/oracle.js.map +1 -0
  141. package/dist/dialects/postgres.cjs +2 -0
  142. package/dist/dialects/postgres.cjs.map +1 -0
  143. package/dist/dialects/postgres.d.cts +587 -0
  144. package/dist/dialects/postgres.d.ts +587 -0
  145. package/dist/dialects/postgres.js +2 -0
  146. package/dist/dialects/postgres.js.map +1 -0
  147. package/dist/dialects/presto.cjs +2 -0
  148. package/dist/dialects/presto.cjs.map +1 -0
  149. package/dist/dialects/presto.d.cts +173 -0
  150. package/dist/dialects/presto.d.ts +173 -0
  151. package/dist/dialects/presto.js +2 -0
  152. package/dist/dialects/presto.js.map +1 -0
  153. package/dist/dialects/prql.cjs +2 -0
  154. package/dist/dialects/prql.cjs.map +1 -0
  155. package/dist/dialects/prql.d.cts +496 -0
  156. package/dist/dialects/prql.d.ts +496 -0
  157. package/dist/dialects/prql.js +2 -0
  158. package/dist/dialects/prql.js.map +1 -0
  159. package/dist/dialects/redshift.cjs +2 -0
  160. package/dist/dialects/redshift.cjs.map +1 -0
  161. package/dist/dialects/redshift.d.cts +132 -0
  162. package/dist/dialects/redshift.d.ts +132 -0
  163. package/dist/dialects/redshift.js +2 -0
  164. package/dist/dialects/redshift.js.map +1 -0
  165. package/dist/dialects/risingwave.cjs +2 -0
  166. package/dist/dialects/risingwave.cjs.map +1 -0
  167. package/dist/dialects/risingwave.d.cts +478 -0
  168. package/dist/dialects/risingwave.d.ts +478 -0
  169. package/dist/dialects/risingwave.js +2 -0
  170. package/dist/dialects/risingwave.js.map +1 -0
  171. package/dist/dialects/singlestore.cjs +2 -0
  172. package/dist/dialects/singlestore.cjs.map +1 -0
  173. package/dist/dialects/singlestore.d.cts +73 -0
  174. package/dist/dialects/singlestore.d.ts +73 -0
  175. package/dist/dialects/singlestore.js +2 -0
  176. package/dist/dialects/singlestore.js.map +1 -0
  177. package/dist/dialects/snowflake.cjs +3 -0
  178. package/dist/dialects/snowflake.cjs.map +1 -0
  179. package/dist/dialects/snowflake.d.cts +320 -0
  180. package/dist/dialects/snowflake.d.ts +320 -0
  181. package/dist/dialects/snowflake.js +3 -0
  182. package/dist/dialects/snowflake.js.map +1 -0
  183. package/dist/dialects/solr.cjs +2 -0
  184. package/dist/dialects/solr.cjs.map +1 -0
  185. package/dist/dialects/solr.d.cts +458 -0
  186. package/dist/dialects/solr.d.ts +458 -0
  187. package/dist/dialects/solr.js +2 -0
  188. package/dist/dialects/solr.js.map +1 -0
  189. package/dist/dialects/spark.cjs +2 -0
  190. package/dist/dialects/spark.cjs.map +1 -0
  191. package/dist/dialects/spark.d.cts +484 -0
  192. package/dist/dialects/spark.d.ts +484 -0
  193. package/dist/dialects/spark.js +2 -0
  194. package/dist/dialects/spark.js.map +1 -0
  195. package/dist/dialects/spark2.cjs +2 -0
  196. package/dist/dialects/spark2.cjs.map +1 -0
  197. package/dist/dialects/spark2.d.cts +486 -0
  198. package/dist/dialects/spark2.d.ts +486 -0
  199. package/dist/dialects/spark2.js +2 -0
  200. package/dist/dialects/spark2.js.map +1 -0
  201. package/dist/dialects/sqlite.cjs +2 -0
  202. package/dist/dialects/sqlite.cjs.map +1 -0
  203. package/dist/dialects/sqlite.d.cts +510 -0
  204. package/dist/dialects/sqlite.d.ts +510 -0
  205. package/dist/dialects/sqlite.js +2 -0
  206. package/dist/dialects/sqlite.js.map +1 -0
  207. package/dist/dialects/starrocks.cjs +2 -0
  208. package/dist/dialects/starrocks.cjs.map +1 -0
  209. package/dist/dialects/starrocks.d.cts +518 -0
  210. package/dist/dialects/starrocks.d.ts +518 -0
  211. package/dist/dialects/starrocks.js +2 -0
  212. package/dist/dialects/starrocks.js.map +1 -0
  213. package/dist/dialects/tableau.cjs +2 -0
  214. package/dist/dialects/tableau.cjs.map +1 -0
  215. package/dist/dialects/tableau.d.cts +466 -0
  216. package/dist/dialects/tableau.d.ts +466 -0
  217. package/dist/dialects/tableau.js +2 -0
  218. package/dist/dialects/tableau.js.map +1 -0
  219. package/dist/dialects/teradata.cjs +2 -0
  220. package/dist/dialects/teradata.cjs.map +1 -0
  221. package/dist/dialects/teradata.d.cts +539 -0
  222. package/dist/dialects/teradata.d.ts +539 -0
  223. package/dist/dialects/teradata.js +2 -0
  224. package/dist/dialects/teradata.js.map +1 -0
  225. package/dist/dialects/trino.cjs +2 -0
  226. package/dist/dialects/trino.cjs.map +1 -0
  227. package/dist/dialects/trino.d.cts +465 -0
  228. package/dist/dialects/trino.d.ts +465 -0
  229. package/dist/dialects/trino.js +2 -0
  230. package/dist/dialects/trino.js.map +1 -0
  231. package/dist/dialects/tsql.cjs +2 -0
  232. package/dist/dialects/tsql.cjs.map +1 -0
  233. package/dist/dialects/tsql.d.cts +703 -0
  234. package/dist/dialects/tsql.d.ts +703 -0
  235. package/dist/dialects/tsql.js +2 -0
  236. package/dist/dialects/tsql.js.map +1 -0
  237. package/dist/index.cjs +5 -25
  238. package/dist/index.cjs.map +1 -1
  239. package/dist/index.d.cts +3 -14178
  240. package/dist/index.d.ts +3 -14178
  241. package/dist/index.js +5 -25
  242. package/dist/index.js.map +1 -1
  243. package/dist/tokens-VcMD09XM.d.cts +15805 -0
  244. package/dist/tokens-VcMD09XM.d.ts +15805 -0
  245. package/package.json +171 -5
@@ -0,0 +1,756 @@
1
+ import { c as Dialect, d as Dialects, aH as NullOrdering, a0 as NormalizationStrategy, E as Expression, bo as TypeAnnotator, $ as DataTypeExprKind, m as Tokenizer, _ as TokenPair, l as TokenType, i as Parser, bp as ShowExpr, b5 as DataTypeExpr, bq as TableSampleExpr, br as ToMapExpr, bs as MapExpr, bt as AttachExpr, bu as DetachExpr, bv as InstallExpr, a6 as CommandExpr, G as Generator, aj as PropertiesLocation, bw as LastValueExpr, bx as TimeSliceExpr, by as BitmapBucketNumberExpr, bz as BitmapBitPositionExpr, bA as BitmapConstructAggExpr, bB as NthValueExpr, bC as RandstrExpr, bD as ZipfExpr, bE as ToBinaryExpr, bF as GreatestExpr, bG as LeastExpr, bH as GeneratorExpr, bI as LambdaExpr, bJ as ApproxTopKExpr, bK as FromIso8601TimestampExpr, aC as StrToTimeExpr, b0 as StrToDateExpr, bL as TsOrDsToTimeExpr, be as CurrentDateExpr, bM as ParseJsonExpr, bN as TruncExpr, bO as NormalExpr, bi as UniformExpr, bP as TimeFromPartsExpr, aL as ExtractExpr, bQ as TimestampFromPartsExpr, bR as TimestampLtzFromPartsExpr, bS as TimestampTzFromPartsExpr, bf as ColumnDefExpr, aR as JoinExpr, bT as GenerateSeriesExpr, bU as CountIfExpr, aq as BracketExpr, bV as WithinGroupExpr, bW as LengthExpr, aB as LevenshteinExpr, bX as PadExpr, bY as MinhashExpr, bZ as MinhashCombineExpr, b_ as ApproximateSimilarityExpr, b$ as ArraysZipExpr, c0 as LowerExpr, c1 as UpperExpr, c2 as ReverseExpr, c3 as Base64EncodeExpr, c4 as ReplaceExpr, c5 as BinaryExpr, c6 as BitwiseXorExpr, c7 as ObjectInsertExpr, c8 as MapCatExpr, c9 as StartsWithExpr, ca as SpaceExpr, cb as TableFromRowsExpr, ag as UnnestExpr, cc as IgnoreNullsExpr, cd as RespectNullsExpr, ce as ArrayToStringExpr, cf as RegexpExtractExpr, cg as NumberToStrExpr, ch as AliasesExpr, ci as PosexplodeExpr, cj as AddMonthsExpr, ck as FormatExpr, ak as DateTruncExpr, cl as TimestampTruncExpr, cm as TrimExpr, cn as RoundExpr, co as ApproxQuantileExpr, cp as ApproxQuantilesExpr, cq as JsonExtractScalarExpr, cr as BitwiseNotExpr, cs as WindowExpr, ct as FilterExpr, cu as CorrExpr, cv as NegExpr, cw as LiteralExpr, cx as HavingExpr } from '../tokens-VcMD09XM.cjs';
2
+
3
+ /**
4
+ * Regex to detect time zones in timestamps of the form [+|-]TT[:tt]
5
+ * The pattern matches timezone offsets that appear after the time portion
6
+ */
7
+ declare const TIMEZONE_PATTERN: RegExp;
8
+ /**
9
+ * Characters that must be escaped when building regex expressions in INITCAP
10
+ */
11
+ declare const REGEX_ESCAPE_REPLACEMENTS: Record<string, string>;
12
+ /**
13
+ * Used to in RANDSTR transpilation
14
+ */
15
+ declare const RANDSTR_CHAR_POOL = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
16
+ declare const RANDSTR_SEED = 123456;
17
+ /**
18
+ * Whitespace control characters that DuckDB must process with `CHR({val})` calls
19
+ */
20
+ declare const WS_CONTROL_CHARS_TO_DUCK: Record<string, number>;
21
+ /**
22
+ * Days of week to ISO 8601 day-of-week numbers
23
+ * ISO 8601 standard: Monday=1, ..., Sunday=7
24
+ */
25
+ declare const WEEK_START_DAY_TO_DOW: Record<string, number>;
26
+ declare const MAX_BIT_POSITION: NegExpr | LiteralExpr;
27
+ /**
28
+ * SEQ function constants
29
+ */
30
+ declare const SEQ_BASE = "(ROW_NUMBER() OVER (ORDER BY 1) - 1)";
31
+ declare const SEQ_RESTRICTED: (typeof HavingExpr)[];
32
+ declare class DuckDBTokenizer extends Tokenizer {
33
+ static get BYTE_STRINGS(): TokenPair[];
34
+ static get BYTE_STRING_ESCAPES(): string[];
35
+ static get HEREDOC_STRINGS(): string[];
36
+ static HEREDOC_TAG_IS_IDENTIFIER: boolean;
37
+ static HEREDOC_STRING_ALTERNATIVE: TokenType;
38
+ static get ORIGINAL_KEYWORDS(): Record<string, TokenType>;
39
+ static get SINGLE_TOKENS(): {
40
+ $: TokenType;
41
+ };
42
+ static get COMMANDS(): Set<TokenType>;
43
+ }
44
+ declare class DuckDBParser extends Parser {
45
+ static get NO_PAREN_FUNCTIONS(): {
46
+ lParen?: typeof Expression | undefined;
47
+ rParen?: typeof Expression | undefined;
48
+ lBracket?: typeof Expression | undefined;
49
+ rBracket?: typeof Expression | undefined;
50
+ lBrace?: typeof Expression | undefined;
51
+ rBrace?: typeof Expression | undefined;
52
+ comma?: typeof Expression | undefined;
53
+ dot?: typeof Expression | undefined;
54
+ dash?: typeof Expression | undefined;
55
+ plus?: typeof Expression | undefined;
56
+ colon?: typeof Expression | undefined;
57
+ dotcolon?: typeof Expression | undefined;
58
+ dcolon?: typeof Expression | undefined;
59
+ dcolondollar?: typeof Expression | undefined;
60
+ dcolonpercent?: typeof Expression | undefined;
61
+ dcolonqmark?: typeof Expression | undefined;
62
+ dqmark?: typeof Expression | undefined;
63
+ semicolon?: typeof Expression | undefined;
64
+ star?: typeof Expression | undefined;
65
+ backslash?: typeof Expression | undefined;
66
+ slash?: typeof Expression | undefined;
67
+ lt?: typeof Expression | undefined;
68
+ lte?: typeof Expression | undefined;
69
+ gt?: typeof Expression | undefined;
70
+ gte?: typeof Expression | undefined;
71
+ not?: typeof Expression | undefined;
72
+ eq?: typeof Expression | undefined;
73
+ neq?: typeof Expression | undefined;
74
+ nullsafeEq?: typeof Expression | undefined;
75
+ colonEq?: typeof Expression | undefined;
76
+ colonGt?: typeof Expression | undefined;
77
+ ncolonGt?: typeof Expression | undefined;
78
+ and?: typeof Expression | undefined;
79
+ or?: typeof Expression | undefined;
80
+ amp?: typeof Expression | undefined;
81
+ dpipe?: typeof Expression | undefined;
82
+ pipeGt?: typeof Expression | undefined;
83
+ pipe?: typeof Expression | undefined;
84
+ pipeSlash?: typeof Expression | undefined;
85
+ dpipeSlash?: typeof Expression | undefined;
86
+ caret?: typeof Expression | undefined;
87
+ caretAt?: typeof Expression | undefined;
88
+ tilde?: typeof Expression | undefined;
89
+ arrow?: typeof Expression | undefined;
90
+ darrow?: typeof Expression | undefined;
91
+ farrow?: typeof Expression | undefined;
92
+ hash?: typeof Expression | undefined;
93
+ hashArrow?: typeof Expression | undefined;
94
+ dhashArrow?: typeof Expression | undefined;
95
+ lrArrow?: typeof Expression | undefined;
96
+ dat?: typeof Expression | undefined;
97
+ ltAt?: typeof Expression | undefined;
98
+ atGt?: typeof Expression | undefined;
99
+ dollar?: typeof Expression | undefined;
100
+ parameter?: typeof Expression | undefined;
101
+ session?: typeof Expression | undefined;
102
+ sessionParameter?: typeof Expression | undefined;
103
+ sessionUser?: typeof Expression | undefined;
104
+ damp?: typeof Expression | undefined;
105
+ ampLt?: typeof Expression | undefined;
106
+ ampGt?: typeof Expression | undefined;
107
+ adjacent?: typeof Expression | undefined;
108
+ xor?: typeof Expression | undefined;
109
+ dstar?: typeof Expression | undefined;
110
+ qmarkAmp?: typeof Expression | undefined;
111
+ qmarkPipe?: typeof Expression | undefined;
112
+ hashDash?: typeof Expression | undefined;
113
+ exclamation?: typeof Expression | undefined;
114
+ uriStart?: typeof Expression | undefined;
115
+ blockStart?: typeof Expression | undefined;
116
+ blockEnd?: typeof Expression | undefined;
117
+ space?: typeof Expression | undefined;
118
+ break?: typeof Expression | undefined;
119
+ string?: typeof Expression | undefined;
120
+ number?: typeof Expression | undefined;
121
+ identifier?: typeof Expression | undefined;
122
+ database?: typeof Expression | undefined;
123
+ column?: typeof Expression | undefined;
124
+ columnDef?: typeof Expression | undefined;
125
+ schema?: typeof Expression | undefined;
126
+ table?: typeof Expression | undefined;
127
+ warehouse?: typeof Expression | undefined;
128
+ stage?: typeof Expression | undefined;
129
+ streamlit?: typeof Expression | undefined;
130
+ var?: typeof Expression | undefined;
131
+ bitString?: typeof Expression | undefined;
132
+ hexString?: typeof Expression | undefined;
133
+ byteString?: typeof Expression | undefined;
134
+ nationalString?: typeof Expression | undefined;
135
+ rawString?: typeof Expression | undefined;
136
+ heredocString?: typeof Expression | undefined;
137
+ unicodeString?: typeof Expression | undefined;
138
+ bit?: typeof Expression | undefined;
139
+ boolean?: typeof Expression | undefined;
140
+ tinyint?: typeof Expression | undefined;
141
+ utinyint?: typeof Expression | undefined;
142
+ smallint?: typeof Expression | undefined;
143
+ usmallint?: typeof Expression | undefined;
144
+ mediumint?: typeof Expression | undefined;
145
+ umediumint?: typeof Expression | undefined;
146
+ int?: typeof Expression | undefined;
147
+ uint?: typeof Expression | undefined;
148
+ bigint?: typeof Expression | undefined;
149
+ ubigint?: typeof Expression | undefined;
150
+ bignum?: typeof Expression | undefined;
151
+ int128?: typeof Expression | undefined;
152
+ uint128?: typeof Expression | undefined;
153
+ int256?: typeof Expression | undefined;
154
+ uint256?: typeof Expression | undefined;
155
+ float?: typeof Expression | undefined;
156
+ double?: typeof Expression | undefined;
157
+ udouble?: typeof Expression | undefined;
158
+ decimal?: typeof Expression | undefined;
159
+ decimal32?: typeof Expression | undefined;
160
+ decimal64?: typeof Expression | undefined;
161
+ decimal128?: typeof Expression | undefined;
162
+ decimal256?: typeof Expression | undefined;
163
+ decfloat?: typeof Expression | undefined;
164
+ udecimal?: typeof Expression | undefined;
165
+ bigdecimal?: typeof Expression | undefined;
166
+ char?: typeof Expression | undefined;
167
+ nchar?: typeof Expression | undefined;
168
+ varchar?: typeof Expression | undefined;
169
+ nvarchar?: typeof Expression | undefined;
170
+ bpchar?: typeof Expression | undefined;
171
+ text?: typeof Expression | undefined;
172
+ mediumtext?: typeof Expression | undefined;
173
+ longtext?: typeof Expression | undefined;
174
+ blob?: typeof Expression | undefined;
175
+ mediumblob?: typeof Expression | undefined;
176
+ longblob?: typeof Expression | undefined;
177
+ tinyblob?: typeof Expression | undefined;
178
+ tinytext?: typeof Expression | undefined;
179
+ name?: typeof Expression | undefined;
180
+ binary?: typeof Expression | undefined;
181
+ varbinary?: typeof Expression | undefined;
182
+ json?: typeof Expression | undefined;
183
+ jsonb?: typeof Expression | undefined;
184
+ time?: typeof Expression | undefined;
185
+ timetz?: typeof Expression | undefined;
186
+ timeNs?: typeof Expression | undefined;
187
+ timestamp?: typeof Expression | undefined;
188
+ timestamptz?: typeof Expression | undefined;
189
+ timestampltz?: typeof Expression | undefined;
190
+ timestampntz?: typeof Expression | undefined;
191
+ timestampS?: typeof Expression | undefined;
192
+ timestampMs?: typeof Expression | undefined;
193
+ timestampNs?: typeof Expression | undefined;
194
+ datetime?: typeof Expression | undefined;
195
+ datetime2?: typeof Expression | undefined;
196
+ datetime64?: typeof Expression | undefined;
197
+ smalldatetime?: typeof Expression | undefined;
198
+ date?: typeof Expression | undefined;
199
+ date32?: typeof Expression | undefined;
200
+ int4range?: typeof Expression | undefined;
201
+ int4multirange?: typeof Expression | undefined;
202
+ int8range?: typeof Expression | undefined;
203
+ int8multirange?: typeof Expression | undefined;
204
+ numrange?: typeof Expression | undefined;
205
+ nummultirange?: typeof Expression | undefined;
206
+ tsrange?: typeof Expression | undefined;
207
+ tsmultirange?: typeof Expression | undefined;
208
+ tstzrange?: typeof Expression | undefined;
209
+ tstzmultirange?: typeof Expression | undefined;
210
+ daterange?: typeof Expression | undefined;
211
+ datemultirange?: typeof Expression | undefined;
212
+ uuid?: typeof Expression | undefined;
213
+ geography?: typeof Expression | undefined;
214
+ geographypoint?: typeof Expression | undefined;
215
+ nullable?: typeof Expression | undefined;
216
+ geometry?: typeof Expression | undefined;
217
+ point?: typeof Expression | undefined;
218
+ ring?: typeof Expression | undefined;
219
+ linestring?: typeof Expression | undefined;
220
+ localtime?: typeof Expression | undefined;
221
+ localtimestamp?: typeof Expression | undefined;
222
+ systimestamp?: typeof Expression | undefined;
223
+ multilinestring?: typeof Expression | undefined;
224
+ polygon?: typeof Expression | undefined;
225
+ multipolygon?: typeof Expression | undefined;
226
+ hllsketch?: typeof Expression | undefined;
227
+ hstore?: typeof Expression | undefined;
228
+ super?: typeof Expression | undefined;
229
+ serial?: typeof Expression | undefined;
230
+ smallserial?: typeof Expression | undefined;
231
+ bigserial?: typeof Expression | undefined;
232
+ xml?: typeof Expression | undefined;
233
+ year?: typeof Expression | undefined;
234
+ userdefined?: typeof Expression | undefined;
235
+ money?: typeof Expression | undefined;
236
+ smallmoney?: typeof Expression | undefined;
237
+ rowversion?: typeof Expression | undefined;
238
+ image?: typeof Expression | undefined;
239
+ variant?: typeof Expression | undefined;
240
+ object?: typeof Expression | undefined;
241
+ inet?: typeof Expression | undefined;
242
+ ipaddress?: typeof Expression | undefined;
243
+ ipprefix?: typeof Expression | undefined;
244
+ ipv4?: typeof Expression | undefined;
245
+ ipv6?: typeof Expression | undefined;
246
+ enum?: typeof Expression | undefined;
247
+ enum8?: typeof Expression | undefined;
248
+ enum16?: typeof Expression | undefined;
249
+ fixedstring?: typeof Expression | undefined;
250
+ lowcardinality?: typeof Expression | undefined;
251
+ nested?: typeof Expression | undefined;
252
+ aggregatefunction?: typeof Expression | undefined;
253
+ simpleaggregatefunction?: typeof Expression | undefined;
254
+ tdigest?: typeof Expression | undefined;
255
+ unknown?: typeof Expression | undefined;
256
+ vector?: typeof Expression | undefined;
257
+ dynamic?: typeof Expression | undefined;
258
+ void?: typeof Expression | undefined;
259
+ alias?: typeof Expression | undefined;
260
+ alter?: typeof Expression | undefined;
261
+ all?: typeof Expression | undefined;
262
+ anti?: typeof Expression | undefined;
263
+ any?: typeof Expression | undefined;
264
+ apply?: typeof Expression | undefined;
265
+ array?: typeof Expression | undefined;
266
+ asc?: typeof Expression | undefined;
267
+ asof?: typeof Expression | undefined;
268
+ attach?: typeof Expression | undefined;
269
+ autoIncrement?: typeof Expression | undefined;
270
+ begin?: typeof Expression | undefined;
271
+ between?: typeof Expression | undefined;
272
+ bulkCollectInto?: typeof Expression | undefined;
273
+ cache?: typeof Expression | undefined;
274
+ case?: typeof Expression | undefined;
275
+ characterSet?: typeof Expression | undefined;
276
+ clusterBy?: typeof Expression | undefined;
277
+ collate?: typeof Expression | undefined;
278
+ command?: typeof Expression | undefined;
279
+ comment?: typeof Expression | undefined;
280
+ commit?: typeof Expression | undefined;
281
+ connectBy?: typeof Expression | undefined;
282
+ constraint?: typeof Expression | undefined;
283
+ copy?: typeof Expression | undefined;
284
+ create?: typeof Expression | undefined;
285
+ cross?: typeof Expression | undefined;
286
+ cube?: typeof Expression | undefined;
287
+ currentDate?: typeof Expression | undefined;
288
+ currentDatetime?: typeof Expression | undefined;
289
+ currentSchema?: typeof Expression | undefined;
290
+ currentTime?: typeof Expression | undefined;
291
+ currentTimestamp?: typeof Expression | undefined;
292
+ currentUser?: typeof Expression | undefined;
293
+ currentRole?: typeof Expression | undefined;
294
+ currentCatalog?: typeof Expression | undefined;
295
+ declare?: typeof Expression | undefined;
296
+ default?: typeof Expression | undefined;
297
+ delete?: typeof Expression | undefined;
298
+ desc?: typeof Expression | undefined;
299
+ describe?: typeof Expression | undefined;
300
+ detach?: typeof Expression | undefined;
301
+ dictionary?: typeof Expression | undefined;
302
+ distinct?: typeof Expression | undefined;
303
+ distributeBy?: typeof Expression | undefined;
304
+ div?: typeof Expression | undefined;
305
+ drop?: typeof Expression | undefined;
306
+ else?: typeof Expression | undefined;
307
+ end?: typeof Expression | undefined;
308
+ escape?: typeof Expression | undefined;
309
+ except?: typeof Expression | undefined;
310
+ execute?: typeof Expression | undefined;
311
+ exists?: typeof Expression | undefined;
312
+ false?: typeof Expression | undefined;
313
+ fetch?: typeof Expression | undefined;
314
+ file?: typeof Expression | undefined;
315
+ fileFormat?: typeof Expression | undefined;
316
+ filter?: typeof Expression | undefined;
317
+ final?: typeof Expression | undefined;
318
+ first?: typeof Expression | undefined;
319
+ for?: typeof Expression | undefined;
320
+ force?: typeof Expression | undefined;
321
+ foreignKey?: typeof Expression | undefined;
322
+ format?: typeof Expression | undefined;
323
+ from?: typeof Expression | undefined;
324
+ full?: typeof Expression | undefined;
325
+ function?: typeof Expression | undefined;
326
+ get?: typeof Expression | undefined;
327
+ glob?: typeof Expression | undefined;
328
+ global?: typeof Expression | undefined;
329
+ grant?: typeof Expression | undefined;
330
+ groupBy?: typeof Expression | undefined;
331
+ groupingSets?: typeof Expression | undefined;
332
+ having?: typeof Expression | undefined;
333
+ hint?: typeof Expression | undefined;
334
+ ignore?: typeof Expression | undefined;
335
+ ilike?: typeof Expression | undefined;
336
+ in?: typeof Expression | undefined;
337
+ index?: typeof Expression | undefined;
338
+ indexedBy?: typeof Expression | undefined;
339
+ inner?: typeof Expression | undefined;
340
+ insert?: typeof Expression | undefined;
341
+ install?: typeof Expression | undefined;
342
+ intersect?: typeof Expression | undefined;
343
+ interval?: typeof Expression | undefined;
344
+ into?: typeof Expression | undefined;
345
+ introducer?: typeof Expression | undefined;
346
+ irlike?: typeof Expression | undefined;
347
+ is?: typeof Expression | undefined;
348
+ isnull?: typeof Expression | undefined;
349
+ join?: typeof Expression | undefined;
350
+ joinMarker?: typeof Expression | undefined;
351
+ keep?: typeof Expression | undefined;
352
+ key?: typeof Expression | undefined;
353
+ kill?: typeof Expression | undefined;
354
+ language?: typeof Expression | undefined;
355
+ lateral?: typeof Expression | undefined;
356
+ left?: typeof Expression | undefined;
357
+ like?: typeof Expression | undefined;
358
+ limit?: typeof Expression | undefined;
359
+ list?: typeof Expression | undefined;
360
+ load?: typeof Expression | undefined;
361
+ lock?: typeof Expression | undefined;
362
+ map?: typeof Expression | undefined;
363
+ match?: typeof Expression | undefined;
364
+ matchCondition?: typeof Expression | undefined;
365
+ matchRecognize?: typeof Expression | undefined;
366
+ memberOf?: typeof Expression | undefined;
367
+ merge?: typeof Expression | undefined;
368
+ mod?: typeof Expression | undefined;
369
+ model?: typeof Expression | undefined;
370
+ natural?: typeof Expression | undefined;
371
+ next?: typeof Expression | undefined;
372
+ nothing?: typeof Expression | undefined;
373
+ notnull?: typeof Expression | undefined;
374
+ null?: typeof Expression | undefined;
375
+ objectIdentifier?: typeof Expression | undefined;
376
+ offset?: typeof Expression | undefined;
377
+ on?: typeof Expression | undefined;
378
+ only?: typeof Expression | undefined;
379
+ operator?: typeof Expression | undefined;
380
+ orderBy?: typeof Expression | undefined;
381
+ orderSiblingsBy?: typeof Expression | undefined;
382
+ ordered?: typeof Expression | undefined;
383
+ ordinality?: typeof Expression | undefined;
384
+ out?: typeof Expression | undefined;
385
+ inout?: typeof Expression | undefined;
386
+ outer?: typeof Expression | undefined;
387
+ over?: typeof Expression | undefined;
388
+ overlaps?: typeof Expression | undefined;
389
+ overwrite?: typeof Expression | undefined;
390
+ partition?: typeof Expression | undefined;
391
+ partitionBy?: typeof Expression | undefined;
392
+ percent?: typeof Expression | undefined;
393
+ pivot?: typeof Expression | undefined;
394
+ placeholder?: typeof Expression | undefined;
395
+ positional?: typeof Expression | undefined;
396
+ pragma?: typeof Expression | undefined;
397
+ prewhere?: typeof Expression | undefined;
398
+ primaryKey?: typeof Expression | undefined;
399
+ procedure?: typeof Expression | undefined;
400
+ properties?: typeof Expression | undefined;
401
+ pseudoType?: typeof Expression | undefined;
402
+ put?: typeof Expression | undefined;
403
+ qualify?: typeof Expression | undefined;
404
+ quote?: typeof Expression | undefined;
405
+ qdcolon?: typeof Expression | undefined;
406
+ range?: typeof Expression | undefined;
407
+ recursive?: typeof Expression | undefined;
408
+ refresh?: typeof Expression | undefined;
409
+ rename?: typeof Expression | undefined;
410
+ replace?: typeof Expression | undefined;
411
+ returning?: typeof Expression | undefined;
412
+ revoke?: typeof Expression | undefined;
413
+ references?: typeof Expression | undefined;
414
+ right?: typeof Expression | undefined;
415
+ rlike?: typeof Expression | undefined;
416
+ rollback?: typeof Expression | undefined;
417
+ rollup?: typeof Expression | undefined;
418
+ row?: typeof Expression | undefined;
419
+ rows?: typeof Expression | undefined;
420
+ select?: typeof Expression | undefined;
421
+ semi?: typeof Expression | undefined;
422
+ separator?: typeof Expression | undefined;
423
+ sequence?: typeof Expression | undefined;
424
+ serdeProperties?: typeof Expression | undefined;
425
+ set?: typeof Expression | undefined;
426
+ settings?: typeof Expression | undefined;
427
+ show?: typeof Expression | undefined;
428
+ similarTo?: typeof Expression | undefined;
429
+ some?: typeof Expression | undefined;
430
+ sortBy?: typeof Expression | undefined;
431
+ soundsLike?: typeof Expression | undefined;
432
+ startWith?: typeof Expression | undefined;
433
+ storageIntegration?: typeof Expression | undefined;
434
+ straightJoin?: typeof Expression | undefined;
435
+ struct?: typeof Expression | undefined;
436
+ summarize?: typeof Expression | undefined;
437
+ tableSample?: typeof Expression | undefined;
438
+ tag?: typeof Expression | undefined;
439
+ temporary?: typeof Expression | undefined;
440
+ top?: typeof Expression | undefined;
441
+ then?: typeof Expression | undefined;
442
+ true?: typeof Expression | undefined;
443
+ truncate?: typeof Expression | undefined;
444
+ uncache?: typeof Expression | undefined;
445
+ union?: typeof Expression | undefined;
446
+ unnest?: typeof Expression | undefined;
447
+ unpivot?: typeof Expression | undefined;
448
+ update?: typeof Expression | undefined;
449
+ use?: typeof Expression | undefined;
450
+ using?: typeof Expression | undefined;
451
+ values?: typeof Expression | undefined;
452
+ variadic?: typeof Expression | undefined;
453
+ view?: typeof Expression | undefined;
454
+ semanticView?: typeof Expression | undefined;
455
+ volatile?: typeof Expression | undefined;
456
+ when?: typeof Expression | undefined;
457
+ where?: typeof Expression | undefined;
458
+ window?: typeof Expression | undefined;
459
+ with?: typeof Expression | undefined;
460
+ unique?: typeof Expression | undefined;
461
+ utcDate?: typeof Expression | undefined;
462
+ utcTime?: typeof Expression | undefined;
463
+ utcTimestamp?: typeof Expression | undefined;
464
+ versionSnapshot?: typeof Expression | undefined;
465
+ timestampSnapshot?: typeof Expression | undefined;
466
+ option?: typeof Expression | undefined;
467
+ sink?: typeof Expression | undefined;
468
+ source?: typeof Expression | undefined;
469
+ analyze?: typeof Expression | undefined;
470
+ namespace?: typeof Expression | undefined;
471
+ export?: typeof Expression | undefined;
472
+ hiveTokenStream?: typeof Expression | undefined;
473
+ };
474
+ static MAP_KEYS_ARE_ARBITRARY_EXPRESSIONS: boolean;
475
+ static get BITWISE(): Partial<Record<TokenType, typeof Expression>>;
476
+ static get RANGE_PARSERS(): Partial<Record<TokenType, (this: Parser, this_: Expression) => Expression | undefined>>;
477
+ static get EXPONENT(): Partial<Record<TokenType, typeof Expression>>;
478
+ static get FUNCTIONS_WITH_ALIASED_ARGS(): Set<string>;
479
+ static get SHOW_PARSERS(): {
480
+ TABLES: (this: Parser) => ShowExpr;
481
+ 'ALL TABLES': (this: Parser) => ShowExpr;
482
+ };
483
+ static get FUNCTIONS(): Record<string, (args: Expression[], options: {
484
+ dialect: Dialect;
485
+ }) => Expression>;
486
+ static get FUNCTION_PARSERS(): Partial<Record<string, (this: Parser) => Expression | undefined>>;
487
+ static get NO_PAREN_FUNCTION_PARSERS(): Partial<Record<string, (this: Parser) => Expression | undefined>>;
488
+ static get ID_VAR_TOKENS(): Set<TokenType>;
489
+ static get TABLE_ALIAS_TOKENS(): Set<TokenType>;
490
+ static get PLACEHOLDER_PARSERS(): Partial<Record<TokenType, (this: Parser) => Expression | undefined>>;
491
+ static get TYPE_CONVERTERS(): {
492
+ decimal: (dtype: DataTypeExpr) => DataTypeExpr;
493
+ text: () => DataTypeExpr;
494
+ };
495
+ static get STATEMENT_PARSERS(): Partial<Record<TokenType, (this: Parser) => Expression | undefined>>;
496
+ static get SET_PARSERS(): Record<string, (this: Parser) => Expression | undefined>;
497
+ parseLambda(options?: {
498
+ alias?: boolean;
499
+ }): Expression | undefined;
500
+ parseExpression(): Expression | undefined;
501
+ parseTable(options?: {
502
+ schema?: boolean;
503
+ joins?: boolean;
504
+ aliasTokens?: Set<TokenType>;
505
+ parseBracket?: boolean;
506
+ isDbReference?: boolean;
507
+ parsePartition?: boolean;
508
+ consumePipe?: boolean;
509
+ }): Expression | undefined;
510
+ parseTableSample(options?: {
511
+ asModifier?: boolean;
512
+ }): TableSampleExpr | undefined;
513
+ parseBracket(thisNode?: Expression): Expression | undefined;
514
+ parseMap(): ToMapExpr | MapExpr;
515
+ parseStructTypes(_options?: {
516
+ typeRequired?: boolean;
517
+ }): Expression | undefined;
518
+ pivotColumnNames(aggregations: Expression[]): string[];
519
+ parseAttachDetach(options?: {
520
+ isAttach?: boolean;
521
+ }): AttachExpr | DetachExpr;
522
+ parseShowDuckdb(thisStr: string): ShowExpr;
523
+ parseForce(): InstallExpr | CommandExpr;
524
+ parseInstall(options?: {
525
+ force?: boolean;
526
+ }): InstallExpr;
527
+ /**
528
+ * DuckDB supports positional columns using the # syntax (e.g., #1).
529
+ */
530
+ parsePrimary(): Expression | undefined;
531
+ }
532
+ declare class DuckDBGenerator extends Generator {
533
+ static get AFTER_HAVING_MODIFIER_TRANSFORMS(): Map<string, (this: Generator, e: Expression) => string>;
534
+ static SUPPORTS_DECODE_CASE: boolean;
535
+ static readonly SELECT_KINDS: string[];
536
+ static PARAMETER_TOKEN: string;
537
+ static NAMED_PLACEHOLDER_TOKEN: string;
538
+ static JOIN_HINTS: boolean;
539
+ static TABLE_HINTS: boolean;
540
+ static QUERY_HINTS: boolean;
541
+ static LIMIT_FETCH: string;
542
+ static get STRUCT_DELIMITER(): string[];
543
+ static RENAME_TABLE_WITH_DB: boolean;
544
+ static NVL2_SUPPORTED: boolean;
545
+ static SEMI_ANTI_JOIN_WITH_SIDE: boolean;
546
+ static TABLESAMPLE_KEYWORDS: string;
547
+ static TABLESAMPLE_SEED_KEYWORD: string;
548
+ static LAST_DAY_SUPPORTS_DATE_PART: boolean;
549
+ static JSON_KEY_VALUE_PAIR_SEP: string;
550
+ static IGNORE_NULLS_IN_FUNC: boolean;
551
+ static JSON_PATH_BRACKETED_KEY_SUPPORTED: boolean;
552
+ static SUPPORTS_CREATE_TABLE_LIKE: boolean;
553
+ static MULTI_ARG_DISTINCT: boolean;
554
+ static CAN_IMPLEMENT_ARRAY_ANY: boolean;
555
+ static SUPPORTS_TO_NUMBER: boolean;
556
+ static SUPPORTS_WINDOW_EXCLUDE: boolean;
557
+ static COPY_HAS_INTO_KEYWORD: boolean;
558
+ static STAR_EXCEPT: string;
559
+ static PAD_FILL_PATTERN_IS_REQUIRED: boolean;
560
+ static ARRAY_SIZE_DIM_REQUIRED: boolean;
561
+ static NORMALIZE_EXTRACT_DATE_PARTS: boolean;
562
+ static SUPPORTS_LIKE_QUANTIFIERS: boolean;
563
+ static SET_ASSIGNMENT_REQUIRES_VARIABLE_KEYWORD: boolean;
564
+ static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: any) => string>;
565
+ static get SUPPORTED_JSON_PATH_PARTS(): Set<typeof Expression>;
566
+ static get TYPE_MAPPING(): Map<string, string>;
567
+ static get RESERVED_KEYWORDS(): Set<string>;
568
+ static get UNWRAPPED_INTERVAL_VALUES(): Set<typeof Expression>;
569
+ static get PROPERTIES_LOCATION(): Map<typeof Expression, PropertiesLocation>;
570
+ static get IGNORE_RESPECT_NULLS_WINDOW_FUNCTIONS(): (typeof LastValueExpr)[];
571
+ static get ZIPF_TEMPLATE(): Expression;
572
+ static get NORMAL_TEMPLATE(): Expression;
573
+ static get SEEDED_RANDOM_TEMPLATE(): Expression;
574
+ static get SEQ_UNSIGNED(): Expression;
575
+ static get SEQ_SIGNED(): Expression;
576
+ static get MAPCAT_TEMPLATE(): Expression;
577
+ static get EXTRACT_STRFTIME_MAPPINGS(): Record<string, [string, string]>;
578
+ static get EXTRACT_EPOCH_MAPPINGS(): Record<string, string>;
579
+ /**
580
+ * Snowflake's BITMAP_CONSTRUCT_AGG aggregates integers into a compact binary bitmap.
581
+ * DuckDB implementation uses LIST_TRANSFORM and LIST_REDUCE to build hex strings
582
+ * before converting to binary BLOBs.
583
+ */
584
+ static get BITMAP_CONSTRUCT_AGG_TEMPLATE(): Expression;
585
+ /**
586
+ * Template for RANDSTR transpilation using a character pool and seeded hash.
587
+ */
588
+ static get RANDSTR_TEMPLATE(): Expression;
589
+ /**
590
+ * Template for MINHASH transpilation.
591
+ * Returns JSON matching Snowflake format: {"state": [...], "type": "minhash", "version": 1}
592
+ */
593
+ static get MINHASH_TEMPLATE(): Expression;
594
+ /**
595
+ * Template for MINHASH_COMBINE transpilation.
596
+ * Combines multiple minhash signatures by taking element-wise minimum.
597
+ */
598
+ static get MINHASH_COMBINE_TEMPLATE(): Expression;
599
+ static get APPROXIMATE_SIMILARITY_TEMPLATE(): Expression;
600
+ static get ARRAYS_ZIP_TEMPLATE(): Expression;
601
+ /** Transform Snowflake's TIME_SLICE to DuckDB's time_bucket. */
602
+ timeSliceSql(expression: TimeSliceExpr): string;
603
+ /** Snowflake BITMAP_BUCKET_NUMBER to DuckDB CASE expression. */
604
+ bitmapBucketNumberSql(this: DuckDBGenerator, expression: BitmapBucketNumberExpr): string;
605
+ /** Snowflake BITMAP_BIT_POSITION to DuckDB modulo CASE expression. */
606
+ bitmapBitPositionSql(expression: BitmapBitPositionExpr): string;
607
+ /** Snowflake BITMAP_CONSTRUCT_AGG using replacePlaceholders. */
608
+ bitmapConstructAggSql(expression: BitmapConstructAggExpr): string;
609
+ nthValueSql(expression: NthValueExpr): string;
610
+ /**
611
+ * Transpile Snowflake's RANDSTR to DuckDB equivalent using deterministic hash-based random.
612
+ * RANDSTR(length, generator) generates a random string of specified length.
613
+ */
614
+ randstrSql(expression: RandstrExpr): string;
615
+ /**
616
+ * Transpile Snowflake's ZIPF to DuckDB using CDF-based inverse sampling.
617
+ */
618
+ zipfSql(expression: ZipfExpr): string;
619
+ /**
620
+ * TO_BINARY and TRY_TO_BINARY transpilation:
621
+ * Maps format (HEX, UTF-8, BASE64) to native DuckDB functions.
622
+ */
623
+ toBinarySql(expression: ToBinaryExpr): string;
624
+ /**
625
+ * Handle GREATEST/LEAST functions with dialect-aware NULL behavior.
626
+ */
627
+ greatestLeastSql(expression: GreatestExpr | LeastExpr): string;
628
+ /** Transpile Snowflake GENERATOR to DuckDB range() */
629
+ generatorSql(expression: GeneratorExpr): string;
630
+ greatestSql(expression: GreatestExpr): string;
631
+ leastSql(expression: LeastExpr): string;
632
+ lambdaSql(expression: LambdaExpr, options?: {
633
+ arrowSep?: string;
634
+ wrap?: boolean;
635
+ }): string;
636
+ showSql(expression: ShowExpr): string;
637
+ installSql(expression: InstallExpr): string;
638
+ approxTopKSql(expression: ApproxTopKExpr): string;
639
+ fromIso8601TimestampSql(expression: FromIso8601TimestampExpr): string;
640
+ strToTimeSql(expression: StrToTimeExpr): string;
641
+ strToDateSql(expression: StrToDateExpr): string;
642
+ tsOrDsToTimeSql(expression: TsOrDsToTimeExpr): string;
643
+ currentDateSql(expression: CurrentDateExpr): string;
644
+ parseJsonSql(expression: ParseJsonExpr): string;
645
+ truncSql(expression: TruncExpr): string;
646
+ normalSql(expression: NormalExpr): string;
647
+ uniformSql(expression: UniformExpr): string;
648
+ timeFromPartsSql(expression: TimeFromPartsExpr): string;
649
+ /** Transpile EXTRACT with DuckDB strftime/epoch mappings. */
650
+ extractSql(expression: ExtractExpr): string;
651
+ timestampFromPartsSql(expression: TimestampFromPartsExpr): string;
652
+ timestampLtzFromPartsSql(expression: TimestampLtzFromPartsExpr): string;
653
+ timestampTzFromPartsSql(expression: TimestampTzFromPartsExpr): string;
654
+ tableSampleSql(expression: TableSampleExpr, options?: {
655
+ tablesampleKeyword?: string;
656
+ }): string;
657
+ columnDefSql(expression: ColumnDefExpr, options?: {
658
+ sep?: string;
659
+ }): string;
660
+ joinSql(expression: JoinExpr): string;
661
+ generateSeriesSql(expression: GenerateSeriesExpr): string;
662
+ countIfSql(expression: CountIfExpr): string;
663
+ bracketSql(expression: BracketExpr): string;
664
+ /**
665
+ * DuckDB requires ORDER BY inside the function for ARRAY_AGG.
666
+ * Transform: ARRAY_AGG(x) WITHIN GROUP (ORDER BY y) -> ARRAY_AGG(x ORDER BY y)
667
+ */
668
+ withinGroupSql(expression: WithinGroupExpr): string;
669
+ lengthSql(expression: LengthExpr): string;
670
+ levenshteinSql(expression: LevenshteinExpr): string;
671
+ padSql(expression: PadExpr): string;
672
+ minhashSql(expression: MinhashExpr): string;
673
+ minhashCombineSql(expression: MinhashCombineExpr): string;
674
+ approximateSimilaritySql(expression: ApproximateSimilarityExpr): string;
675
+ arraysZipSql(expression: ArraysZipExpr): string;
676
+ lowerSql(expression: LowerExpr): string;
677
+ upperSql(expression: UpperExpr): string;
678
+ reverseSql(expression: ReverseExpr): string;
679
+ /**
680
+ * DuckDB TO_BASE64 requires BLOB input.
681
+ * Snowflake BASE64_ENCODE implicitly encodes UTF-8 bytes for VARCHAR.
682
+ */
683
+ base64EncodeSql(expression: Base64EncodeExpr): string;
684
+ replaceSql(expression: ReplaceExpr): string;
685
+ bitwiseOp(expression: BinaryExpr, op: string): string;
686
+ bitwiseXorSql(expression: BitwiseXorExpr): string;
687
+ objectInsertSql(expression: ObjectInsertExpr): string;
688
+ mapCatSql(expression: MapCatExpr): string;
689
+ startsWithSql(expression: StartsWithExpr): string;
690
+ spaceSql(expression: SpaceExpr): string;
691
+ tableFromRowsSql(expression: TableFromRowsExpr): string;
692
+ unnestSql(expression: UnnestExpr): string;
693
+ ignoreNullsSql(expression: IgnoreNullsExpr): string;
694
+ respectNullsSql(expression: RespectNullsExpr): string;
695
+ arrayToStringSql(expression: ArrayToStringExpr): string;
696
+ regexpExtractSql(expression: RegexpExtractExpr): string;
697
+ numberToStrSql(expression: NumberToStrExpr): string;
698
+ autoIncrementColumnConstraintSql(_expression: ColumnDefExpr): string;
699
+ aliasesSql(expression: AliasesExpr): string;
700
+ posexplodeSql(expression: PosexplodeExpr): string;
701
+ /**
702
+ * Handles Snowflake rounding behavior for float months and preserves
703
+ * input types (DATE/TIMESTAMPTZ) which DuckDB usually promotes to TIMESTAMP.
704
+ */
705
+ addMonthsSql(expression: AddMonthsExpr): string;
706
+ formatSql(expression: FormatExpr): string;
707
+ dateTruncSql(expression: DateTruncExpr): string;
708
+ timestampTruncSql(expression: TimestampTruncExpr): string;
709
+ trimSql(expression: TrimExpr): string;
710
+ roundSql(expression: RoundExpr): string;
711
+ approxQuantileSql(expression: ApproxQuantileExpr): string;
712
+ approxQuantilesSql(expression: ApproxQuantilesExpr): string;
713
+ jsonExtractScalarSql(expression: JsonExtractScalarExpr): string;
714
+ bitwiseNotSql(expression: BitwiseNotExpr): string;
715
+ windowSql(expression: WindowExpr): string;
716
+ filterSql(expression: FilterExpr): string;
717
+ corrSql(expression: FilterExpr | WindowExpr | CorrExpr): string;
718
+ }
719
+ declare class DuckDB extends Dialect {
720
+ static DIALECT_NAME: Dialects;
721
+ static get NULL_ORDERING(): NullOrdering;
722
+ static SUPPORTS_USER_DEFINED_TYPES: boolean;
723
+ static SAFE_DIVISION: boolean;
724
+ static INDEX_OFFSET: number;
725
+ static CONCAT_COALESCE: boolean;
726
+ static SUPPORTS_ORDER_BY_ALL: boolean;
727
+ static SUPPORTS_FIXED_SIZE_ARRAYS: boolean;
728
+ static STRICT_JSON_PATH_SYNTAX: boolean;
729
+ static NUMBERS_CAN_BE_UNDERSCORE_SEPARATED: boolean;
730
+ static get NORMALIZATION_STRATEGY(): NormalizationStrategy;
731
+ static get DATE_PART_MAPPING(): Record<string, string>;
732
+ static get EXPRESSION_METADATA(): Map<typeof Expression, {
733
+ annotator?: (annotator: TypeAnnotator, expression: any) => void;
734
+ returns?: DataTypeExprKind | string;
735
+ }>;
736
+ static get INVERSE_TIME_MAPPING(): {
737
+ '%e': string;
738
+ '%:z': string;
739
+ '%-z': string;
740
+ '%f_zero': string;
741
+ '%f_one': string;
742
+ '%f_two': string;
743
+ '%f_three': string;
744
+ '%f_four': string;
745
+ '%f_five': string;
746
+ '%f_seven': string;
747
+ '%f_eight': string;
748
+ '%f_nine': string;
749
+ };
750
+ toJsonPath(path: Expression | undefined): Expression | undefined;
751
+ static Tokenizer: typeof DuckDBTokenizer;
752
+ static Parser: typeof DuckDBParser;
753
+ static Generator: typeof DuckDBGenerator;
754
+ }
755
+
756
+ export { DuckDB, MAX_BIT_POSITION, RANDSTR_CHAR_POOL, RANDSTR_SEED, REGEX_ESCAPE_REPLACEMENTS, SEQ_BASE, SEQ_RESTRICTED, TIMEZONE_PATTERN, WEEK_START_DAY_TO_DOW, WS_CONTROL_CHARS_TO_DUCK };