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

Support for MySQL #39

Open
accu-knauthg opened this issue Jan 29, 2021 · 3 comments
Open

Support for MySQL #39

accu-knauthg opened this issue Jan 29, 2021 · 3 comments

Comments

@accu-knauthg
Copy link

deta-lib looks great. Only downside is I have some databases that are MySQL. I could convert them to PostgreSQL, or I could help add MySQL support to deta-lib, if that isn't already part of your plan. If I were to do so, any pointers? I've looked over the source code, so I have a rough idea of how I'd proceed, but if you have any pointers, I'm all ears.

@gknauth
Copy link

gknauth commented Jan 29, 2021

Sorry, above comment should have been from gknauth (personal), not work persona.

@Bogdanp
Copy link
Owner

Bogdanp commented Jan 29, 2021

I don't personally use MySQL so any help adding it would be appreciated! As for pointers:

  • I'd start by adding a dialect that, like the other two, uses the "standard" dialect and interjects where the MySQL syntax differs. The "standard" dialect's make-expr-emitter and make-stmt-emitter both take trampolines as arguments so that when they recur, they call the trampolines instead of themselves and the trampolines then get to decide whether or not to interject and emit special syntax where the derived dialect might differ.
  • Probably, most of the types we support out of the box will work the same for MySQL as they do for Postgres so you'll have to go through types.rkt and change any places where we match on 'postgres to (or 'postgres 'mysql) or add new branches where MySQL expects a different {ser,de}serialization format.
  • I'd at least update the query suite to run against MySQL here. For CI, you can add a MySQL service like we have for PostgreSQL here. Don't forget to set the env vars here.
  • I'd add a column for MySQL to the support matrix in the documentation.

I hope that helps!

@gknauth
Copy link

gknauth commented Jan 30, 2021

That does help, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants