Skip to content

Commit

Permalink
Merge pull request #30 from RVINAA/juanje/force-seqscans
Browse files Browse the repository at this point in the history
Added a new Advanced SagaPersister using Json datatype (on psql) for storing saga correlations.
  • Loading branch information
pruiz committed Jul 19, 2022
2 parents 2062c97 + 446b45d commit c32f34d
Show file tree
Hide file tree
Showing 28 changed files with 2,924 additions and 1,869 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@
*.suo
*.user
*.sln.docstates
.idea/

# Build results

Expand Down
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -6,3 +6,15 @@ In order to run unit-tests locally, a postgres instance is required.
It can be launched using docker, with same parameters as it is launched on appveyor.

* docker run -it --rm -e 'POSTGRES_PASSWORD=Password12!' -e 'POSTGRES_DB=test' -p 5432:5432 postgres:10

# Running Unit Tests (against YugaByteDB)
In order to run unit-tests locally using YugaByteDB, a 2.15+ version is required for full
compatibility (as this version supports FOR UPDATE NOWAIT/SKIP LOCKED), and it should
have been started as:

docker run -it --rm --name yugabyte -p1070:7000 -p9000:9000 -p5432:5433 -p9042:9042 yugabytedb/yugabyte:2.15.0.0-b11 bin/yugabyted start --daemon=false --tserver_flags="yb_enable_read_committed_isolation=true"

Also a test database has to be pre-created using:

docker exec -it yugabyte bin/ysqlsh -C "CREATE DATABASE test;"

29 changes: 29 additions & 0 deletions Rebus.AdoNet.Tests/DatabaseFixtureBase.cs
Expand Up @@ -108,6 +108,35 @@ protected IEnumerable<string> GetTableNames()
}
}

/// <summary>
/// Fetch the column names with their data types..
/// where the Tuple.Item1 is the column name and the Tuple.Item2 is the data type.
/// </summary>
protected IEnumerable<Tuple<string, string>> GetColumnSchemaFor(string tableName)
{
using (var connection = Factory.CreateConnection())
{
connection.ConnectionString = ConnectionString;
connection.Open();

return connection.GetColumnSchemaFor(tableName);
}
}

/// <summary>
/// Retrieve table's indexes for a specific table.
/// </summary>
protected IEnumerable<string> GetIndexesFor(string tableName)
{
using (var connection = Factory.CreateConnection())
{
connection.ConnectionString = ConnectionString;
connection.Open();

return connection.GetIndexesFor(tableName);
}
}

protected void DropTable(string tableName)
{
if (!GetTableNames().Contains(tableName, StringComparer.InvariantCultureIgnoreCase)) return;
Expand Down
37 changes: 6 additions & 31 deletions Rebus.AdoNet.Tests/Rebus.AdoNet.Tests.csproj
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit3TestAdapter.4.2.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.4.2.1\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -40,37 +42,8 @@
<HintPath>..\packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Mdb.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Pdb.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Rocks.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.engine, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit3TestAdapter.3.4.0\lib\nunit.engine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.engine.api, Version=3.0.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit3TestAdapter.3.4.0\lib\nunit.engine.api.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NUnit3.TestAdapter, Version=3.4.0.0, Culture=neutral, PublicKeyToken=4cb40d35494691ac, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit3TestAdapter.3.4.0\lib\NUnit3.TestAdapter.dll</HintPath>
<Private>False</Private>
<Reference Include="nunit.framework, Version=3.13.3.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Rebus, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Rebus.0.84.0\lib\NET45\Rebus.dll</HintPath>
Expand Down Expand Up @@ -132,6 +105,8 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net45\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.102.0\build\net45\System.Data.SQLite.Core.targets'))" />
<Error Condition="!Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.3\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.4.2.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.4.2.1\build\net35\NUnit3TestAdapter.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down

0 comments on commit c32f34d

Please sign in to comment.