dotnet / SqlClient

Microsoft.Data.SqlClient provides database connectivity to SQL Server for .NET applications.
MIT License
839 stars 280 forks source link

Update to .Net 9 #2669

Open saurabh500 opened 2 months ago

saurabh500 commented 2 months ago

The SqlClient build system needs to be updated to dotnet 9 to be able to run the CI and test SqlDbType.Json added in dotnet 9.

cheenamalhotra commented 2 months ago

Is this planned to build with .NET 9 before or after Nov (.NET 9 release date)?

saurabh500 commented 2 months ago

@cheenamalhotra the short answer is that we need to be ready before the release of .Net 9

For EF to be able to support JSON for Sql Server, we need to make sure that SqlClient releases with .Net 9, this is because EF aligns their release with .Net releases. Hence EF next release is with .Net 9 release. For them to release JSON support, they need SqlClient with .Net 9 release. SqlClient needs SqlDbType with .Net 9 release.

Walk back plan: @roji informed me that Preview 7 is planned for August 13th. This means that we should start work before August 13th to be able to build and run SqlClient tests on .Net 9's current builds. This way we front load any CI work to build with .Net 9 preview builds.

On August 13th, we adopt the Preview 7, with our desired changes, and take a dependency on SqlDbType.Json This produces Nuget packages of SqlClient targeting .Net 9.

This allows EF to be able to work with SqlClient very soon after Aug 13th release.

Let me know if this clarifies. Also is there anything to be aware of and watch out for, in this activity ? I am cognizant of potential bugs that may be found due to this activity. But apart from that we will need to work out the internals of our CI.

cheenamalhotra commented 2 months ago

Potential bugs are always likely to occur with every framework upgrade, so we would ensure full testing is in place.

But challenging part is, we haven't released a stable library targeting a preview framework before and that may be challenging just because a stable production release needs to target stable frameworks by principle.

So if this requirement applies to a preview release, we should be able to make it work and preview versions of EF Core can consume preview versions of MDS (if they would do).. But for a GA release, EF would need to wait for a GA release of MDS and update the dependency right before releasing EF Core GA release after .NET 9 is released.

cheenamalhotra commented 2 months ago

Also ideally, as a practice we should prepare our driver to be forward looking and with every .NET GA release, aim to release MDS GA release that targets the newly released .NET version, so other consumer app/library gets latest driver compiled and tested for latest .NET releases along the same .NET GA timeline.

saurabh500 commented 2 months ago

At this point a preview release of the driver is not a hard requirement. But I imagine providing a need to provide a preview release to EF so that they can run their CI on this change. There are some other server related complexities that we need to solve. We can take the discussion over Teams for things related to the server.

I agree with your comment about keeping up to date with the .Net releases. I think we need to figure out our support policies.