Skip to content

Commit

Permalink
Merge pull request #241 from Lombiq/issue/OSOE-801
Browse files Browse the repository at this point in the history
OSOE-801: Fixing SQL Server auto-detection for linq2db queries and updating linq2db to v5.4.0
  • Loading branch information
sarahelsaig authored Mar 9, 2024
2 parents 756c82c + 15e0190 commit 749343b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions Lombiq.HelpfulLibraries.LinqToDb/LinqToDbQueryExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ public static async Task<TResult> LinqQueryAsync<TResult>(
private static string GetDatabaseProviderName(string dbName) =>
dbName switch
{
// Using explicit string instead of LinqToDB.ProviderName.SqlServer because if the "System.Data.SqlClient"
// provider will be used it will cause "Could not load type System.Data.SqlClient.SqlCommandBuilder"
// exception. See: https://github.com/linq2db/linq2db/issues/2191#issuecomment-618450439.
"SqlServer" => "Microsoft.Data.SqlClient",
// Using a concrete SQL Server version here removes the need for an initial auto-detection query that can
// fail, see https://github.com/Lombiq/Helpful-Libraries/issues/236. This needs to be the same version
// YesSql and thus OC supports. You can check it out in YesSql's build workflow:
// https://github.com/sebastienros/yessql/blob/main/.github/workflows/build.yml.
"SqlServer" => ProviderName.SqlServer2019,
"Sqlite" => ProviderName.SQLite,
"MySql" => ProviderName.MySql,
"PostgreSql" => ProviderName.PostgreSQL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="linq2db" Version="5.3.2" />
<PackageReference Include="linq2db" Version="5.4.0" />
<PackageReference Include="OrchardCore.Data.YesSql" Version="1.8.2" />
</ItemGroup>
</Project>

0 comments on commit 749343b

Please sign in to comment.