deta
deta copied to clipboard
Support for MySQL
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.
Sorry, above comment should have been from gknauth (personal), not work persona.
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
andmake-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!
That does help, thanks!