Commit 16c9afd
feat: add ClickHouse support to
* feat: add ClickHouse database engine support
Add ClickHouse support using the github.com/sqlc-dev/doubleclick parser library.
New files in internal/engine/clickhouse/:
- parse.go: Parser implementation using doubleclick
- convert.go: AST converter from doubleclick to sqlc AST
- format.go: ClickHouse-specific SQL formatting
- catalog.go: Catalog initialization
- stdlib.go: Standard library functions
- reserved.go: Reserved keywords
- utils.go: Helper functions
- parse_test.go: Unit tests
Supported SQL operations:
- SELECT with JOINs, subqueries, CTEs, window functions
- INSERT with VALUES and SELECT subquery
- UPDATE and DELETE
- CREATE TABLE, ALTER TABLE, DROP TABLE, TRUNCATE
Co-Authored-By: Claude <[email protected]>
* chore: remove test file
Co-Authored-By: Claude <[email protected]>
* chore: return empty function set from stdlib
Co-Authored-By: Claude <[email protected]>
* refactor: move ClickHouse support to parse command only
Remove ClickHouse from compiler/engine.go and config.go.
Add --dialect clickhouse support to the sqlc parse command.
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>sqlc parse (#4267)1 parent 2e0435c commit 16c9afd
File tree
10 files changed
+1367
-6
lines changed- internal
- cmd
- engine/clickhouse
10 files changed
+1367
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
38 | | - | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
74 | 81 | | |
75 | | - | |
| 82 | + | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments