Add trilogy adapter support and make mysql2 optional - #751
Merged
Conversation
mysql2 requires native MySQL libraries which not all developers have installed. Gate mysql2 behind BUNDLE_INSTALL_MYSQL=1 in the main Gemfile. Appraisal gemfiles keep mysql2 hardcoded for CI. Add trilogy adapter support throughout: - Add "trilogy" to all mysql adapter name checks in format modules - Add trilogy to database.yml configs (example and CI) - Add trilogy test step to CI (runs on the mysql matrix entry) - Add trilogy to gemfile_72 for CI - Normalize DB=trilogy in test environment Co-Authored-By: Daniel Berger <78529+djberg96@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kbrock
added a commit
to kbrock/ancestry
that referenced
this pull request
Mar 31, 2026
Add trilogy adapter support and make mysql2 optional
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
mysql2 gem requires native MySQL client libraries which not all developers have installed, making
bundle installfail. Gate mysql2 behindBUNDLE_INSTALL_MYSQL=1in the main Gemfile so developers without MySQL can still contribute.Also adds trilogy adapter support — trilogy is the modern MySQL driver (no mysql client deps) used by Rails 7.1+ by default.
Inspired by #749 (thx @djberg96).
Before
bundle installfails without MySQL client libraries installed.Trilogy adapter not supported.
After
bundle installworks without MySQL. SetBUNDLE_INSTALL_MYSQL=1to include mysql2.Trilogy adapter works with
DB=trilogy.CI runs both mysql2 and trilogy on the mysql matrix entry.
Type of Change
Checklist
bundle exec rake test)How Has This Been Tested?
bundle exec rake test— sqlite default (250 runs, 0 failures)bundle installworks without BUNDLE_INSTALL_MYSQL