sqlc-dev / sqlc

Generate type-safe code from SQL
https://sqlc.dev
MIT License
13.52k stars 810 forks source link

Cassandra(or ScyllaDB) support #3535

Open rpstw opened 3 months ago

rpstw commented 3 months ago

What do you want to change?

We plan to migrate some Postgres workload to ScyllaDB in the next months due to scaling and cost reasons. We heavily use sqlc in the past for Postgres workload, so naturally some Cassandra support in sqlc would be great.

Being a sqlc user for a lot time, I'm not certain about the overall idea. Does the Cassandra support also in the roadmap of the sqlc developers and users? How many code need to be written for the support?

Opinions and advice would be really helpful, also, if Cassandra is really a can-have, I could devote some time implementing it.

What database engines need to be changed?

No response

What programming language backends need to be changed?

Go

kyleconroy commented 3 months ago

There are no short term plans to add database engines beyond MySQL, PostgreSQL and SQLite. The reason is that those three engines are due for a large rewrite in how they work. I want to move sqlc to directly use databases for query analysis, which should make it much easier to support newer engines in the future.

That said if you'd like to see Cassandra / ScyllaDB support, there's some background research that needs to be done. To add a new database engine, we need to have access to a high-quality parser that can both parse and render a SQL AST. The engine itself needs to support analyzing queries.

I've never used Cassandra / ScyllaDB before. Do you think it has these capabilities?

rpstw commented 3 months ago

Thanks for the direction. Since Cassandra CQL is relative simple compared to Postgres, I'll try to make some demo and paste any further meaningful progress later.

ericraio commented 1 month ago

@rpstw any updates to a demo?