diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a31c48f20..f4f8edd6b 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -37,7 +37,24 @@ jobs:
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
+ clickhouse:
+ image: clickhouse/clickhouse-server:latest
+ ports:
+ - 8123/tcp
steps:
+ - name: Setup .NET Core
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: |
+ 3.1.x
+ 5.x
+ - uses: actions/cache@v3
+ name: Cache NuGet packages
+ with:
+ path: ~/.nuget/packages
+ key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
+ restore-keys: |
+ ${{ runner.os }}-nuget-
- name: Checkout code
uses: actions/checkout@v1
- name: .NET Build
@@ -49,5 +66,6 @@ jobs:
OLEDBConnectionString: Provider=SQLOLEDB;Server=tcp:localhost,${{ job.services.sqlserver.ports[1433] }};Database=tempdb;User Id=sa;Password=Password.;
PostgesConnectionString: Server=localhost;Port=${{ job.services.postgres.ports[5432] }};Database=test;User Id=postgres;Password=postgres;
SqlServerConnectionString: Server=tcp:localhost,${{ job.services.sqlserver.ports[1433] }};Database=tempdb;User Id=sa;Password=Password.;
+ ClickHouseConnectionString: Server=localhost;Port=${{ job.services.clickhouse.ports[8123] }};Username=default
- name: .NET Lib Pack
run: dotnet pack Build.csproj --no-build -c Release /p:PackageOutputPath=%CD%\.nupkgs /p:CI=true
diff --git a/tests/Dapper.Tests/Dapper.Tests.csproj b/tests/Dapper.Tests/Dapper.Tests.csproj
index b9f8b9347..a79a36b53 100644
--- a/tests/Dapper.Tests/Dapper.Tests.csproj
+++ b/tests/Dapper.Tests/Dapper.Tests.csproj
@@ -38,4 +38,9 @@
PreserveNewest
+
+
+ 6.5.2
+
+
diff --git a/tests/Dapper.Tests/Providers/ClickHouseTests.cs b/tests/Dapper.Tests/Providers/ClickHouseTests.cs
new file mode 100644
index 000000000..a2024a604
--- /dev/null
+++ b/tests/Dapper.Tests/Providers/ClickHouseTests.cs
@@ -0,0 +1,93 @@
+#if NETCOREAPP3_1_OR_GREATER
+
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.Common;
+using System.Linq;
+using ClickHouse.Client.ADO;
+using Xunit;
+using Xunit.Sdk;
+
+namespace Dapper.Tests.Providers
+{
+ public class ClickHouseProvider : DatabaseProvider
+ {
+ public override DbProviderFactory Factory { get; } = new ClickHouseConnectionFactory();
+
+ public override string GetConnectionString() =>
+ GetConnectionString("ClickHouseConnectionString", "Server=localhost;Port=8123;Username=default");
+ }
+
+ public class ClickHouseTests : TestBase
+ {
+ private ClickHouseConnection CreateConnection() => (ClickHouseConnection)Provider.GetOpenConnection();
+
+ public static IEnumerable