Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Clickhouse support #1628

Open
bojdell opened this issue May 17, 2022 · 7 comments
Open

Add Clickhouse support #1628

bojdell opened this issue May 17, 2022 · 7 comments
Labels
enhancement New feature or request new/engine

Comments

@bojdell
Copy link

bojdell commented May 17, 2022

What do you want to change?

I've enjoyed using sqlc with postgres. However, I'm starting to do more work with Clickhouse and it would be great to also use sqlc there. I imagine this is a similar ask to #161 for sqlite and the core work required is integrating a query parser for ClickHouse. I don't have much experience in this area, but here is some potentially related content that may be helpful:

What database engines need to be changed?

No response

What programming language backends need to be changed?

No response

@bojdell bojdell added enhancement New feature or request triage New issues that hasn't been reviewed labels May 17, 2022
@kyleconroy kyleconroy removed the triage New issues that hasn't been reviewed label Jun 4, 2022
@bojdell
Copy link
Author

bojdell commented Jul 15, 2022

@kyleconroy was there an outcome of the triaging?

@bojdell
Copy link
Author

bojdell commented Jul 18, 2022

An alternate solution that's likely easier to implement is to add an argument to bypass schema validation - aka allow query generation without statically checking the queries against the schema and let the user rely on test codepaths to ensure correctness of the logic. Obviously using the argument would sacrifice safety but gain flexibility, enabling support for any ANSI SQL driver. Thoughts?

@kyleconroy kyleconroy changed the title Clickhouse Support Support Clickhouse Aug 28, 2022
@kyleconroy kyleconroy changed the title Support Clickhouse Clickhouse Support Aug 28, 2022
@cqhung1412
Copy link

Hi, @kyleconroy I'd like to ask if there is any progress on this.

@kyleconroy kyleconroy changed the title Clickhouse Support Add Clickhouse support Sep 26, 2023
@nexovec
Copy link

nexovec commented Dec 16, 2023

Are you guys considering this?

@matthewshirley
Copy link

matthewshirley commented Mar 21, 2024

I was also curious, but I don't think it is possible with the provided ANTLR4, as the output for Go is unusable:

Support was also dropped for the ANTLR4 files:

Seems that a similar pattern to Postgres could be used with this clickhouse-sql-parser (https://github.com/AfterShip/clickhouse-sql-parser).

@w0rp
Copy link

w0rp commented Jul 8, 2024

I'm very much interested in having this as a feature, as I'd like to use this library to build tools that use ClickHouse as the only SQL-like database.

@1saifj
Copy link

1saifj commented Sep 19, 2024

Sqlc supporting Clickhouse is a big addition!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new/engine
Projects
None yet
Development

No branches or pull requests

7 participants