sqlingo 0.8.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 (283) hide show
  1. package/CHANGELOG.md +242 -0
  2. package/COPYRIGHT_NOTICE +31 -0
  3. package/LICENSE +21 -0
  4. package/README.md +189 -0
  5. package/README.npm.md +189 -0
  6. package/README.repo.md +132 -0
  7. package/dist/chunk-3OVM5ZRR.js +2 -0
  8. package/dist/chunk-3OVM5ZRR.js.map +1 -0
  9. package/dist/chunk-457OPBHX.js +2 -0
  10. package/dist/chunk-457OPBHX.js.map +1 -0
  11. package/dist/chunk-47UFIVIO.cjs +2 -0
  12. package/dist/chunk-47UFIVIO.cjs.map +1 -0
  13. package/dist/chunk-5E2DDDMJ.cjs +2 -0
  14. package/dist/chunk-5E2DDDMJ.cjs.map +1 -0
  15. package/dist/chunk-5JXGMU6K.js +2 -0
  16. package/dist/chunk-5JXGMU6K.js.map +1 -0
  17. package/dist/chunk-6EWE2PXX.cjs +2 -0
  18. package/dist/chunk-6EWE2PXX.cjs.map +1 -0
  19. package/dist/chunk-AKDNSOG6.js +2 -0
  20. package/dist/chunk-AKDNSOG6.js.map +1 -0
  21. package/dist/chunk-AYV6C6YU.cjs +19 -0
  22. package/dist/chunk-AYV6C6YU.cjs.map +1 -0
  23. package/dist/chunk-C4ZR72YB.cjs +3 -0
  24. package/dist/chunk-C4ZR72YB.cjs.map +1 -0
  25. package/dist/chunk-DGV6NM76.js +2 -0
  26. package/dist/chunk-DGV6NM76.js.map +1 -0
  27. package/dist/chunk-DW3ISHFW.js +3 -0
  28. package/dist/chunk-DW3ISHFW.js.map +1 -0
  29. package/dist/chunk-FCFBBB5S.cjs +2 -0
  30. package/dist/chunk-FCFBBB5S.cjs.map +1 -0
  31. package/dist/chunk-FYYDDWAY.cjs +2 -0
  32. package/dist/chunk-FYYDDWAY.cjs.map +1 -0
  33. package/dist/chunk-GFWBSTYA.js +2 -0
  34. package/dist/chunk-GFWBSTYA.js.map +1 -0
  35. package/dist/chunk-HQEUEZZE.cjs +2 -0
  36. package/dist/chunk-HQEUEZZE.cjs.map +1 -0
  37. package/dist/chunk-I36ZOBUW.cjs +2 -0
  38. package/dist/chunk-I36ZOBUW.cjs.map +1 -0
  39. package/dist/chunk-KNRQDMQ7.js +4 -0
  40. package/dist/chunk-KNRQDMQ7.js.map +1 -0
  41. package/dist/chunk-KYKSQHLH.cjs +2 -0
  42. package/dist/chunk-KYKSQHLH.cjs.map +1 -0
  43. package/dist/chunk-KZSNUA4U.js +2 -0
  44. package/dist/chunk-KZSNUA4U.js.map +1 -0
  45. package/dist/chunk-LDIWFKFA.cjs +2 -0
  46. package/dist/chunk-LDIWFKFA.cjs.map +1 -0
  47. package/dist/chunk-NBRX75ID.js +2 -0
  48. package/dist/chunk-NBRX75ID.js.map +1 -0
  49. package/dist/chunk-NKPY5IG3.js +2 -0
  50. package/dist/chunk-NKPY5IG3.js.map +1 -0
  51. package/dist/chunk-NMAMNFRD.js +2 -0
  52. package/dist/chunk-NMAMNFRD.js.map +1 -0
  53. package/dist/chunk-O4K6VGOH.cjs +2 -0
  54. package/dist/chunk-O4K6VGOH.cjs.map +1 -0
  55. package/dist/chunk-OGPS63WZ.cjs +2 -0
  56. package/dist/chunk-OGPS63WZ.cjs.map +1 -0
  57. package/dist/chunk-OOA5D6BW.cjs +2 -0
  58. package/dist/chunk-OOA5D6BW.cjs.map +1 -0
  59. package/dist/chunk-PC37XGLS.js +2 -0
  60. package/dist/chunk-PC37XGLS.js.map +1 -0
  61. package/dist/chunk-PGKNO72J.js +2 -0
  62. package/dist/chunk-PGKNO72J.js.map +1 -0
  63. package/dist/chunk-PVJGPE3V.cjs +2 -0
  64. package/dist/chunk-PVJGPE3V.cjs.map +1 -0
  65. package/dist/chunk-QEXGYHWM.cjs +2 -0
  66. package/dist/chunk-QEXGYHWM.cjs.map +1 -0
  67. package/dist/chunk-QWCG55SR.js +2 -0
  68. package/dist/chunk-QWCG55SR.js.map +1 -0
  69. package/dist/chunk-R2XOYY2B.js +2 -0
  70. package/dist/chunk-R2XOYY2B.js.map +1 -0
  71. package/dist/chunk-RGKTYIN3.js +19 -0
  72. package/dist/chunk-RGKTYIN3.js.map +1 -0
  73. package/dist/chunk-SPWMHIMC.js +2 -0
  74. package/dist/chunk-SPWMHIMC.js.map +1 -0
  75. package/dist/chunk-UMJ6E4XD.cjs +4 -0
  76. package/dist/chunk-UMJ6E4XD.cjs.map +1 -0
  77. package/dist/chunk-USYIWEPI.cjs +2 -0
  78. package/dist/chunk-USYIWEPI.cjs.map +1 -0
  79. package/dist/chunk-WRG5B5DZ.js +2 -0
  80. package/dist/chunk-WRG5B5DZ.js.map +1 -0
  81. package/dist/chunk-Y2ZD6UO6.cjs +2 -0
  82. package/dist/chunk-Y2ZD6UO6.cjs.map +1 -0
  83. package/dist/dialects/athena.cjs +2 -0
  84. package/dist/dialects/athena.cjs.map +1 -0
  85. package/dist/dialects/athena.d.cts +66 -0
  86. package/dist/dialects/athena.d.ts +66 -0
  87. package/dist/dialects/athena.js +2 -0
  88. package/dist/dialects/athena.js.map +1 -0
  89. package/dist/dialects/bigquery.cjs +3 -0
  90. package/dist/dialects/bigquery.cjs.map +1 -0
  91. package/dist/dialects/bigquery.d.cts +665 -0
  92. package/dist/dialects/bigquery.d.ts +665 -0
  93. package/dist/dialects/bigquery.js +3 -0
  94. package/dist/dialects/bigquery.js.map +1 -0
  95. package/dist/dialects/clickhouse.cjs +2 -0
  96. package/dist/dialects/clickhouse.cjs.map +1 -0
  97. package/dist/dialects/clickhouse.d.cts +660 -0
  98. package/dist/dialects/clickhouse.d.ts +660 -0
  99. package/dist/dialects/clickhouse.js +2 -0
  100. package/dist/dialects/clickhouse.js.map +1 -0
  101. package/dist/dialects/databricks.cjs +2 -0
  102. package/dist/dialects/databricks.cjs.map +1 -0
  103. package/dist/dialects/databricks.d.cts +495 -0
  104. package/dist/dialects/databricks.d.ts +495 -0
  105. package/dist/dialects/databricks.js +2 -0
  106. package/dist/dialects/databricks.js.map +1 -0
  107. package/dist/dialects/doris.cjs +2 -0
  108. package/dist/dialects/doris.cjs.map +1 -0
  109. package/dist/dialects/doris.d.cts +494 -0
  110. package/dist/dialects/doris.d.ts +494 -0
  111. package/dist/dialects/doris.js +2 -0
  112. package/dist/dialects/doris.js.map +1 -0
  113. package/dist/dialects/dremio.cjs +2 -0
  114. package/dist/dialects/dremio.cjs.map +1 -0
  115. package/dist/dialects/dremio.d.cts +532 -0
  116. package/dist/dialects/dremio.d.ts +532 -0
  117. package/dist/dialects/dremio.js +2 -0
  118. package/dist/dialects/dremio.js.map +1 -0
  119. package/dist/dialects/drill.cjs +2 -0
  120. package/dist/dialects/drill.cjs.map +1 -0
  121. package/dist/dialects/drill.d.cts +522 -0
  122. package/dist/dialects/drill.d.ts +522 -0
  123. package/dist/dialects/drill.js +2 -0
  124. package/dist/dialects/drill.js.map +1 -0
  125. package/dist/dialects/druid.cjs +2 -0
  126. package/dist/dialects/druid.cjs.map +1 -0
  127. package/dist/dialects/druid.d.cts +17 -0
  128. package/dist/dialects/druid.d.ts +17 -0
  129. package/dist/dialects/druid.js +2 -0
  130. package/dist/dialects/druid.js.map +1 -0
  131. package/dist/dialects/duckdb.cjs +101 -0
  132. package/dist/dialects/duckdb.cjs.map +1 -0
  133. package/dist/dialects/duckdb.d.cts +795 -0
  134. package/dist/dialects/duckdb.d.ts +795 -0
  135. package/dist/dialects/duckdb.js +101 -0
  136. package/dist/dialects/duckdb.js.map +1 -0
  137. package/dist/dialects/dune.cjs +2 -0
  138. package/dist/dialects/dune.cjs.map +1 -0
  139. package/dist/dialects/dune.d.cts +21 -0
  140. package/dist/dialects/dune.d.ts +21 -0
  141. package/dist/dialects/dune.js +2 -0
  142. package/dist/dialects/dune.js.map +1 -0
  143. package/dist/dialects/exasol.cjs +2 -0
  144. package/dist/dialects/exasol.cjs.map +1 -0
  145. package/dist/dialects/exasol.d.cts +524 -0
  146. package/dist/dialects/exasol.d.ts +524 -0
  147. package/dist/dialects/exasol.js +2 -0
  148. package/dist/dialects/exasol.js.map +1 -0
  149. package/dist/dialects/fabric.cjs +2 -0
  150. package/dist/dialects/fabric.cjs.map +1 -0
  151. package/dist/dialects/fabric.d.cts +473 -0
  152. package/dist/dialects/fabric.d.ts +473 -0
  153. package/dist/dialects/fabric.js +2 -0
  154. package/dist/dialects/fabric.js.map +1 -0
  155. package/dist/dialects/hive.cjs +2 -0
  156. package/dist/dialects/hive.cjs.map +1 -0
  157. package/dist/dialects/hive.d.cts +602 -0
  158. package/dist/dialects/hive.d.ts +602 -0
  159. package/dist/dialects/hive.js +2 -0
  160. package/dist/dialects/hive.js.map +1 -0
  161. package/dist/dialects/materialize.cjs +2 -0
  162. package/dist/dialects/materialize.cjs.map +1 -0
  163. package/dist/dialects/materialize.d.cts +910 -0
  164. package/dist/dialects/materialize.d.ts +910 -0
  165. package/dist/dialects/materialize.js +2 -0
  166. package/dist/dialects/materialize.js.map +1 -0
  167. package/dist/dialects/mysql.cjs +2 -0
  168. package/dist/dialects/mysql.cjs.map +1 -0
  169. package/dist/dialects/mysql.d.cts +294 -0
  170. package/dist/dialects/mysql.d.ts +294 -0
  171. package/dist/dialects/mysql.js +2 -0
  172. package/dist/dialects/mysql.js.map +1 -0
  173. package/dist/dialects/oracle.cjs +2 -0
  174. package/dist/dialects/oracle.cjs.map +1 -0
  175. package/dist/dialects/oracle.d.cts +550 -0
  176. package/dist/dialects/oracle.d.ts +550 -0
  177. package/dist/dialects/oracle.js +2 -0
  178. package/dist/dialects/oracle.js.map +1 -0
  179. package/dist/dialects/postgres.cjs +2 -0
  180. package/dist/dialects/postgres.cjs.map +1 -0
  181. package/dist/dialects/postgres.d.cts +598 -0
  182. package/dist/dialects/postgres.d.ts +598 -0
  183. package/dist/dialects/postgres.js +2 -0
  184. package/dist/dialects/postgres.js.map +1 -0
  185. package/dist/dialects/presto.cjs +2 -0
  186. package/dist/dialects/presto.cjs.map +1 -0
  187. package/dist/dialects/presto.d.cts +176 -0
  188. package/dist/dialects/presto.d.ts +176 -0
  189. package/dist/dialects/presto.js +2 -0
  190. package/dist/dialects/presto.js.map +1 -0
  191. package/dist/dialects/prql.cjs +2 -0
  192. package/dist/dialects/prql.cjs.map +1 -0
  193. package/dist/dialects/prql.d.cts +506 -0
  194. package/dist/dialects/prql.d.ts +506 -0
  195. package/dist/dialects/prql.js +2 -0
  196. package/dist/dialects/prql.js.map +1 -0
  197. package/dist/dialects/redshift.cjs +2 -0
  198. package/dist/dialects/redshift.cjs.map +1 -0
  199. package/dist/dialects/redshift.d.cts +141 -0
  200. package/dist/dialects/redshift.d.ts +141 -0
  201. package/dist/dialects/redshift.js +2 -0
  202. package/dist/dialects/redshift.js.map +1 -0
  203. package/dist/dialects/risingwave.cjs +2 -0
  204. package/dist/dialects/risingwave.cjs.map +1 -0
  205. package/dist/dialects/risingwave.d.cts +488 -0
  206. package/dist/dialects/risingwave.d.ts +488 -0
  207. package/dist/dialects/risingwave.js +2 -0
  208. package/dist/dialects/risingwave.js.map +1 -0
  209. package/dist/dialects/singlestore.cjs +2 -0
  210. package/dist/dialects/singlestore.cjs.map +1 -0
  211. package/dist/dialects/singlestore.d.cts +73 -0
  212. package/dist/dialects/singlestore.d.ts +73 -0
  213. package/dist/dialects/singlestore.js +2 -0
  214. package/dist/dialects/singlestore.js.map +1 -0
  215. package/dist/dialects/snowflake.cjs +3 -0
  216. package/dist/dialects/snowflake.cjs.map +1 -0
  217. package/dist/dialects/snowflake.d.cts +326 -0
  218. package/dist/dialects/snowflake.d.ts +326 -0
  219. package/dist/dialects/snowflake.js +3 -0
  220. package/dist/dialects/snowflake.js.map +1 -0
  221. package/dist/dialects/solr.cjs +2 -0
  222. package/dist/dialects/solr.cjs.map +1 -0
  223. package/dist/dialects/solr.d.cts +468 -0
  224. package/dist/dialects/solr.d.ts +468 -0
  225. package/dist/dialects/solr.js +2 -0
  226. package/dist/dialects/solr.js.map +1 -0
  227. package/dist/dialects/spark.cjs +2 -0
  228. package/dist/dialects/spark.cjs.map +1 -0
  229. package/dist/dialects/spark.d.cts +500 -0
  230. package/dist/dialects/spark.d.ts +500 -0
  231. package/dist/dialects/spark.js +2 -0
  232. package/dist/dialects/spark.js.map +1 -0
  233. package/dist/dialects/spark2.cjs +2 -0
  234. package/dist/dialects/spark2.cjs.map +1 -0
  235. package/dist/dialects/spark2.d.cts +497 -0
  236. package/dist/dialects/spark2.d.ts +497 -0
  237. package/dist/dialects/spark2.js +2 -0
  238. package/dist/dialects/spark2.js.map +1 -0
  239. package/dist/dialects/sqlite.cjs +2 -0
  240. package/dist/dialects/sqlite.cjs.map +1 -0
  241. package/dist/dialects/sqlite.d.cts +521 -0
  242. package/dist/dialects/sqlite.d.ts +521 -0
  243. package/dist/dialects/sqlite.js +2 -0
  244. package/dist/dialects/sqlite.js.map +1 -0
  245. package/dist/dialects/starrocks.cjs +2 -0
  246. package/dist/dialects/starrocks.cjs.map +1 -0
  247. package/dist/dialects/starrocks.d.cts +529 -0
  248. package/dist/dialects/starrocks.d.ts +529 -0
  249. package/dist/dialects/starrocks.js +2 -0
  250. package/dist/dialects/starrocks.js.map +1 -0
  251. package/dist/dialects/tableau.cjs +2 -0
  252. package/dist/dialects/tableau.cjs.map +1 -0
  253. package/dist/dialects/tableau.d.cts +476 -0
  254. package/dist/dialects/tableau.d.ts +476 -0
  255. package/dist/dialects/tableau.js +2 -0
  256. package/dist/dialects/tableau.js.map +1 -0
  257. package/dist/dialects/teradata.cjs +2 -0
  258. package/dist/dialects/teradata.cjs.map +1 -0
  259. package/dist/dialects/teradata.d.cts +549 -0
  260. package/dist/dialects/teradata.d.ts +549 -0
  261. package/dist/dialects/teradata.js +2 -0
  262. package/dist/dialects/teradata.js.map +1 -0
  263. package/dist/dialects/trino.cjs +2 -0
  264. package/dist/dialects/trino.cjs.map +1 -0
  265. package/dist/dialects/trino.d.cts +475 -0
  266. package/dist/dialects/trino.d.ts +475 -0
  267. package/dist/dialects/trino.js +2 -0
  268. package/dist/dialects/trino.js.map +1 -0
  269. package/dist/dialects/tsql.cjs +2 -0
  270. package/dist/dialects/tsql.cjs.map +1 -0
  271. package/dist/dialects/tsql.d.cts +719 -0
  272. package/dist/dialects/tsql.d.ts +719 -0
  273. package/dist/dialects/tsql.js +2 -0
  274. package/dist/dialects/tsql.js.map +1 -0
  275. package/dist/index.cjs +26 -0
  276. package/dist/index.cjs.map +1 -0
  277. package/dist/index.d.cts +257 -0
  278. package/dist/index.d.ts +257 -0
  279. package/dist/index.js +26 -0
  280. package/dist/index.js.map +1 -0
  281. package/dist/tokens-DOFGCO-T.d.cts +21871 -0
  282. package/dist/tokens-DOFGCO-T.d.ts +21871 -0
  283. package/package.json +267 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,242 @@
1
+ # sqlingo
2
+
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 98bee52: - 4f36310: Sync to sqlglot v30.0.0:
8
+ - feat: support multi-word DESCRIBE kinds in Snowflake (DYNAMIC TABLE, MASKING POLICY, API INTEGRATION, etc.)
9
+ - feat(duckdb): ARRAY_SORT, ARRAY_SLICE, ARRAY_INTERSECTION/EXCEPT bag/set semantics, ARRAYS_OVERLAP, SPLIT_PART, MAP_INSERT, MAP_PICK, RANDOM, DATE_TRUNC week start, IGNORE NULLS in AGG FUNC, GROUPS window frame, TO_VARIANT
10
+ - feat(snowflake): window frame for ranking functions, positional GENERATOR args, TO_GEOGRAPHY/TO_GEOMETRY as Cast, SPLIT NULL/empty separator, JSON path dynamic brackets, ARRAY_SORT with nulls
11
+ - feat(clickhouse): DETACH, combined aggregate functions (multi-suffix), cityHash64, ASSUME/CHECK constraints, dotcolon JSON array types, nested field INSERT, ArrayDistinct, ANY/ALL joins
12
+ - feat: consolidate SecurityProperty into SqlSecurityProperty with MySQL locateProperties
13
+ - feat(hive/spark): IGNORE NULLS boolean arg, dash in JSON path, RECURSIVE CTEs
14
+ - feat: parser fast path for column reference parsing
15
+ - fix: Athena kind case mismatch, Oracle InOutColumnConstraint.pop(), Spark DECLARE_DEFAULT_ASSIGNMENT, WindowSpecExpr type-only import, ClickHouse parseDefiner override
16
+ - fix: optimizer pushdown_dnf forward-reference guard, qualify_tables FQN alias mapping, unnest_subqueries crash
17
+
18
+ ## 0.7.1
19
+
20
+ ### Patch Changes
21
+
22
+ - b453c63: Sync to sqlglot 29.0.1:
23
+ - feat(duckdb): support GET_CURRENT_TIME() mapping to CURRENT_TIME
24
+ - reorder JARO_WINKLER_SIMILARITY alphabetically in DuckDB FUNCTIONS
25
+
26
+ ## 0.7.0
27
+
28
+ ### Minor Changes
29
+
30
+ - a87134d: Minification mangles class names, causing emitted SQL to be gibberish
31
+
32
+ ## 0.6.1 (retracted)
33
+
34
+ ### Patch Changes
35
+
36
+ - e6fdbfa: Update new API in readme
37
+
38
+ ## 0.6.0 (retracted)
39
+
40
+ ### BREAKING CHANGES
41
+
42
+ - Dialect imports no longer auto-register via side effects. Pass dialect classes directly or call `Dialect.register()` explicitly:
43
+
44
+ ```ts
45
+ // Before (v0.5.0)
46
+ import "sqlingo/mysql";
47
+ parse("SELECT 1", { read: "mysql" });
48
+
49
+ // After (v0.6.0) - preferred: pass class directly
50
+ import { MySQL } from "sqlingo/mysql";
51
+ parse("SELECT 1", { read: MySQL });
52
+
53
+ // After (v0.6.0) - opt-in string lookup
54
+ import { Dialect } from "sqlingo";
55
+ import { MySQL } from "sqlingo/mysql";
56
+ Dialect.register(MySQL);
57
+ parse("SELECT 1", { read: "mysql" });
58
+ ```
59
+
60
+ - `Dialect.register()` signature changed from `register(name, class)` to `register(...classes)`.
61
+
62
+ ### Minor Changes
63
+
64
+ - 625fb15: Fix circular imports leading to unusability
65
+ - Side-effect-free API surface enables tree shaking
66
+ - Package marked with `"sideEffects": false`
67
+
68
+ ### Patch Changes
69
+
70
+ - Resolve all 44 failing dialect tests ported from sqlglot v29.0.0 (MySQL, BigQuery, Trino, Databricks, SingleStore, Doris, StarRocks, Drill, Druid, Solr)
71
+ - Fix generator method dispatch casing (`dPipeSql`, `atTimeZoneSql`, `regexpExtractAllSql`, `startsWithSql`) and `ExpressionKey.STARTS_WITH` enum value to match camelCase convention
72
+ - Fix `ORIGINAL_KEYWORDS` convention in Spark/Drill tokenizers, preventing `@cache` inheritance bugs for subclass dialects (e.g. Databricks VOID keyword)
73
+ - Fix `renameFunc` to mirror sqlglot's `*flatten(expression.args.values())`
74
+ - Fix `groupConcatSql` dialect-aware generation and `sep: null` semantics (Python `None` vs JS `undefined`)
75
+ - Fix `pivotAliasSql` to use `toIdentifier()` for numeric alias quoting without mutating shared AST
76
+ - Fix `unixDateSql` to route through dialect generators via `DateDiffExpr` instead of raw string
77
+ - Fix DuckDB `trimSql` BLOB-to-TEXT wrapping, `unnestSql` AS keyword, `numberToStrSql` culture check
78
+ - Fix `explodeProjectionToUnnest`: correct `BracketExpr` indexing, `func()` expression building, `offset: 1` for BigQuery `SAFE_ORDINAL`
79
+ - Fix BigQuery `arrayContainsSql` (`LiteralExpr` not `IdentifierExpr`), ML function kwargs snake-to-camelCase, `buildJsonStripNulls` kwargs, jsonpath `VAR_TOKENS` for hyphenated keys
80
+ - Fix `analyzeSql` clause ordering, `introducerSql` prefix, `boolXorSql` template literal, `ShaLLOW` typo, `sqlName()` call
81
+ - Fix `annotateTypes` to preserve `CastExpr` natural type (not overwrite with `UNKNOWN`), add `INVERSE_FORMAT_TRIE` for format roundtrip
82
+ - Fix MySQL `ESCAPE_FOLLOW_CHARS` static, escape string handling, `timestampTruncSql` quotes, `TO_DAYS` paren, `CharacterSet` default
83
+ - Fix expression `argOrder` for `GapFillExpr`, `TimeStrToTimeExpr`, `TimeExpr`, `RegexpExtractAllExpr`
84
+ - Fix Snowflake inverse time mapping (`mmmm`/`mon`), SingleStore WEEKDAY/Repeat/IsAscii, StarRocks `createSql`, Doris partition parsing/property quoting, Oracle `ON_CONDITION_EMPTY_BEFORE_ERROR`
85
+ - Fix `subsecondPrecision` to use regex instead of Luxon for space-separated timestamps
86
+ - Add missing `register()` on `ExplodeOuterExpr`, `PosexplodeOuterExpr`, `ApproxQuantileExpr`, `ArrayExceptExpr`, `JsonArrayExpr.fromArgList`, `JsonbContainsExpr`, `JsonArrayContainsExpr`, `AndExpr`, `OrExpr`, `XorExpr`
87
+ - Add `TsOrDsAddExpr` type annotation in Spark2/Hive typing for `ADD_MONTHS` transpilation
88
+ - Fix test porting issues: BigQuery byte strings, MySQL escape sequences, raw string newlines, hex byte chars, bracket assertions, `from_` to `from` property access
89
+
90
+ ## 0.5.0 (retracted)
91
+
92
+ ### Minor Changes
93
+
94
+ - 920aef4: Sync to sqlglot 29.0.0
95
+
96
+ ## 0.4.2 (retracted)
97
+
98
+ ### Patch Changes
99
+
100
+ - cd3a34c: Bump deps to resolve dependabot security alerts: `vite` ^8.0.10 to ^8.1.0, `dompurify` override to ^3.4.11, add `ws` ^8.21.0 and `js-yaml` ^4.2.0 overrides
101
+ - f0d9075: Override read-yaml-file to fix changeset js-yaml compatibility
102
+
103
+ ## 0.4.1 (retracted)
104
+
105
+ ### Patch Changes
106
+
107
+ - 13e61b1: Fix various porting bugs in BigQuery, DuckDB, ClickHouse, and other dialects. All tests are now passing.
108
+
109
+ ## 0.4.0 (retracted)
110
+
111
+ ### Minor Changes
112
+
113
+ - ec190bb: Add missing snowflake, presto, clickhouse tests and fix various bugs related to them (undiscovered before). The work is still in progress as not 100% tests are passing yet
114
+ - 7ad6584: Annotate FORMAT_STRING(expr) for Spark ([upstream commit](https://github.com/tobymao/sqlglot/commit/1418494f777358f4b6bd1e05ee5cb02591d92c74))
115
+ - 7ad6584: Add numeric TRUNC output for additional dialects: ClickHouse, Presto, Hive, SQLite ([upstream commit](https://github.com/tobymao/sqlglot/commit/ff1fd521147cb66acc36f2da7b1590d9e7f8140f))
116
+
117
+ ## 0.3.2 (retracted)
118
+
119
+ ### Patch Changes
120
+
121
+ - 92777d6: Update README.md copywriting
122
+
123
+ ## 0.3.1 (retracted)
124
+
125
+ ### Patch Changes
126
+
127
+ - Pin upstream sqlglot to 87250100 to include exp.Trunc for numeric truncation
128
+
129
+ ## 0.3.0 (retracted)
130
+
131
+ ### Minor Changes
132
+
133
+ - cdd20a2: Bump vitest to 4.1.0 & pin vite to 7.3.5 (to support esm decorators)
134
+ - 067de4d: Reorganize the packages to split the lockfile of playground from the sqlingo package
135
+
136
+ ## 0.2.3 (retracted)
137
+
138
+ ### Patch Changes
139
+
140
+ - e9855e1: Sync with [sqlglot@28.10.1](https://github.com/tobymao/sqlglot/pull/7032)
141
+ - Support missing meta when updating position metadata for an expression ([sqglot#7032](https://github.com/tobymao/sqlglot/pull/7032))
142
+
143
+ ## 0.2.2 (retracted)
144
+
145
+ ### Patch Changes
146
+
147
+ - 98abe58: Guard against prototype-polluting assignment in `Expression.setArgKey` [#2](https://github.com/huydo862003/sqlingo.js/pull/2)
148
+
149
+ ## 0.2.1 (retracted)
150
+
151
+ ### Patch Changes
152
+
153
+ - 7c03a7e:
154
+ - Update `dompurify` from 3.2.7 to 3.4.2 to resolve vulnerability issues [#1](https://github.com/huydo862003/sqlingo.js/pull/1)
155
+ - Update `picomatch` from 2.3.1 to 4.0.4 to resolve vulnerability issues [#1](https://github.com/huydo862003/sqlingo.js/pull/1)
156
+ - Update `postcss` from 8.5.8 to 8.5.14 to resolve vulnerability issues [#1](https://github.com/huydo862003/sqlingo.js/pull/1)
157
+
158
+ ## 0.2.0 (retracted)
159
+
160
+ ### Minor Changes
161
+
162
+ - 62626fd: Complete AI migration. Most code are human-generated now.
163
+
164
+ ## 0.1.7 (retracted)
165
+
166
+ ### Patch Changes
167
+
168
+ - 29256e1: Fix vulnerability issues
169
+ - b4924ce: Bump flatted to 3.4.2 to fix vulnerability issue
170
+
171
+ ## 0.1.6 (retracted)
172
+
173
+ ### Patch Changes
174
+
175
+ - 8967932: Fix copywriting of README
176
+
177
+ ## 0.1.5 (retracted)
178
+
179
+ ### Patch Changes
180
+
181
+ - Redesign homepage with genuix design system; bump to v0.1.5.
182
+
183
+ ## 0.1.4 (retracted)
184
+
185
+ ### Patch Changes
186
+
187
+ - 1ad4d3e: (fck-AI-slop) Migrating from AI slops
188
+
189
+ ## 0.1.3 (retracted)
190
+
191
+ ### Patch Changes
192
+
193
+ - 6aeadaa: Add disclaimer about AI usage
194
+
195
+ ## 0.1.2 (retracted)
196
+
197
+ ### Patch Changes
198
+
199
+ - a0cbe60: Add warnings to npm doc page
200
+
201
+ ## 0.1.1 (retracted)
202
+
203
+ ### Patch Changes
204
+
205
+ - c90ac1e: Update API doc for npm package
206
+
207
+ ## 0.1.0 (retracted)
208
+
209
+ ### Minor Changes
210
+
211
+ - Add lazy dialect entrypoints (`sqlingo/postgres`, `/mysql`, `/tsql`, `/mssql`, etc.). Import core without loading any dialect; register only what you need.
212
+
213
+ ## 0.0.5 (retracted)
214
+
215
+ ### Patch Changes
216
+
217
+ - dc5780a: Update copywriting
218
+
219
+ ## 0.0.4 (retracted)
220
+
221
+ ### Patch Changes
222
+
223
+ - 4667ffe: Update README
224
+
225
+ ## 0.0.3 (retracted)
226
+
227
+ ### Patch Changes
228
+
229
+ - cdf377d: Include CHANGELOG.md to package
230
+
231
+ ## 0.0.2 (retracted)
232
+
233
+ ### Patch Changes
234
+
235
+ - Add GitHub repository info to package.json
236
+ - Add npm-specific README with usage guide and copyright notice
237
+
238
+ ## 0.0.1 (retracted)
239
+
240
+ ### Patch Changes
241
+
242
+ - First alpha version
@@ -0,0 +1,31 @@
1
+ This project incorporates code from the following sources:
2
+
3
+ ===============================================================================
4
+
5
+ sqlingo.js
6
+ Copyright (c) 2026 Huy DNA
7
+ Licensed under the MIT License
8
+
9
+ ===============================================================================
10
+
11
+ SQLGlot (https://github.com/tobymao/sqlglot)
12
+ Copyright (c) 2025 Toby Mao
13
+ Licensed under the MIT License
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Huy DNA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,189 @@
1
+ # sqlingo
2
+
3
+ [![npm version](https://img.shields.io/npm/v/sqlingo)](https://www.npmjs.com/package/sqlingo)
4
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](https://github.com/huydo862003/sqlingo.js/blob/master/LICENSE)
5
+ ![SQLGlot](https://img.shields.io/badge/SQLGlot-v30.0.0-blue)
6
+ <a href="https://github.com/huydo862003/Fck-AI-Slop#plan"><img src="https://img.shields.io/badge/human%20slop-90EE90"></a>
7
+
8
+ A JavaScript/TypeScript port of [SQLGlot](https://github.com/tobymao/sqlglot) which is compatible with browser and Node runtimes.
9
+
10
+ This package allows you to parse, transpile, optimize, and execute SQL across **32 dialects** in JavaScript.
11
+
12
+ WARNING: This package is still in alpha.
13
+ - Although the SQLGlot tests have all passed, but finding contrived failures may require me to use this package extensively myself.
14
+ - You can also help me report bugs in the Github issue.
15
+
16
+ NOTICE: AI is not the decision maker, designer or maintainer for this project. It is indeed sometimes used to port straightforward code with less effort. However, the point is to always keep its usage under control & understand what's going on, so I can maintain this project reliably as sqlglot updates.
17
+
18
+ - [GitHub](https://github.com/huydo862003/sqlingo.js)
19
+ - [Issues](https://github.com/huydo862003/sqlingo.js/issues)
20
+ - [Changelog](https://github.com/huydo862003/sqlingo.js/blob/master/CHANGELOG.md)
21
+
22
+ ## Features
23
+
24
+ - 32 SQL dialects: Postgres, MySQL, BigQuery, Snowflake, DuckDB, ClickHouse, Redshift, Athena, Spark, and many more
25
+ - Some SQLGlot feature set: parsing, transpilation, optimization, column lineage, SQL diffing, and execution
26
+ - Pure JavaScript: no need for WASM or native dependencies
27
+ - TypeScript-first: full type definitions included
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ npm install sqlingo
33
+ # or
34
+ pnpm add sqlingo
35
+ ```
36
+
37
+ Peer dependency: [`luxon`](https://www.npmjs.com/package/luxon) (^3.7.2) is required for date/time operations.
38
+
39
+ ## Quick Start
40
+
41
+ This example demonstrates transpiling a query from Spark to Postgres and then optimizing it.
42
+
43
+ ```ts
44
+ import { transpile, parseOne, optimize, MappingSchema } from "sqlingo";
45
+ import { Postgres } from "sqlingo/postgres";
46
+ import { Spark } from "sqlingo/spark";
47
+
48
+ // Transpile between dialects
49
+ const [pgSql] = transpile("SELECT APPROX_COUNT_DISTINCT(x) FROM table", {
50
+ read: Spark,
51
+ write: Postgres,
52
+ });
53
+ console.log(pgSql);
54
+ // Output: SELECT COUNT(DISTINCT x) FROM "table"
55
+
56
+ // Optimize an expression
57
+ const sql = "SELECT a, b FROM t WHERE a + 1 = 2";
58
+ const schema = new MappingSchema({ t: { a: "int", b: "int" } });
59
+
60
+ const optimized = optimize(parseOne(sql), { schema });
61
+ console.log(optimized.sql());
62
+ // Output: SELECT t.a AS a, t.b AS b FROM t AS t WHERE t.a = 1
63
+ ```
64
+
65
+ ## Core Usage
66
+
67
+ ### Parsing
68
+
69
+ Parse SQL strings into expression trees (AST).
70
+
71
+ ```ts
72
+ import { parse, parseOne } from "sqlingo";
73
+
74
+ // Parse multiple statements
75
+ const expressions = parse("SELECT 1; SELECT 2");
76
+
77
+ // Parse a single statement
78
+ const expr = parseOne("SELECT a, b FROM t WHERE a > 1");
79
+ ```
80
+
81
+ ### Transpiling
82
+
83
+ Convert SQL between different dialects.
84
+
85
+ ```ts
86
+ import { transpile } from "sqlingo";
87
+ import { DuckDB } from "sqlingo/duckdb";
88
+ import { Hive } from "sqlingo/hive";
89
+
90
+ const [result] = transpile("SELECT EPOCH_MS(1618088028295)", {
91
+ read: DuckDB,
92
+ write: Hive,
93
+ });
94
+ // Output: "SELECT FROM_UNIXTIME(1618088028295 / POW(10, 3))"
95
+ ```
96
+
97
+ ### Tokenizing
98
+
99
+ Extract tokens from a SQL string for lower-level analysis.
100
+
101
+ ```ts
102
+ import { tokenize } from "sqlingo";
103
+ import { Postgres } from "sqlingo/postgres";
104
+
105
+ const tokens = tokenize("SELECT 1", {
106
+ dialect: Postgres,
107
+ });
108
+ ```
109
+
110
+ ## SQL Builder
111
+
112
+ Build queries programmatically using a fluent API.
113
+
114
+ ```ts
115
+ import { select, condition } from "sqlingo";
116
+ import { MySQL } from "sqlingo/mysql";
117
+
118
+ const query = select("a", "b").from("t").where(condition("a > 1")).limit(10);
119
+
120
+ console.log(
121
+ query.sql({
122
+ dialect: MySQL,
123
+ }),
124
+ );
125
+ // Output: SELECT a, b FROM t WHERE a > 1 LIMIT 10
126
+ ```
127
+
128
+ ## Optimization & Analysis
129
+
130
+ ### Optimization
131
+
132
+ Simplify and normalize queries based on schema information.
133
+
134
+ ```ts
135
+ import { optimize, MappingSchema } from "sqlingo";
136
+
137
+ const schema = new MappingSchema({
138
+ // define your schema
139
+ });
140
+
141
+ const optimized = optimize(parseOne("SELECT * FROM t"), { schema });
142
+ ```
143
+
144
+ ### Column Lineage
145
+
146
+ Trace the origin of columns through subqueries and joins.
147
+
148
+ ```ts
149
+ import { lineage } from "sqlingo";
150
+
151
+ const node = lineage("b", "SELECT a AS b FROM (SELECT x AS a FROM y)");
152
+ console.log(node.source.name);
153
+ // Output: "y"
154
+ ```
155
+
156
+ ## Registering a Custom Dialect
157
+
158
+ You can extend the library by registering custom dialects or overriding existing behavior.
159
+
160
+ ```ts
161
+ import { Dialect, Generator, transpile } from "sqlingo";
162
+
163
+ class MyDialect extends Dialect {
164
+ static DIALECT_NAME = "my_dialect";
165
+
166
+ static Generator = class extends Generator {
167
+ // Override how specific expressions are generated
168
+ };
169
+ }
170
+
171
+ // Register for string-based lookup
172
+ Dialect.register(MyDialect);
173
+
174
+ const [result] = transpile("SELECT 1", { write: MyDialect });
175
+ ```
176
+
177
+ ## Supported Dialects
178
+
179
+ Athena, BigQuery, ClickHouse, Databricks, Doris, Dremio, Drill, Druid, DuckDB, Dune, Exasol, Fabric, Hive, Materialize, MySQL, Oracle, Postgres, Presto, PRQL, Redshift, RisingWave, SingleStore, Snowflake, Solr, Spark, Spark2, SQLite, StarRocks, Tableau, Teradata, Trino, TSQL
180
+
181
+ ## SQLGlot Compatibility
182
+
183
+ This package tracks [SQLGlot](https://github.com/tobymao/sqlglot) v30.0.0 (commit `a3929be`). The API surface mirrors SQLGlot's Python API, adapted to TypeScript conventions. See [CONVENTION.md](https://github.com/huydo862003/sqlingo.js/blob/master/CONVENTION.md) for details.
184
+
185
+ ## License
186
+
187
+ MIT. See [LICENSE](https://github.com/huydo862003/sqlingo.js/blob/master/LICENSE).
188
+
189
+ Based on [SQLGlot](https://github.com/tobymao/sqlglot) by Toby Mao (MIT). See [COPYRIGHT_NOTICE](https://github.com/huydo862003/sqlingo.js/blob/master/COPYRIGHT_NOTICE).
package/README.npm.md ADDED
@@ -0,0 +1,189 @@
1
+ # sqlingo
2
+
3
+ [![npm version](https://img.shields.io/npm/v/sqlingo)](https://www.npmjs.com/package/sqlingo)
4
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](https://github.com/huydo862003/sqlingo.js/blob/master/LICENSE)
5
+ ![SQLGlot](https://img.shields.io/badge/SQLGlot-v30.0.0-blue)
6
+ <a href="https://github.com/huydo862003/Fck-AI-Slop#plan"><img src="https://img.shields.io/badge/human%20slop-90EE90"></a>
7
+
8
+ A JavaScript/TypeScript port of [SQLGlot](https://github.com/tobymao/sqlglot) which is compatible with browser and Node runtimes.
9
+
10
+ This package allows you to parse, transpile, optimize, and execute SQL across **32 dialects** in JavaScript.
11
+
12
+ WARNING: This package is still in alpha.
13
+ - Although the SQLGlot tests have all passed, but finding contrived failures may require me to use this package extensively myself.
14
+ - You can also help me report bugs in the Github issue.
15
+
16
+ NOTICE: AI is not the decision maker, designer or maintainer for this project. It is indeed sometimes used to port straightforward code with less effort. However, the point is to always keep its usage under control & understand what's going on, so I can maintain this project reliably as sqlglot updates.
17
+
18
+ - [GitHub](https://github.com/huydo862003/sqlingo.js)
19
+ - [Issues](https://github.com/huydo862003/sqlingo.js/issues)
20
+ - [Changelog](https://github.com/huydo862003/sqlingo.js/blob/master/CHANGELOG.md)
21
+
22
+ ## Features
23
+
24
+ - 32 SQL dialects: Postgres, MySQL, BigQuery, Snowflake, DuckDB, ClickHouse, Redshift, Athena, Spark, and many more
25
+ - Some SQLGlot feature set: parsing, transpilation, optimization, column lineage, SQL diffing, and execution
26
+ - Pure JavaScript: no need for WASM or native dependencies
27
+ - TypeScript-first: full type definitions included
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ npm install sqlingo
33
+ # or
34
+ pnpm add sqlingo
35
+ ```
36
+
37
+ Peer dependency: [`luxon`](https://www.npmjs.com/package/luxon) (^3.7.2) is required for date/time operations.
38
+
39
+ ## Quick Start
40
+
41
+ This example demonstrates transpiling a query from Spark to Postgres and then optimizing it.
42
+
43
+ ```ts
44
+ import { transpile, parseOne, optimize, MappingSchema } from "sqlingo";
45
+ import { Postgres } from "sqlingo/postgres";
46
+ import { Spark } from "sqlingo/spark";
47
+
48
+ // Transpile between dialects
49
+ const [pgSql] = transpile("SELECT APPROX_COUNT_DISTINCT(x) FROM table", {
50
+ read: Spark,
51
+ write: Postgres,
52
+ });
53
+ console.log(pgSql);
54
+ // Output: SELECT COUNT(DISTINCT x) FROM "table"
55
+
56
+ // Optimize an expression
57
+ const sql = "SELECT a, b FROM t WHERE a + 1 = 2";
58
+ const schema = new MappingSchema({ t: { a: "int", b: "int" } });
59
+
60
+ const optimized = optimize(parseOne(sql), { schema });
61
+ console.log(optimized.sql());
62
+ // Output: SELECT t.a AS a, t.b AS b FROM t AS t WHERE t.a = 1
63
+ ```
64
+
65
+ ## Core Usage
66
+
67
+ ### Parsing
68
+
69
+ Parse SQL strings into expression trees (AST).
70
+
71
+ ```ts
72
+ import { parse, parseOne } from "sqlingo";
73
+
74
+ // Parse multiple statements
75
+ const expressions = parse("SELECT 1; SELECT 2");
76
+
77
+ // Parse a single statement
78
+ const expr = parseOne("SELECT a, b FROM t WHERE a > 1");
79
+ ```
80
+
81
+ ### Transpiling
82
+
83
+ Convert SQL between different dialects.
84
+
85
+ ```ts
86
+ import { transpile } from "sqlingo";
87
+ import { DuckDB } from "sqlingo/duckdb";
88
+ import { Hive } from "sqlingo/hive";
89
+
90
+ const [result] = transpile("SELECT EPOCH_MS(1618088028295)", {
91
+ read: DuckDB,
92
+ write: Hive,
93
+ });
94
+ // Output: "SELECT FROM_UNIXTIME(1618088028295 / POW(10, 3))"
95
+ ```
96
+
97
+ ### Tokenizing
98
+
99
+ Extract tokens from a SQL string for lower-level analysis.
100
+
101
+ ```ts
102
+ import { tokenize } from "sqlingo";
103
+ import { Postgres } from "sqlingo/postgres";
104
+
105
+ const tokens = tokenize("SELECT 1", {
106
+ dialect: Postgres,
107
+ });
108
+ ```
109
+
110
+ ## SQL Builder
111
+
112
+ Build queries programmatically using a fluent API.
113
+
114
+ ```ts
115
+ import { select, condition } from "sqlingo";
116
+ import { MySQL } from "sqlingo/mysql";
117
+
118
+ const query = select("a", "b").from("t").where(condition("a > 1")).limit(10);
119
+
120
+ console.log(
121
+ query.sql({
122
+ dialect: MySQL,
123
+ }),
124
+ );
125
+ // Output: SELECT a, b FROM t WHERE a > 1 LIMIT 10
126
+ ```
127
+
128
+ ## Optimization & Analysis
129
+
130
+ ### Optimization
131
+
132
+ Simplify and normalize queries based on schema information.
133
+
134
+ ```ts
135
+ import { optimize, MappingSchema } from "sqlingo";
136
+
137
+ const schema = new MappingSchema({
138
+ // define your schema
139
+ });
140
+
141
+ const optimized = optimize(parseOne("SELECT * FROM t"), { schema });
142
+ ```
143
+
144
+ ### Column Lineage
145
+
146
+ Trace the origin of columns through subqueries and joins.
147
+
148
+ ```ts
149
+ import { lineage } from "sqlingo";
150
+
151
+ const node = lineage("b", "SELECT a AS b FROM (SELECT x AS a FROM y)");
152
+ console.log(node.source.name);
153
+ // Output: "y"
154
+ ```
155
+
156
+ ## Registering a Custom Dialect
157
+
158
+ You can extend the library by registering custom dialects or overriding existing behavior.
159
+
160
+ ```ts
161
+ import { Dialect, Generator, transpile } from "sqlingo";
162
+
163
+ class MyDialect extends Dialect {
164
+ static DIALECT_NAME = "my_dialect";
165
+
166
+ static Generator = class extends Generator {
167
+ // Override how specific expressions are generated
168
+ };
169
+ }
170
+
171
+ // Register for string-based lookup
172
+ Dialect.register(MyDialect);
173
+
174
+ const [result] = transpile("SELECT 1", { write: MyDialect });
175
+ ```
176
+
177
+ ## Supported Dialects
178
+
179
+ Athena, BigQuery, ClickHouse, Databricks, Doris, Dremio, Drill, Druid, DuckDB, Dune, Exasol, Fabric, Hive, Materialize, MySQL, Oracle, Postgres, Presto, PRQL, Redshift, RisingWave, SingleStore, Snowflake, Solr, Spark, Spark2, SQLite, StarRocks, Tableau, Teradata, Trino, TSQL
180
+
181
+ ## SQLGlot Compatibility
182
+
183
+ This package tracks [SQLGlot](https://github.com/tobymao/sqlglot) v30.0.0 (commit `a3929be`). The API surface mirrors SQLGlot's Python API, adapted to TypeScript conventions. See [CONVENTION.md](https://github.com/huydo862003/sqlingo.js/blob/master/CONVENTION.md) for details.
184
+
185
+ ## License
186
+
187
+ MIT. See [LICENSE](https://github.com/huydo862003/sqlingo.js/blob/master/LICENSE).
188
+
189
+ Based on [SQLGlot](https://github.com/tobymao/sqlglot) by Toby Mao (MIT). See [COPYRIGHT_NOTICE](https://github.com/huydo862003/sqlingo.js/blob/master/COPYRIGHT_NOTICE).