Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6f9f035
Initial ef9 update. Mostly just getting the files to compile with all…
ChrisJollyAU Jul 19, 2024
c4a6e10
update tests
ChrisJollyAU Jul 20, 2024
2ae9880
more test updates
ChrisJollyAU Jul 20, 2024
0208bae
update green test files as some test classes were removed
ChrisJollyAU Jul 20, 2024
82e8aed
make sure all tests that should be overridden are
ChrisJollyAU Jul 20, 2024
ac6f12a
Fix IndexOf
ChrisJollyAU Jul 20, 2024
b50ea6e
More fixes
ChrisJollyAU Jul 20, 2024
7c7b9d5
Remove JsonTypes from green tests. Need to regenerate for that class.…
ChrisJollyAU Jul 20, 2024
c2e3e39
More fixes
ChrisJollyAU Jul 21, 2024
bc232bd
Use lowest datetime value possible when doing a firstordefault. Defau…
ChrisJollyAU Jul 23, 2024
532242d
More test fixes
ChrisJollyAU Jul 23, 2024
66b6579
Set operations within an IN mustnt be simplified and must be encased …
ChrisJollyAU Jul 24, 2024
5f277a0
Fix string literals in SQL
ChrisJollyAU Jul 24, 2024
d9c03fe
Trhow Jet specific errors on more unsupported SQL. Allows us to bulk …
ChrisJollyAU Jul 24, 2024
97f8f9f
Don't try to bulk skip any unsupported cross join. Current test skips…
ChrisJollyAU Jul 24, 2024
a4cf960
Some of these cases do work
ChrisJollyAU Jul 25, 2024
d170e0b
Upgrade EFCore to a daily build. Currently just after preview 7
ChrisJollyAU Jul 25, 2024
4045151
More test fixes
ChrisJollyAU Jul 25, 2024
65b0bf9
Fix tests for Nullable ToString efcore #34014 and #33940
ChrisJollyAU Jul 26, 2024
007d408
update tests
ChrisJollyAU Jul 26, 2024
affd123
small fixes
ChrisJollyAU Jul 26, 2024
84fc7b7
Add further tests that were missing
ChrisJollyAU Jul 29, 2024
cfc77af
fix tests
ChrisJollyAU Jul 30, 2024
5b5d5e3
Fix type mapping for Time of Day methods which needs to be TimeSpan
ChrisJollyAU Aug 10, 2024
fb40077
Fix the precompiled query tests
ChrisJollyAU Aug 10, 2024
db6b0db
For returning TimeSpan and TimeOnly we don't want to convert the Jet …
ChrisJollyAU Aug 10, 2024
8d1ad62
- Allow a short to be mapped to the identity counter
ChrisJollyAU Aug 10, 2024
ce80c2a
Fix some more tests
ChrisJollyAU Aug 10, 2024
55cf5d5
Remove tests from green list
ChrisJollyAU Aug 10, 2024
4992a18
update to .net 9 preview 7
ChrisJollyAU Aug 15, 2024
802904e
Add a SharedTableConvention to set IndexesUniqueAcrossTables = false
ChrisJollyAU Aug 15, 2024
9a0b049
Update the expected data for Mission.Duration as since it is based on…
ChrisJollyAU Aug 15, 2024
deaeb42
Add Migration Lock feature in
ChrisJollyAU Aug 17, 2024
49a7eda
Fix tests: Have to specify minimum DateTime rather than the default w…
ChrisJollyAU Aug 17, 2024
66506e8
GreenTests: MigrationsInfrastructure got moved to different folder/na…
ChrisJollyAU Aug 17, 2024
d03042a
Fix ODBC parameter naming in SQL output
ChrisJollyAU Aug 17, 2024
b3d4e2e
missed some tests for ODBC fix
ChrisJollyAU Aug 17, 2024
5083b0f
remove not applicable test
ChrisJollyAU Aug 17, 2024
91694dc
[GitHub Actions] Update green tests.
invalid-email-address Aug 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 23 additions & 25 deletions Dependencies.targets
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
<Project>
<PropertyGroup>
<EFCoreVersion>[8.0.6,8.0.999]</EFCoreVersion>
<DotNetVersion>[9.0.0-preview.7.24405.4,9.0.999]</DotNetVersion>
<EFCoreVersion>[9.0.0-preview.7.24405.3,9.0.999]</EFCoreVersion>
<MSLibVersion>[9.0.0-preview.7.24405.7,9.0.999]</MSLibVersion>
</PropertyGroup>

<ItemGroup>
<!-- Common -->
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MSLibVersion)" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="$(MSLibVersion)" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="$(MSLibVersion)" />
<PackageReference Update="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />

<!-- EFCore.Jet -->
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Update="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="$(MSLibVersion)" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="$(MSLibVersion)" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="$(MSLibVersion)" />
<PackageReference Update="System.Collections.Immutable" Version="$(MSLibVersion)" />

<!-- Tests -->
<PackageReference Update="System.Data.Odbc" Version="8.0.0" />
<PackageReference Update="System.Data.OleDb" Version="8.0.0" />
<PackageReference Update="System.Data.Odbc" Version="$(MSLibVersion)" />
<PackageReference Update="System.Data.OleDb" Version="$(MSLibVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Design" Version="$(EFCoreVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="$(EFCoreVersion)" />
<PackageReference Update="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Update="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Update="MSTest.TestFramework" Version="3.4.3" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="$(EFCoreVersion)" /> <!-- Should be same as efcoreversion. preview6 was broken and published separately -->
<PackageReference Update="Microsoft.Extensions.Logging.Console" Version="$(MSLibVersion)" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.11.0-release-24373-02" />
<PackageReference Update="MSTest.TestAdapter" Version="3.5.2" />
<PackageReference Update="MSTest.TestFramework" Version="3.5.2" />
<PackageReference Update="coverlet.collector" Version="6.0.2" />
<PackageReference Update="Newtonsoft.Json" Version="13.0.3" />

<!-- EFCore.Jet.FunctionalTests -->
<PackageReference Update="xunit.core" Version="2.4.2" />
<PackageReference Update="xunit.assert" Version="2.4.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Update="xunit.runner.console" Version="2.4.2" />
<PackageReference Update="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Update="xunit.core" Version="2.9.0"/>
<PackageReference Update="xunit.assert" Version="2.9.0" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.8.2" />
<PackageReference Update="xunit.runner.console" Version="2.9.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.FileExtensions" Version="$(MSLibVersion)" />
<PackageReference Update="NetTopologySuite" Version="2.5.0" />
<PackageReference Update="System.ComponentModel.TypeConverter" Version="4.3.0" />
<PackageReference Update="Castle.Core" Version="5.1.1" />

<!-- EFCore.Jet.Tests -->
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="$(MSLibVersion)" />
<PackageReference Update="Moq" Version="4.20.70" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<Company>CirrusRed</Company>
<Copyright>Copyright © 2017-$([System.DateTime]::Now.Year) CirrusRed</Copyright>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<LangVersion>latest</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<DebugType>portable</DebugType>
<IsPackable>False</IsPackable>
<!-- <PackageReleaseNotes>TODO</PackageReleaseNotes> -->
Expand All @@ -26,7 +27,7 @@
<EfCoreTargetFramework>net8.0</EfCoreTargetFramework>
<EfCoreTestTargetFramework>$(EfCoreTargetFramework)</EfCoreTestTargetFramework>
<JetTargetFramework>$(EfCoreTargetFramework)</JetTargetFramework>
<JetTestTargetFramework>$(JetTargetFramework)</JetTestTargetFramework>
<JetTestTargetFramework>net9.0</JetTestTargetFramework>
<JetTestWindowsOnlyTargetFramework>$(JetTestTargetFramework)-windows7.0</JetTestWindowsOnlyTargetFramework>
</PropertyGroup>

Expand Down
3 changes: 1 addition & 2 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />

<add key="efcorejet-daily" value="https://www.myget.org/F/cirrusred/api/v3/index.json" />
<add key="efcorejet-daily-debug" value="https://www.myget.org/F/cirrusred-debug/api/v3/index.json" />
Expand Down
6 changes: 3 additions & 3 deletions Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
Bump-up to the next iteration immediately after a release, so that subsequent daily builds are named
correctly.
-->
<VersionPrefix>8.0.0</VersionPrefix>
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
<PreReleaseVersionIteration>0</PreReleaseVersionIteration>
<VersionPrefix>9.0.0</VersionPrefix>
<PreReleaseVersionLabel>alpha</PreReleaseVersionLabel>
<PreReleaseVersionIteration>1</PreReleaseVersionIteration>

<!--
The following properties will automatically be set by CI builds when appropriate:
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.203",
"version": "9.0.100-preview.7.24407.12",
"allowPrerelease": true,
"rollForward": "latestFeature"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- [CS1591] Missing XML comment for publicly visible type or member 'MySqlAnnotationCodeGenerator' -->
<!-- [CS1587] XML comment is not placed on a valid language element -->
<!-- [CS1574] XML comment has cref attribute 'Scoped' that could not be resolved -->
<NoWarn>$(NoWarn);CS1574;CS1587;CS1591;EF1001</NoWarn>
<NoWarn>$(NoWarn);CS1574;CS1587;CS1591;EF1001;NU1903</NoWarn>
<!--<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\rulesets\EFCore.ruleset</CodeAnalysisRuleSet>-->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
Expand Down
17 changes: 9 additions & 8 deletions src/EFCore.Jet.Data/JetConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public DbProviderFactory DataAccessProviderFactory
get => JetFactory?.InnerFactory;
set
{
if (JetFactory != null && JetFactory != value)
throw new InvalidOperationException($"The {DataAccessProviderFactory} property can only be set once.");
if (State != ConnectionState.Closed)
throw new InvalidOperationException($"The {DataAccessProviderFactory} property can only be set when the connection is closed.");

JetFactory = new JetFactory(this, value);
}
Expand Down Expand Up @@ -329,12 +329,12 @@ public override void Open()
{
// If the connection string is an actual connection string and not just a file path, then we should
// be able to deduct the provider from its style.
dataAccessProviderType ??= GetDataAccessProviderType(fileNameOrConnectionString);
dataAccessProviderType = GetDataAccessProviderType(fileNameOrConnectionString);
connectionString = fileNameOrConnectionString;
}
else
{
dataAccessProviderType ??= JetConfiguration.DefaultDataAccessProviderType;
dataAccessProviderType = JetConfiguration.DefaultDataAccessProviderType;

if (IsFileName(fileNameOrConnectionString))
{
Expand All @@ -352,7 +352,7 @@ public override void Open()
}
}

DataAccessProviderFactory ??= JetFactory.Instance.GetDataAccessProviderFactory(dataAccessProviderType.Value);
DataAccessProviderFactory = JetFactory.Instance.GetDataAccessProviderFactory(dataAccessProviderType.Value);

// It is possible, that a connection string was provided, that left out the actual ACE/Jet provider
// information, but is in a distinctive style (ODBC or OLE DB) anyway.
Expand Down Expand Up @@ -634,8 +634,9 @@ public static bool DatabaseExists(string fileNameOrConnectionString)
return File.Exists(fileName);
}

public static DataAccessProviderType GetDataAccessProviderType(string connectionString)
public static DataAccessProviderType GetDataAccessProviderType(string? connectionString)
{
if (string.IsNullOrEmpty(connectionString)) return DataAccessProviderType.Unconfgiured;
var isOleDb = Regex.IsMatch(connectionString, @"^(?:.*;)?\s*Provider\s*=\s*\w+", RegexOptions.IgnoreCase);
var isOdbc = Regex.IsMatch(connectionString, @"^(?:.*;)?Driver\s*=\s*\{?\w+\}?", RegexOptions.IgnoreCase);

Expand Down Expand Up @@ -796,10 +797,10 @@ public static KeyValuePair<string, Version>[] GetMostRecentCompatibleProviders(D
return providers.ToArray();
}, true);

public static bool IsConnectionString(string fileNameOrConnectionString)
public static bool IsConnectionString(string? fileNameOrConnectionString)
=> JetStoreDatabaseHandling.IsConnectionString(fileNameOrConnectionString);

public static bool IsFileName(string fileNameOrConnectionString)
public static bool IsFileName(string? fileNameOrConnectionString)
=> JetStoreDatabaseHandling.IsFileName(fileNameOrConnectionString);
}
}
29 changes: 22 additions & 7 deletions src/EFCore.Jet.Data/JetDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,32 @@ public DateOnly GetDateOnly(int ordinal)

public TimeOnly GetTimeOnly(int ordinal)
{
var value = GetDateTime(ordinal);
return TimeOnly.FromDateTime(value);
var value = _wrappedDataReader.GetValue(ordinal);

if (JetConfiguration.UseDefaultValueOnDBNullConversionError &&
Convert.IsDBNull(value))
return default;

if (value is DateTime dateTime)
{
return TimeOnly.FromDateTime(dateTime);
}
return (TimeOnly)value;
}

public virtual TimeSpan GetTimeSpan(int ordinal)
{
var dateTime = GetDateTime(ordinal);
return JetConfiguration.UseDefaultValueOnDBNullConversionError &&
dateTime == default
? default
: dateTime - JetConfiguration.TimeSpanOffset;
var value = _wrappedDataReader.GetValue(ordinal);

if (JetConfiguration.UseDefaultValueOnDBNullConversionError &&
Convert.IsDBNull(value))
return default;

if (value is DateTime dateTime)
{
return TimeSpan.FromTicks(dateTime.Ticks - JetConfiguration.TimeSpanOffset.Ticks);
}
return (TimeSpan)value;
}

public virtual DateTimeOffset GetDateTimeOffset(int ordinal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ static JetInformationSchema()
}

public static bool TryGetDataReaderFromInformationSchemaCommand(JetCommand command, out DbDataReader dataReader)
=> (dataReader = GetDbDataReaderFromSimpleStatement(command)) != null;
{
dataReader = GetDbDataReaderFromSimpleStatement(command);
return dataReader != null;
}

private static DbDataReader GetDbDataReaderFromSimpleStatement(JetCommand command)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ public static string ExtractFileNameFromConnectionString(string connectionString
return connectionString;
}

public static bool IsConnectionString(string connectionString)
=> _regExIsConnectionString.IsMatch(connectionString);
public static bool IsConnectionString(string? connectionString)
=> !string.IsNullOrWhiteSpace(connectionString) && _regExIsConnectionString.IsMatch(connectionString);

public static bool IsFileName(string fileName)
public static bool IsFileName(string? fileName)
=> !string.IsNullOrWhiteSpace(fileName) &&
!IsConnectionString(fileName) &&
!fileName.ToCharArray()
Expand Down
1 change: 1 addition & 0 deletions src/EFCore.Jet/EFCore.Jet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<AssemblyName>EntityFrameworkCore.Jet</AssemblyName>
<Platforms>AnyCPU;x86;x64</Platforms>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);EF9100</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading