Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Represents the **NuGet** versions.

## v3.3.1
- *Fixed:* Updated package dependencies to the latest compatible versions within their existing major versions.
- *Fixed:* Updated `System.Security.Cryptography.Pkcs` to patched versions (`8.0.2` for `net8.0`; `9.0.21` for `net9.0` and `net10.0`) to address known vulnerabilities.

## v3.3.0
- *Enhancement:* Non-primitive database types are now mapped to their correct .NET types (unqualified; a `global using` is expected) instead of throwing `Database data type 'x' does not have corresponding .NET type mapping defined`, which previously failed the `Data`, `Reset` and `Inspect` commands for the whole database. Originated from PR #72 by Wesley Teixeira.
- SQL Server: `geography`/`geometry` (`Geometry`), `hierarchyid` (`HierarchyId`), `vector` (`SqlVector<float>`), `xml`/`json` (`string`) and `sql_variant` (`object`).
Expand Down
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.3.0</Version>
<Version>3.3.1</Version>
<LangVersion>preview</LangVersion>
<Authors>Avanade</Authors>
<Company>Avanade</Company>
Expand Down
2 changes: 1 addition & 1 deletion src/DbEx.MySql/DbEx.MySql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MySql.Data" Version="9.5.0" />
<PackageReference Include="MySql.Data" Version="9.7.0" />
<PackageReference Include="dbup-mysql" Version="6.1.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/DbEx.Postgres/DbEx.Postgres.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="10.0.1" />
<PackageReference Include="Npgsql" Version="10.0.3" />
<PackageReference Include="dbup-postgresql" Version="6.1.5" />
</ItemGroup>

Expand Down
10 changes: 9 additions & 1 deletion src/DbEx.SqlServer/DbEx.SqlServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.3" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.7" />
<PackageReference Include="dbup-sqlserver" Version="6.0.16" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="8.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0' Or '$(TargetFramework)' == 'net10.0'">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.21" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DbEx\DbEx.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/DbEx/DbEx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.13" />
<PackageReference Include="OnRamp" Version="2.2.5" />
</ItemGroup>

Expand Down
30 changes: 19 additions & 11 deletions tests/DbEx.Test.Empty/DbEx.Test.Empty.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,36 @@

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer">
<Version>10.0.5</Version>
<Version>10.0.13</Version>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.HierarchyId" Version="10.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="10.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.HierarchyId" Version="10.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="10.0.13" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer">
<Version>9.0.14</Version>
<Version>9.0.21</Version>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.HierarchyId" Version="9.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="9.0.14" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.HierarchyId" Version="9.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="9.0.21" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.7" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer">
<Version>8.0.25</Version>
<Version>8.0.32</Version>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.HierarchyId" Version="8.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="8.0.25" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.HierarchyId" Version="8.0.32" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="8.0.32" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.7" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="8.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0' Or '$(TargetFramework)' == 'net10.0'">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.21" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions tests/DbEx.Test/DbEx.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.13" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="10.0.13" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.13" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.13" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="NUnit" Version="4.6.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
Expand Down
18 changes: 9 additions & 9 deletions tests/DbEx.Test/PostgresMigrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

var rows = await ExtraTypesReader.ReadAsync(conn, sql);

ExtraTypesReader.AssertRows(rows, "extra_types_id", new Dictionary<string, string?>

Check warning on line 61 in tests/DbEx.Test/PostgresMigrationTest.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
["extra_types_id"] = "1",
["ip_address"] = "192.168.1.10/32",
Expand Down Expand Up @@ -125,15 +125,15 @@
var cs = UnitTest.GetConfig("DbEx_").GetConnectionString("PostgresDb");
using var db = new PostgresDatabase(() => new Npgsql.NpgsqlConnection(cs));

Assert.AreEqual("56003", Assert.ThrowsAsync<PostgresException>(() => db.StoredProcedure("sp_throw_authorization_exception").Param("@message", (string)null).NonQueryAsync()).SqlState);
Assert.AreEqual("56002", Assert.ThrowsAsync<PostgresException>(() => db.StoredProcedure("sp_throw_business_exception").Param("@message", (string)null).NonQueryAsync()).SqlState);
Assert.AreEqual("56004", Assert.ThrowsAsync<PostgresException>(() => db.StoredProcedure("sp_throw_concurrency_exception").Param("@message", (string)null).NonQueryAsync()).SqlState);
Assert.AreEqual("56006", Assert.ThrowsAsync<PostgresException>(() => db.StoredProcedure("sp_throw_conflict_exception").Param("@message", (string)null).NonQueryAsync()).SqlState);
Assert.AreEqual("56007", Assert.ThrowsAsync<PostgresException>(() => db.StoredProcedure("sp_throw_duplicate_exception").Param("@message", (string)null).NonQueryAsync()).SqlState);
Assert.AreEqual("56005", Assert.ThrowsAsync<PostgresException>(() => db.StoredProcedure("sp_throw_not_found_exception").Param("@message", (string)null).NonQueryAsync()).SqlState);
Assert.AreEqual("56001", Assert.ThrowsAsync<PostgresException>(() => db.StoredProcedure("sp_throw_validation_exception").Param("@message", (string)null).NonQueryAsync()).SqlState);

var vex = Assert.ThrowsAsync<PostgresException>(() => db.StoredProcedure("sp_throw_validation_exception").Param("@message", "On no!").NonQueryAsync());
Assert.AreEqual("56003", Assert.ThrowsAsync<PostgresException>((AsyncTestDelegate)(() => db.StoredProcedure("sp_throw_authorization_exception").Param("@message", (string)null).NonQueryAsync())).SqlState);

Check warning on line 128 in tests/DbEx.Test/PostgresMigrationTest.cs

View workflow job for this annotation

GitHub Actions / build

'Assert.ThrowsAsync<TActual>(AsyncTestDelegate)' is obsolete: 'Use Func<Task> instead of AsyncTestDelegate'

Check warning on line 128 in tests/DbEx.Test/PostgresMigrationTest.cs

View workflow job for this annotation

GitHub Actions / build

'AsyncTestDelegate' is obsolete: 'Use Func<Task> instead of AsyncTestDelegate'
Assert.AreEqual("56002", Assert.ThrowsAsync<PostgresException>((AsyncTestDelegate)(() => db.StoredProcedure("sp_throw_business_exception").Param("@message", (string)null).NonQueryAsync())).SqlState);

Check warning on line 129 in tests/DbEx.Test/PostgresMigrationTest.cs

View workflow job for this annotation

GitHub Actions / build

'Assert.ThrowsAsync<TActual>(AsyncTestDelegate)' is obsolete: 'Use Func<Task> instead of AsyncTestDelegate'

Check warning on line 129 in tests/DbEx.Test/PostgresMigrationTest.cs

View workflow job for this annotation

GitHub Actions / build

'AsyncTestDelegate' is obsolete: 'Use Func<Task> instead of AsyncTestDelegate'
Assert.AreEqual("56004", Assert.ThrowsAsync<PostgresException>((AsyncTestDelegate)(() => db.StoredProcedure("sp_throw_concurrency_exception").Param("@message", (string)null).NonQueryAsync())).SqlState);

Check warning on line 130 in tests/DbEx.Test/PostgresMigrationTest.cs

View workflow job for this annotation

GitHub Actions / build

'AsyncTestDelegate' is obsolete: 'Use Func<Task> instead of AsyncTestDelegate'
Assert.AreEqual("56006", Assert.ThrowsAsync<PostgresException>((AsyncTestDelegate)(() => db.StoredProcedure("sp_throw_conflict_exception").Param("@message", (string)null).NonQueryAsync())).SqlState);
Assert.AreEqual("56007", Assert.ThrowsAsync<PostgresException>((AsyncTestDelegate)(() => db.StoredProcedure("sp_throw_duplicate_exception").Param("@message", (string)null).NonQueryAsync())).SqlState);
Assert.AreEqual("56005", Assert.ThrowsAsync<PostgresException>((AsyncTestDelegate)(() => db.StoredProcedure("sp_throw_not_found_exception").Param("@message", (string)null).NonQueryAsync())).SqlState);
Assert.AreEqual("56001", Assert.ThrowsAsync<PostgresException>((AsyncTestDelegate)(() => db.StoredProcedure("sp_throw_validation_exception").Param("@message", (string)null).NonQueryAsync())).SqlState);

var vex = Assert.ThrowsAsync<PostgresException>((AsyncTestDelegate)(() => db.StoredProcedure("sp_throw_validation_exception").Param("@message", "On no!").NonQueryAsync()));
Assert.AreEqual("On no!", vex.MessageText.TrimEnd());
}

Expand Down
18 changes: 9 additions & 9 deletions tests/DbEx.Test/SqlServerMigrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ public async Task C110_Throw_Exceptions()
var (cs, l, m) = await CreateConsoleDb().ConfigureAwait(false);
using var db = new SqlServerDatabase(() => new SqlConnection(cs));

Assert.AreEqual(Assert.ThrowsAsync<SqlException>(() => db.StoredProcedure("spThrowAuthorizationException").Param("message", (string)null).NonQueryAsync()).Number, 56003);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>(() => db.StoredProcedure("spThrowBusinessException").Param("message", (string)null).NonQueryAsync()).Number, 56002);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>(() => db.StoredProcedure("spThrowConcurrencyException").Param("message", (string)null).NonQueryAsync()).Number, 56004);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>(() => db.StoredProcedure("spThrowConflictException").Param("message", (string)null).NonQueryAsync()).Number, 56006);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>(() => db.StoredProcedure("spThrowDuplicateException").Param("message", (string)null).NonQueryAsync()).Number, 56007);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>(() => db.StoredProcedure("spThrowNotFoundException").Param("message", (string)null).NonQueryAsync()).Number, 56005);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>(() => db.StoredProcedure("spThrowValidationException").Param("message", (string)null).NonQueryAsync()).Number, 56001);

var vex = Assert.ThrowsAsync<SqlException>(() => db.StoredProcedure("spThrowValidationException").Param("message", "On no!").NonQueryAsync());
Assert.AreEqual(Assert.ThrowsAsync<SqlException>((AsyncTestDelegate)(() => db.StoredProcedure("spThrowAuthorizationException").Param("message", (string)null).NonQueryAsync())).Number, 56003);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>((AsyncTestDelegate)(() => db.StoredProcedure("spThrowBusinessException").Param("message", (string)null).NonQueryAsync())).Number, 56002);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>((AsyncTestDelegate)(() => db.StoredProcedure("spThrowConcurrencyException").Param("message", (string)null).NonQueryAsync())).Number, 56004);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>((AsyncTestDelegate)(() => db.StoredProcedure("spThrowConflictException").Param("message", (string)null).NonQueryAsync())).Number, 56006);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>((AsyncTestDelegate)(() => db.StoredProcedure("spThrowDuplicateException").Param("message", (string)null).NonQueryAsync())).Number, 56007);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>((AsyncTestDelegate)(() => db.StoredProcedure("spThrowNotFoundException").Param("message", (string)null).NonQueryAsync())).Number, 56005);
Assert.AreEqual(Assert.ThrowsAsync<SqlException>((AsyncTestDelegate)(() => db.StoredProcedure("spThrowValidationException").Param("message", (string)null).NonQueryAsync())).Number, 56001);

var vex = Assert.ThrowsAsync<SqlException>((AsyncTestDelegate)(() => db.StoredProcedure("spThrowValidationException").Param("message", "On no!").NonQueryAsync()));
Assert.AreEqual("On no!", vex.Message);
}

Expand Down
Loading