-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Adding support for a new database #48
Comments
Hi @k0kubun I would need some help with this. The code which i am uncomfortable changing is the one taken from vitess. It will be great to know your thoughts on this. |
Hi @chhetripradeep I don't know clickhouse at all.
I'm not a committer, so I'm sorry if I made a mistake. |
Thanks @yudppp for your help! As he suggested, if ClickHouse is compatible with either MySQL or PostgreSQL, please just use In case it's not compatible MySQL or PostgreSQL so much, the amount of effort much depends on how ClickHouse is different from these supported databases for each of sqldef implementation layers. While I'm not familiar with ClickHouse and it's hard to exactly estimate it for me, let me roughly explain how it's difficult and what you need to expect for each layer. CLIThe easiest part. If Then, the file you need to put would be Database adapterDo you know Go database driver for ClickHouse? See SQL parser
So I guess you're worried mostly about this? If its DDL syntax is compatible with either of MySQL / PostgreSQL, we just need to use However, if it's so much different from both of them, then... welcome to the SQL parser maintenance world! The current implementation is completely forked from vitess, so you don't need to care about compatibility with vitess (but please care MySQL and PostgreSQL). If you're new to yacc, you need to learn how to write a parser using yacc first. Then you'd be able to easily understand TestingIs ClickHouse something we can easily run on Travis for third-party projects? This part is about |
Hi @k0kubun @yudppp Thank you for your detailed response. There are some sql syntax which is new in clickhouse but I think that won't be involved as part of schema migration. I am also new to clickhouse too but i will try to make a PR as per your suggestions and try to compare with the migration which we have written manually and see if sqldef also generates identical migrations. Thanks a lot once again for your inputs. |
Hi @k0kubun @yudppp Thank you for your help earlier. I have a question: ClickHouse sql syntax overlaps with MySQL/PostgreSQL but there are lot of differences, one such example is the data types (clickhouse uses Uint for unsigned int but mysql uses UNSIGNED keyword). I was able to write the clickhouse adaptor and cmd part but now i am stuck because neither of
I would need your suggestion here to know how to proceed further. Thank you. |
There are roughly two approaches to implement a new DDL syntax:
and
This part can be approached with 1 if differences are not significant, because MySQL and PostgreSQL have difference in data types too and we need to maintain data type switching by Could you summarize (1) how many data types you want to add for the initial support and (2) any other differences other than data type names? |
Hi @k0kubun Thank you for your detailed response on the possible paths.
These are the ones i can see right now. As we dig deeper into the clickhouse syntax, I am pretty sure this list will grow. |
Thank you! Because we have 2 and 3, I think we have some uncertainty at this moment. So let me propose the following development strategy:
I already prepared the environment to start the point 1 at https://github.com/sqldef/clickhousedef. You're invited to the organization, and Travis is already enabled so that we can run integration test with clickhousedef there. |
Hi @k0kubun thank you for your valuable feedback. I will take the path you suggested. I'll let you know once i come up with something. |
As we moved the repository to clickhousedef, let's discuss things there and let me close this issue in this repository. |
Hi Takashi,
Thank you for this awesome project. I was interested to know how difficult is it to add support for a completely new database. I was looking for clickhouse (https://github.com/ClickHouse/ClickHouse) support. I would like to know what all components need to be updated for adding a new database support.
The text was updated successfully, but these errors were encountered: