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
feat: Migrate ConnectionManager
to TypeScript
#14652
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
Good work on this already! Let's indeed move the MySQL schema bug to another PR |
Moved to #14657 |
WikiRik
reviewed
Jun 19, 2022
WikiRik
approved these changes
Jun 19, 2022
@ephys I'll leave the merging up to you |
🎉 This PR is included in version 7.0.0-alpha.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
6 tasks
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.
Pull Request Checklist
yarn test
oryarn test-DIALECT
pass with this change (including linting)?Description Of Change
This PR migrates the
AbstractConnectionManager
to TypeScript. As usual it isn't just a type addition but a small refactor to work better with TypeScript.Notable Change 1: Pool Normalization
A first notable change is the unification of how the connection pool works with and without replication.
Before this PR, if read replication was disabled,
connectionManager.pool
was an instance ofsequelize-pool
. If read replication was enabled,connectionManager.pool
was an object that mimickedsequelize-pool
and used two pools internally (one for read, one for write).After this PR,
connectionManager.pool
is always an instance ofReplicationPool
(new class) which dispatches to its internalread
andwrite
pools. If read replication is disabled, theread
pool is disabled and thewrite
pool is used for reads too.This change makes the type much easier to work with.
Notable Change 2: Sequelize option priority
Which parameter takes priority in the Sequelize constructor is inconsistent:
After this PR, both versions prioritize the option bag over the string parameters. Both result in
user2
being used.Notable Change 3: Fixing another MySQL schema bug
Moved to #14657. The code is still in this PR but that other PR should be merged first.
Closes #13660
Squash Commit Message Body
If this is merged by someone else than me, here is the message body to use for the squash commit (don't forget the empty line at the start of the body, per conventional commits conventions):