- Notifications
You must be signed in to change notification settings - Fork691
Feature/custom db provider factory#2002
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
Merlin-Taylor wants to merge6 commits intofluentmigrator:mainChoose a base branch fromMerlin-Taylor:feature/custom-DbProviderFactory
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Open
Feature/custom db provider factory#2002
Merlin-Taylor wants to merge6 commits intofluentmigrator:mainfromMerlin-Taylor:feature/custom-DbProviderFactory
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
Collaborator
jzabroski commentedMar 7, 2025
build failed |
0dc3604 to6d26b78Compareso that alternative implementations can be registered with the DI container.
This commit is a pure refactoring.- Move ReflectionBasedDbFactory to file of the same name.- Rename interface PostgresDbFactor to IPostgresDbFactory.
via an additional optional argument to the`PostgresRunnerBuilderExtensions.AddPostgres*` methods.
This example shows how to use Npgsql dynamic passwords by supplying a customDbProviderFactory.
6d26b78 toccac274CompareCollaborator
jzabroski commentedMar 11, 2025
Build passing. Will try to review some of this later today. Have not had time yet. |
Uh oh!
There was an error while loading.Please reload this page.
# Conflicts:#FluentMigrator.sln#src/FluentMigrator.Runner.Postgres/PostgresRunnerBuilderExtensions.cs#src/FluentMigrator.Runner.Postgres/Processors/Postgres/ReflectionPostgresDbFactory.cs#test/FluentMigrator.Tests/Unit/Generators/Postgres/PostgresDependencyInjectionTests.cs
Sign up for freeto 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.
This change allows you to supply a customDbProviderFactory instance when configuring your DI container in your application's composition root.
This change is motivated by#1981 so new sample application is probably the best place to start a review. Note that this implementation delegates the dynamic password feature to the underlying database library (
Npgsqlin this case).I have attempted to keep this change minimal:
AddPostgres*methods ofFluentMigrator.Runner.Postgres/PostgresRunnerBuilderExtensions.DbProviderFactoryprimarily because it is the type returned byDBFactoryBase.Factoryand therefore minimizes the changes needed to consumers.On point 3 above, I think this is a reasonable decision internally, but it is probably the wrong type to expose in the public interface of the library, which is why this PR is in draft status. I rather like the suggestion of a new interface made by@jzabroskihere.