-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Make Trilogy the default MySQL adapter #50110
Conversation
Trilogy has been production tested on very large Rails applications in the wild, is much easier to install than `mysql2` as it doesn't depend on `libmysqlclient`, and generally is better maintained and performs better. Addtionally it has always bothered me that you need to pass a `mysql2://` or `trilogy://` `DATABASE_URL` as it's a leaky abstraction, the `DATABASE_URL` should specify the protocol, not the client used. `rails new --database=mysql` will now generate an application using Trilogy. `DATABASE_URL=mysql://host` will now use the trilogy adapter. This has no impact on existing applications.
It does not seem to work with MySQL 8.0 (official docker container):
MySQL version (
Possibly related to |
Closing in favor of #50112 |
Right, that should be considered a blocker for making it the default. I think we'll probably have support for it in time for Rails 7.2 though. |
@casperisfine is that the same issue described at brianmario/mysql2#1286 ? Edit: I read a bit more and see that it's a separate issue. Ignore. |
Maybe m, I'll have to dig into it. I'd assume mysql2 would have support for it since it binds libmysqlclient. But it's unclear if the people running to this have libmysqlclient 5 or 8. And also perhaps there is something mysql2 need to do to enable that support? |
I'm not fully sure of the root issue, but the important behaviour difference here, on Ubutnu 22.04 with a default install of MySQL:
Trilogy fails to support default authentication out of the box. |
Trilogy has been production tested on very large Rails applications in the wild, is much easier to install than
mysql2
as it doesn't depend onlibmysqlclient
, and generally is better maintained and performs better.Addtionally it has always bothered me that you need to pass a
mysql2://
ortrilogy://
DATABASE_URL
as it's a leaky abstraction, theDATABASE_URL
should specify the protocol, not the client used.rails new --database=mysql
will now generate an application using Trilogy.DATABASE_URL=mysql://host
will now use the trilogy adapter.This has no impact on existing applications.
FYI: @kmcphillips @adrianna-chang-shopify