Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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:main
base:main
Choose a base branch
Loading
fromMerlin-Taylor:feature/custom-DbProviderFactory

Conversation

@Merlin-Taylor
Copy link

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 (Npgsql in this case).

I have attempted to keep this change minimal:

  1. The changes only apply to PostgreSQL.
  2. The only public interface change is the additional of an optional argument to theAddPostgres* methods ofFluentMigrator.Runner.Postgres/PostgresRunnerBuilderExtensions.
  3. I have usedDbProviderFactory primarily because it is the type returned byDBFactoryBase.Factory and 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.

@jzabroski
Copy link
Collaborator

build failed

@Merlin-TaylorMerlin-Taylorforce-pushed thefeature/custom-DbProviderFactory branch from0dc3604 to6d26b78CompareMarch 10, 2025 14:34
so 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.
@Merlin-TaylorMerlin-Taylorforce-pushed thefeature/custom-DbProviderFactory branch from6d26b78 toccac274CompareMarch 11, 2025 08:46
@jzabroski
Copy link
Collaborator

Build passing. Will try to review some of this later today. Have not had time yet.

Merlin-Taylor reacted with thumbs up emoji

@jzabroskijzabroski marked this pull request as ready for reviewAugust 17, 2025 15:47
# 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
@github-actions
Copy link

Test Results

    2 files  ±0      2 suites  ±0   40s ⏱️ +4s
5 396 tests ±0  5 064 ✅ ±0  332 💤 ±0  0 ❌ ±0 
5 877 runs  ±0  5 281 ✅ ±0  596 💤 ±0  0 ❌ ±0 

Results for commit93cb15d. ± Comparison against base commit188a43f.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jzabroskijzabroskijzabroski left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Merlin-Taylor@jzabroski@PhenX

[8]ページ先頭

©2009-2025 Movatter.jp