Add multi-connection support for multiple databases#465
Merged
dereuromark merged 2 commits intomasterfrom Mar 18, 2026
Merged
Conversation
Add support for running queue workers and admin interface across multiple database connections (e.g., primary and secondary databases). Features: - Configure connections via Queue.connections array in config - Connection switcher dropdown in admin navigation - --connection option for queue run and queue job commands - Whitelist validation for security - Backwards compatible - only activates with 2+ connections Configuration example: $config['Queue']['connections'] = ['default', 'acme']; The first connection in the array is used as the default. Workers must be run separately for each connection to process its jobs.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #465 +/- ##
============================================
- Coverage 77.32% 76.73% -0.59%
- Complexity 888 926 +38
============================================
Files 45 45
Lines 3069 3151 +82
============================================
+ Hits 2373 2418 +45
- Misses 696 733 +37 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Use session to persist connection choice across requests - Query param ?connection=xxx sets session value - Connection switcher redirects to dashboard to avoid 404s - Fix CS issue with RuntimeException import
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
Add support for running queue workers and admin interface across multiple database connections (e.g., primary and secondary databases).
Features:
Queue.connectionsarray in config--connectionoption forqueue runandqueue jobcommandsConfiguration example:
The first connection in the array is used as the default. Workers must be run separately for each connection to process its jobs:
Documentation: Added comprehensive documentation in
docs/sections/multi_connection.mdcovering:Use case: Applications with multi-tenant architectures or separate databases for different parts of the system.