-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add multi-database support to Statesman. #522
Merged
Merged
Conversation
This file contains 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
benk-gc
changed the title
First pass of multi-db support.
DRAFT: Add multi-database support to Statesman
Nov 23, 2023
benk-gc
force-pushed
the
benk--multiple-database-support
branch
3 times, most recently
from
November 28, 2023 12:05
6973746
to
ec92542
Compare
benk-gc
changed the title
DRAFT: Add multi-database support to Statesman
Add multi-database support to Statesman
Nov 28, 2023
benk-gc
changed the title
Add multi-database support to Statesman
Add multi-database support to Statesman.
Nov 28, 2023
orlylevk
reviewed
Nov 29, 2023
orlylevk
approved these changes
Nov 29, 2023
orlylevk
reviewed
Nov 29, 2023
ankithads
approved these changes
Nov 29, 2023
danielmamay
approved these changes
Nov 29, 2023
benk-gc
force-pushed
the
benk--multiple-database-support
branch
from
November 30, 2023 11:47
ec92542
to
e6a1c89
Compare
Statesman currently relies heavily on ActiveRecord::Base, either explicitly or implicitly, when querying database connections. This doesn't play well when we have models or transitions which live on a different database, since it forces us to open a query to the primary connection pool. This is a series of changes to allow Statesman to use the context it has available for the model or transition class, and make use of the appropriate connection. Co-authored-by: Amey Kusurkar <amey1000@gmail.com>
benk-gc
force-pushed
the
benk--multiple-database-support
branch
from
November 30, 2023 12:00
e6a1c89
to
404095a
Compare
This was referenced Nov 30, 2023
Merged
jurre
added a commit
to jurre/statesman
that referenced
this pull request
Dec 21, 2023
In gocardless#522 the ability to enable gaplock protection manually was removed, likely assuming there was no need for this since it's enabled by default when using an adapter that is named `mysql*`, however we use https://github.com/trilogy-libraries/trilogy which has been gaining some traction in the community and this change now leaves us without a way to enable the functionality. I think it makes most sense to enable the functionality by default when using this new adapter as well, and keep config requirements minimal, so I added a little check for that adapter name as well.
This was referenced Jan 5, 2024
dylan-hoefsloot
pushed a commit
to dylan-hoefsloot/statesman
that referenced
this pull request
Jan 11, 2024
Statesman currently relies heavily on ActiveRecord::Base, either explicitly or implicitly, when querying database connections. This doesn't play well when we have models or transitions which live on a different database, since it forces us to open a query to the primary connection pool. This is a series of changes to allow Statesman to use the context it has available for the model or transition class, and make use of the appropriate connection. Co-authored-by: Amey Kusurkar <amey1000@gmail.com>
dylan-hoefsloot
pushed a commit
to dylan-hoefsloot/statesman
that referenced
this pull request
Jan 11, 2024
In gocardless#522 the ability to enable gaplock protection manually was removed, likely assuming there was no need for this since it's enabled by default when using an adapter that is named `mysql*`, however we use https://github.com/trilogy-libraries/trilogy which has been gaining some traction in the community and this change now leaves us without a way to enable the functionality. I think it makes most sense to enable the functionality by default when using this new adapter as well, and keep config requirements minimal, so I added a little check for that adapter name as well.
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.
Statesman currently relies heavily on
ActiveRecord::Base
, either explicitly or implicitly, when querying database connections. This doesn't play well when we have models or transitions which live on a different database, since it forces us to open a query to the primary connection pool.This is a series of changes to allow Statesman to use the context it has available for the model or transition class, and make use of the appropriate connection.