EntityFrameworkCore.Jet icon indicating copy to clipboard operation
EntityFrameworkCore.Jet copied to clipboard

EF Core 9 support

Open ChrisJollyAU opened this issue 1 year ago • 1 comments

Opening this issue for any questions on the EF Core 9 support.

Work has begun and the master branch is now targeting EF Core 9 (dependent on preview 7).

EF Core 9 does work on .Net 8 so you can update the EF Core part without changing the .Net version.

Currently it is only available on the daily build feed with myget, with hopefully an alpha 1 on nuget before the end of the month

ChrisJollyAU avatar Aug 17 '24 18:08 ChrisJollyAU

EFCore.Jet Alpha 1

Welcome to the first release of EFCore.Jet 9. This is targeting EF Core 9 preview 7 and will run on .Net 8+.

New Features

  • Updated to EF Core 9 #251
  • Create sequential GUID following the UUID Version 7 definition #254
  • Guids for the primary key are generated client-side now. There is only a way to get a numerical primary key last inserted value in Jet. Hence anything depending on that would never work as it couldn't query the last inserted Guid. #257
  • TimeOnly.FromDateTime and TimeOnly.FromTimeSpan is now translated #259
  • SearchConditionExpressionVisitor: From improvements made to the SQL Server version, add them to here. #255
    • <> TRUE becomes = FALSE
    • Use bitwise XOR (BXOR in Jet) for multiple optimizations with nullable boolean expressions
  • The sort order for Indexes is now added. Part of #256
    • We now generate SQL code to create the indexes with the respective sort order for each index column.
    • The Database Model is now set properly when reading the details of the database into the model

Bug fixes

  • Tests: Multiple fixes due to optimization improvements made by EF Core itself
  • Fix shared column validating when using view splitting #258
  • Improvements to the migrations sql #256
    • Updating a column has the following improvements
      • Don't generate an unnecessary ALTER TABLE
      • If the column is being made non-nullable (when originally null), create an UPDATE statement to set the value of that column to the default value for those where the current value is NULL
  • Null Semantics Tests: A test used the parent BoolTypeMapping and true was translated as 1. Jet uses -1 for true so override default behaviour to produce the sql literal of TRUE. Also adds some further tests to the overrides so we can test the sql #260
  • Use the lowest possible value of DateTime (1 Jan 100) when using a FirstOrDefault. A 0 in Jet/OLE Automation is not actually the lowest possible value
  • The type mapping for the translation of TimeOfDay was returning a DateTime and not TimeSpan
  • When reading a value for the TimeSpan and TimeOnly don't convert the default 0 to the c# 0 like we do for DateTime
  • A primary key with type of short can also be mapped to a counter type if it needs to be an auto incrementing key

ChrisJollyAU avatar Aug 30 '24 17:08 ChrisJollyAU

Hey @ChrisJollyAU - I just found this library and am hoping to use it with .NET 9 & EFCore 9. Do you have an ETA on when the official release will come out?

TonyValenti avatar Mar 12 '25 14:03 TonyValenti

@TonyValenti There is a beta version that is compatible with the RTM version of EFCore. It's probably mostly 95% of the way there.

I've got a couple of smaller issues that I've been wanting to fix before I do the stable version of my 9.0 series, but just haven't found time to finish it. https://github.com/CirrusRedOrg/EntityFrameworkCore.Jet/releases/tag/v9.0.0-beta.1

There shouldnt be anything significant between the beta 1 and final

ChrisJollyAU avatar Mar 12 '25 14:03 ChrisJollyAU

Awesome. Sounds great! I'll give the beta a whirl.

Thanks for maintaining this!

TonyValenti avatar Mar 12 '25 14:03 TonyValenti