Skip to content

Commit

Permalink
Merge branch 'release/9.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
AGiorgetti committed Jul 31, 2023
2 parents 524a00f + 7ff1296 commit 19b6bd0
Show file tree
Hide file tree
Showing 32 changed files with 118 additions and 147 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"gitversion.tool": {
"version": "5.12.0",
"commands": [
"dotnet-gitversion"
]
}
}
}
12 changes: 12 additions & 0 deletions Changelog.md
@@ -1,5 +1,17 @@
# NEventStore.Persistence.Sql

## 9.1.1

- Target Framework supported: netstandard2.0, net462
- Updated System.Data.SqlClient 4.8.5
- Fix: NEventStore constraint failed with MySql 8.x (works with 5.7) [#487](https://github.com/NEventStore/NEventStore/issues/487)

### Breaking Change

- The fix for [#487](https://github.com/NEventStore/NEventStore/issues/487) changed how the `Commits` table is created for MySql 8.x:
to update an existing database in order to run on 8.x you need to manually update the `Commits` table schema and change the constraint of the `CommitId` column
from: `CommitId binary(16) NOT NULL CHECK (CommitId != 0)` to: `CommitId binary(16) NOT NULL CHECK (CommitId <> 0x00)`.

## 9.0.1

- Added documentation files to NuGet packages (improved intellisense support) [#36](https://github.com/NEventStore/NEventStore.Persistence.SQL/issues/36)
Expand Down
55 changes: 2 additions & 53 deletions GitVersion.yml
@@ -1,56 +1,5 @@
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDeployment
tag-prefix: '[vV]'
continuous-delivery-fallback-tag: ci
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
legacy-semver-padding: 4
build-metadata-padding: 4
commit-message-incrementing: Enabled
branches:
master:
mode: ContinuousDelivery
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
release:
mode: ContinuousDeployment
tag: beta
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
feature:
mode: ContinuousDeployment
tag: useBranchName
increment: Inherit
prevent-increment-of-merged-branch-version: false
track-merge-target: false
pull-requests:
regex: (pull|pull\-requests|pr)[/-]
mode: ContinuousDelivery
tag: PullRequest
increment: Inherit
prevent-increment-of-merged-branch-version: false
tag-number-pattern: '[/-](?<number>\d+)[-/]'
track-merge-target: false
source-branches: []
hotfix:
mode: ContinuousDeployment
tag: beta
increment: Patch
prevent-increment-of-merged-branch-version: false
track-merge-target: false
support:
mode: ContinuousDelivery
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
develop:
mode: ContinuousDeployment
tag: unstable
increment: Minor
prevent-increment-of-merged-branch-version: false
track-merge-target: true
branches: {}
ignore:
sha: []
merge-message-formats: {}
17 changes: 13 additions & 4 deletions README.md
Expand Up @@ -5,10 +5,8 @@ SQL Persistence Engine for NEventStore

NEventStore.Persistence.Sql currently supports:

- .net framework 4.6.1
- .net framework 4.6.2
- .net standard 2.0
- .net 5.0
- .net 6.0
- MsSql
- SqlLite
- MySql
Expand Down Expand Up @@ -53,10 +51,21 @@ git submodule update

To build the project locally on a Windows Machine:

- Install [Chocolatey](https://chocolatey.org/).
- Optional: update `.\src\.nuget\NEventStore.Persistence.Sql.nuspec` file if needed (before creating relase packages).
- Open a Powershell console in Administrative mode and run the build script `build.ps1` in the root of the repository.

## How to Run Unit Tests (locally)

- Install Database engines or use Docker to run them in a container (you can use the scripts in `./docker` folder).
- Define the following environment variables:

```
NEventStore.MsSql="Server=localhost,50001;Database=NEventStore;User Id=sa;Password=Password1;"
NEventStore.MySql="Server=localhost;Port=50003;Database=NEventStore;Uid=sa;Pwd=Password1;AutoEnlist=false;"
NEventStore.PostgreSql="Server=localhost;Port=50004;Database=NEventStore;Uid=sa;Pwd=Password1;Enlist=false;"
NEventStore.Oracle="Data Source=localhost:1521/XE;User Id=system;Password=Password1;Persist Security Info=True;"
```

## How to contribute

### Git-Flow
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -88,7 +88,7 @@ test_script:
iex "& $pgcmd"
nunit3-console "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.MsSql.Tests\bin\Release\net461\NEventStore.Persistence.MsSql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.MySql.Tests\bin\Release\net461\NEventStore.Persistence.MySql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.PostgreSql.Tests\bin\Release\net461\NEventStore.Persistence.PostgreSql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.Sqlite.Tests\bin\Release\net461\NEventStore.Persistence.Sqlite.Tests.dll" --workers=0 --result=testsresults.xml;
nunit3-console "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.MsSql.Tests\bin\Release\net462\NEventStore.Persistence.MsSql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.MySql.Tests\bin\Release\net462\NEventStore.Persistence.MySql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.PostgreSql.Tests\bin\Release\net462\NEventStore.Persistence.PostgreSql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.Sqlite.Tests\bin\Release\net462\NEventStore.Persistence.Sqlite.Tests.dll" --workers=0 --result=testsresults.xml;
# upload results to AppVeyor
Expand Down
11 changes: 4 additions & 7 deletions build.ps1
Expand Up @@ -7,24 +7,21 @@ if ($configuration -eq '') {
}
$runtests = Read-Host 'Run Tests (y / n) [default:n] ?'

# Consider using NuGet to download the package (GitVersion.CommandLine)
choco install gitversion.portable --pre --y
choco upgrade gitversion.portable --pre --y
choco install nuget.commandline
choco upgrade nuget.commandline
# Install gitversion tool
dotnet tool restore

# Display minimal restore information
dotnet restore ./src/NEventStore.Persistence.Sql.Core.sln --verbosity m

# GitVersion (for the main module)
Write-Host "Running GitVersion for the Project"
$str = gitversion /updateAssemblyInfo | out-string
$str = dotnet tool run dotnet-gitversion /updateAssemblyInfo | out-string
$json = convertFrom-json $str
$nugetversion = $json.NuGetVersion

# Now we need to patch the AssemblyInfo for submodules
Write-Host "Running GitVersion for the Dependencies"
gitversion ".\dependencies\NEventStore" /updateAssemblyInfo | Out-Null
dotnet tool run dotnet-gitversion ".\dependencies\NEventStore" /updateAssemblyInfo | Out-Null

# Build
Write-Host "Building: "$nugetversion" "$configuration
Expand Down
2 changes: 1 addition & 1 deletion dependencies/NEventStore
Submodule NEventStore updated 31 files
+12 −0 .config/dotnet-tools.json
+10 −0 Changelog.md
+2 −53 GitVersion.yml
+1 −1 appveyor.yml
+3 −4 build.ps1
+13 −4 readme.markdown
+1 −1 src/NEventStore.Benchmark/Benchmarks/PersistenceBenchmarks.cs
+7 −7 src/NEventStore.Benchmark/NEventStore.Benchmark.csproj
+1 −1 src/NEventStore.Benchmark/Support/EventStoreHelpers.cs
+1 −1 src/NEventStore.Example/MainProgram.cs
+9 −9 src/NEventStore.Example/NEventStore.Example.csproj
+4 −4 src/NEventStore.Persistence.AcceptanceTests/NEventStore.Persistence.AcceptanceTests.Core.csproj
+2 −2 src/NEventStore.Persistence.AcceptanceTests/PersistenceTests.cs
+1 −1 src/NEventStore.PollingClient/NEventStore.PollingClient.csproj
+1 −1 src/NEventStore.PollingClientExample/MainProgram.cs
+9 −9 src/NEventStore.PollingClientExample/NEventStore.PollingClientExample.csproj
+6 −6 src/NEventStore.Serialization.Binary.Tests/NEventStore.Serialization.Binary.Core.Tests.csproj
+6 −6 src/NEventStore.Serialization.Bson.Tests/NEventStore.Serialization.Bson.Core.Tests.csproj
+2 −2 src/NEventStore.Serialization.Bson/NEventStore.Serialization.Bson.Core.csproj
+6 −6 src/NEventStore.Serialization.Gzip.Tests/NEventStore.Serialization.GZip.Core.Tests.csproj
+6 −6 src/NEventStore.Serialization.Json.Tests/NEventStore.Serialization.Json.Core.Tests.csproj
+2 −2 src/NEventStore.Serialization.Json/NEventStore.Serialization.Json.Core.csproj
+6 −6 src/NEventStore.Serialization.Rijndael.Tests/NEventStore.Serialization.Rijndael.Core.Tests.csproj
+10 −10 src/NEventStore.Tests/NEventStore.Core.Tests.csproj
+1 −1 src/NEventStore/Diagnostics/PerformanceCounterPersistenceEngine.cs
+1 −1 src/NEventStore/Diagnostics/PerformanceCounters.cs
+1 −1 src/NEventStore/Messages.Designer.cs
+2 −2 src/NEventStore/NEventStore.Core.csproj
+3 −3 src/NEventStore/PersistenceWireup.cs
+1 −1 src/NEventStore/Resources.Designer.cs
+1 −1 src/NEventStore/Serialization/Messages.Designer.cs
2 changes: 1 addition & 1 deletion docker/docker-compose.ci.linux.db.yml
Expand Up @@ -32,7 +32,7 @@ services:
mysql:
container_name: nesci-mysql-1
platform: linux
image: mysql:5.7
image: mysql:8.0 #5.7
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.ci.windows.db.yml
Expand Up @@ -32,7 +32,7 @@ services:
mysql:
container_name: nesci-mysql-1
platform: windows
image: mysql:5.7
image: mysql:8.0 #5.7
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
Expand Down
28 changes: 9 additions & 19 deletions src/.nuget/NEventStore.Persistence.Sql.nuspec
Expand Up @@ -20,31 +20,21 @@
6.x.x versions
-->
<dependencies>
<group targetFramework=".NETFramework4.6.1">
<dependency id="NEventStore" version="[9.0.0,10.0.0)" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="6.0.0" exclude="Build,Analyzers" />
<dependency id="System.Data.SqlClient" version="4.8.3" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0">
<dependency id="NEventStore" version="[9.0.0, 10.0.0)" exclude="Build,Analyzers" />
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="6.0.0" exclude="Build,Analyzers" />
<dependency id="System.Data.SqlClient" version="4.8.3" exclude="Build,Analyzers" />
</group>
<group targetFramework="net5.0">
<dependency id="NEventStore" version="[9.0.0, 10.0.0)" exclude="Build,Analyzers" />
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="6.0.0" exclude="Build,Analyzers" />
<group targetFramework=".NETFramework4.6.2">
<dependency id="NEventStore" version="[9.1.1,10.0.0)" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="7.0.1" exclude="Build,Analyzers" />
<dependency id="System.Data.SqlClient" version="4.8.3" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="NEventStore" version="[9.0.0,10.0.0)" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="6.0.0" exclude="Build,Analyzers" />
<dependency id="System.Data.SqlClient" version="4.8.3" exclude="Build,Analyzers" />
<dependency id="NEventStore" version="[9.1.1,10.0.0)" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="7.0.1" exclude="Build,Analyzers" />
<dependency id="System.Data.SqlClient" version="4.8.5" exclude="Build,Analyzers" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Configuration" targetFramework=".NETFramework4.6.1" />
<frameworkAssembly assemblyName="System.Transactions" targetFramework=".NETFramework4.6.1" />
<frameworkAssembly assemblyName="System.Web" targetFramework=".NETFramework4.6.1" />
<frameworkAssembly assemblyName="System.Configuration" targetFramework=".NETFramework4.6.2" />
<frameworkAssembly assemblyName="System.Transactions" targetFramework=".NETFramework4.6.2" />
<frameworkAssembly assemblyName="System.Web" targetFramework=".NETFramework4.6.2" />
</frameworkAssemblies>
</metadata>
<files>
Expand Down
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net7.0;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>NEventStore.Persistence.MsSql.Tests</AssemblyName>
Expand All @@ -14,16 +14,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System.Transactions" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -18,7 +18,7 @@ public partial class PersistenceEngineFixture

public PersistenceEngineFixture()
{
#if NET461
#if NET462
_createPersistence = pageSize =>
new SqlPersistenceFactory(new EnviromentConnectionFactory("MsSql", "System.Data.SqlClient"),
new BinarySerializer(),
Expand Down
Expand Up @@ -4,7 +4,7 @@
using System.Linq;
using System.Transactions;
using FluentAssertions;
#if NET461
#if NET462
using NEventStore.Diagnostics;
#endif
using NEventStore.Persistence.AcceptanceTests.BDD;
Expand Down Expand Up @@ -123,7 +123,7 @@ public class IsolationLevelPersistenceEngineFixture
public IsolationLevelPersistenceEngineFixture()
{
_recorder = new IsolationLevelRecorder();
#if NET461
#if NET462
_connectionFactory = new EnviromentConnectionFactory("MsSql", "System.Data.SqlClient");
#else
_connectionFactory = new EnviromentConnectionFactory("MsSql", System.Data.SqlClient.SqlClientFactory.Instance);
Expand All @@ -141,7 +141,7 @@ public void Initialize()
_persistence.Drop();
_persistence.Dispose();
}
#if NET461
#if NET462
_persistence = new PerformanceCounterPersistenceEngine(_createPersistence(), "tests");
#else
_persistence = _createPersistence();
Expand Down
2 changes: 1 addition & 1 deletion src/NEventStore.Persistence.MsSql.Tests/WireupTests.cs
Expand Up @@ -31,7 +31,7 @@ protected override void Context()
{
_eventStore = Wireup
.Init()
#if NET461
#if NET462
.UsingSqlPersistence(new EnviromentConnectionFactory("MsSql", "System.Data.SqlClient"))
#else
.UsingSqlPersistence(new EnviromentConnectionFactory("MsSql", System.Data.SqlClient.SqlClientFactory.Instance))
Expand Down
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net7.0;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>NEventStore.Persistence.MySql.Tests</AssemblyName>
Expand All @@ -14,17 +14,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MySql.Data" Version="8.0.27" />
<PackageReference Include="MySql.Data" Version="8.1.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System.Data" />
<Reference Include="System.Transactions" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -11,7 +11,7 @@ public partial class PersistenceEngineFixture
{
public PersistenceEngineFixture()
{
#if NET461
#if NET462
_createPersistence = pageSize =>
new SqlPersistenceFactory(
new EnviromentConnectionFactory("MySql", "MySql.Data.MySqlClient"),
Expand Down
2 changes: 1 addition & 1 deletion src/NEventStore.Persistence.MySql.Tests/app.config
Expand Up @@ -3,7 +3,7 @@
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.27.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.1.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net7.0;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>NEventStore.Persistence.PostgreSql.Tests</AssemblyName>
Expand All @@ -13,15 +13,15 @@
<DefineConstants Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">NUNIT</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System.Transactions" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Npgsql" Version="6.0.0" />
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="Npgsql" Version="7.0.4" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -14,7 +14,7 @@ public PersistenceEngineFixture()
// It will be done when creating the PostgreNpgsql6Dialect dialect
// AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);

#if NET461
#if NET462
_createPersistence = pageSize =>
new SqlPersistenceFactory(
new EnviromentConnectionFactory("PostgreSql", "Npgsql"),
Expand Down

0 comments on commit 19b6bd0

Please sign in to comment.