Skip to content
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

Added support for Npgsql data source #112

Merged
merged 14 commits into from
Dec 8, 2023
Merged

Conversation

oskardudycz
Copy link
Contributor

@oskardudycz oskardudycz commented Dec 5, 2023

  • Decoupled command builders and database providers from strong typing around connection and transaction. By that, those classes are more focused on handling the specifics of the database instead of mixing command setup with execution,
  • I placed the execution code in the command builders extension methods. Added extensions for each of the database providers to keep the strongly typed API so no one accidentally won't inject wrong connection or transaction type,
  • applied changes to migratory and database,
  • kept the option of still setting up NpgsqlConnection without the NpgsqlDataSource to ease the migration.

See also npgsql/npgsql#5485.

Changed order of the extension methods parameters to extend connection, instead of builder. That should allow next extensions for data source. It'll be more clear to see responsibilities.
}

migration.AssertPatchingIsValid(autoCreate);

logger ??= new DefaultMigrationLogger();
await executeDelta(migration, conn, autoCreate, logger, ct).ConfigureAwait(false);
return executeDelta(migration, conn, autoCreate, logger, ct);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this synchronous now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not synchronous, I just removed async from the method definition and removed redundant await (see. also above replacement of return; with Task.CompletedTask.

Copy link
Member

@jeremydmiller jeremydmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go, go, go!

…qlDataSource all ahead, so applied that Postgres Database management
@oskardudycz oskardudycz marked this pull request as ready for review December 8, 2023 09:44
@oskardudycz oskardudycz merged commit d8dd57f into master Dec 8, 2023
@oskardudycz oskardudycz deleted the npgsql_data_source branch December 8, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants