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

Mysql/MariaDB driver #33

Closed
jordic opened this issue Sep 6, 2016 · 4 comments
Closed

Mysql/MariaDB driver #33

jordic opened this issue Sep 6, 2016 · 4 comments

Comments

@jordic
Copy link

jordic commented Sep 6, 2016

What is needed to create the adapter?

@nullbio
Copy link
Member

nullbio commented Sep 6, 2016

Hi @jordic. A MySQL/MariaDB specific implementation of this interface is the starting point: https://github.com/vattle/sqlboiler/blob/master/bdb/interface.go#L8

The PSQL driver implementation is here for reference: https://github.com/vattle/sqlboiler/blob/master/bdb/drivers/postgres.go

For the compatibility tests, a main_test/mysql_main.tpl would be required as well. The postgres version is here: https://github.com/vattle/sqlboiler/blob/master/templates_test/main_test/postgres_main.tpl -- this code basically creates a test database, imports your schema into it, disables triggers (so there are no foreign key constraint complaints), runs the tests, then drops the test database. There may be a simpler way to disable foreign key constraints in MySQL, but in PSQL this was the best solution short of stripping them all from the schema dump using parsing.

Past this, there would be small changes required to the query builder (i.e. some conditionals to tell it not to convert ? to $1), and maybe some other small modifications here and there. Nothing major though, I do not imagine.

If you or someone else would like to work on this we're happy to give guidance wherever needed, but the interface implementation would be the best place to start (and the most difficult component -- the rest should be relatively straight forward).

@nullbio
Copy link
Member

nullbio commented Sep 8, 2016

@arden @jordic we've decided to start the implementation of MySQL support. We might even get to SQLite as well. If anyone has already started this and made any progress could you please let us know so we can merge?

As for other databases, I doubt we'll get to those any time soon, so anything else will remain up for grabs.

@nullbio
Copy link
Member

nullbio commented Sep 15, 2016

Hi @jordic -- we've released V2 which includes MySQL support. See here for release notes: https://github.com/vattle/sqlboiler/releases/tag/v2.0.0

Thanks.

@nullbio nullbio closed this as completed Sep 15, 2016
@jordic
Copy link
Author

jordic commented Sep 15, 2016

Hey! Thats cool!
I will give it a try as soon as I have time!

Great job, and great tool!

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

No branches or pull requests

2 participants