Add multi-database support#2
Closed
antarr wants to merge 24 commits into
Closed
Conversation
- Add ConnectionPool module for managing per-database connections with named AR base classes (Rails 5.2 compat) - Lazy-build DatabaseRegistry on first access instead of boot-time to survive Rails development-mode class reloading - Fall back to database key name when connection_spec is nil - Fix unused indexes SQL error (reads/writes are reserved in MySQL 8.0+)
Owner
Author
|
Closing — superseded by Phase 2c desktop profile switching. The Rails adapter uses the host app's ActiveRecord connection and doesn't need its own multi-database management. |
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.
Summary
database.yml(supports Rails 5.2-8.1)config/mysql_genius.ymlwith environment-specific overrides/mysql_genius/analytics/,/mysql_genius/primary/execute, etc.config.database(:name)Ruby DSL for per-database overrides in the initializerPer-database configurable settings
blocked_tables,masked_column_patterns,featured_tables,default_columns,max_row_limit,default_row_limit,query_timeout_msArchitecture
resolve_database!before_action,connectionhelper replacing 25+ hardcodedActiveRecord::Base.connectioncallsconnection:keyword so queries run against the correct databaseNew files
lib/mysql_genius/database_config.rblib/mysql_genius/database_registry.rbspec/mysql_genius/database_config_spec.rbspec/mysql_genius/database_registry_spec.rbTest plan
/mysql_genius/,/mysql_genius/primary/,/mysql_genius/analytics/