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

Update Pomelo MySQL to v9 Preview #6948

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bgrainger
Copy link
Contributor

@bgrainger bgrainger commented Dec 15, 2024

Description

This removes use of the legacy global 'MySqlConnectorLogManager.Provider' and uses Microsoft.Extensions.Logging (via MySqlDataSource).

Needed to add VersionOverride for multiple packages due to Microsoft.EntityFrameworkCore.Relational v9.0.0.

Needs MySqlConnector.* 2.4.0 and Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.2.efcore.9.0.0 to be added to approved packages list.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected; needs to update to RTM version of Pomelo.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No; no changes to existing package functionality.
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
Microsoft Reviewers: Open in CodeFlow

This removes use of the legacy global 'MySqlConnectorLogManager.Provider' and uses Microsoft.Extensions.Logging (via MySqlDataSource).

Needed to add VersionOverride for multiple packages due to Microsoft.EntityFrameworkCore.Relational v9.0.0.
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 15, 2024
@sebastienros
Copy link
Member

I see two problems so far, but someone should confirm.
This is a preview dependency, the Aspire package is stable and can't reference/ship with a preview.

This version targets net8.0 only and it lifts EF core 9.0 only. Meaning an application targeting net8.0 will take a dependency on STS packages. See what npgsql did between 9.0.0 and 9.0.1 to fix that by introducing two TFMs in the package to point to efcore 8.0 and efcore 9.0 based on the targets.

@bgrainger bgrainger marked this pull request as draft December 16, 2024 17:15
@bgrainger
Copy link
Contributor Author

This is a preview dependency, the Aspire package is stable and can't reference/ship with a preview.

I noted this in the PR checklist, but should have made this a "Draft" PR to be explicit: I don't expect this to be merged until Pomelo goes RTM.

This version targets net8.0 only and it lifts EF core 9.0 only. Meaning an application targeting net8.0 will take a dependency on STS packages. See what npgsql did between 9.0.0 and 9.0.1 to fix that by introducing two TFMs in the package to point to efcore 8.0 and efcore 9.0 based on the targets.

I'm not following yet (perhaps because I'm less familiar with EFCore than ADO.NET). It looks like Npgsql.EntityFrameworkCore.PostgreSQL 9.0.x depends only on EFCore 9; it doesn't have multiple TFMs? https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL/9.0.1#dependencies-body-tab

@bgrainger
Copy link
Contributor Author

Oh, you're talking about here?

<NpgsqlEntityFrameworkCorePostgreSQLPackageVersion>8.0.11</NpgsqlEntityFrameworkCorePostgreSQLPackageVersion>

<NpgsqlEntityFrameworkCorePostgreSQLPackageVersion>9.0.0</NpgsqlEntityFrameworkCorePostgreSQLPackageVersion>

@sebastienros
Copy link
Member

Right. Check this PR for instance after such a change in the library was done.

@sebastienros
Copy link
Member

another option is to have a version for each TFM, and keep all the things net8.0 and net9.0 separate. This is what is bound to happen with npgsql for now since there is an issue when using npgsql:9.0 targeting EF 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants