ClickHouse.Driver is an open-source project, and we welcome any contributions from the community. Please share your ideas, contribute to the codebase, and help us maintain up-to-date documentation.
You will need:
- .NET SDK 9.0+ (the project also targets .NET 6.0, 8.0, .NET Standard 2.1, and .NET Framework 4.6.2/4.8)
You can verify your .NET installation:
dotnet --versiongit clone https://github.com/ClickHouse/clickhouse-cs
cd clickhouse-csdotnet build ClickHouse.Driver.sln -c ReleaseIt is recommended to have the C# LSP server and plugin installed and enabled if using Claude Code. See here for more information.
The project enforces code style automatically via .editorconfig and <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>.
Whenever you add a new feature or fix a bug, we strongly encourage you to add appropriate tests to ensure everyone in the community can safely benefit from your contribution.
The solution includes three test projects:
- ClickHouse.Driver.Tests - Unit and functional tests
- ClickHouse.Driver.IntegrationTests - Integration tests (Liq2db)
- ClickHouse.Driver.Benchmark - Performance benchmarks (BenchmarkDotNet)
Tests require a ClickHouse server. By default, the test suite uses Testcontainers to automatically start and manage a ClickHouse container for you - all you need is a running Docker daemon.
dotnet test ClickHouse.Driver.Tests/ClickHouse.Driver.Tests.csproj --framework net9.0 -c ReleaseIf you'd rather point the tests at an already-running ClickHouse instance, set CLICKHOUSE_CONNECTION to a valid connection string. When this variable is set, Testcontainers is skipped:
# Windows (PowerShell)
$env:CLICKHOUSE_CONNECTION="Host=localhost;Port=8123;Username=default"
# Linux/macOS (Bash)
export CLICKHOUSE_CONNECTION="Host=localhost;Port=8123;Username=default"A matching Docker command, if you want to run your own instance:
docker run --rm -d \
-p 8123:8123 \
-e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 \
--name clickhouse-dev clickhouse/clickhouse-server:latestIntegration tests use the same ClickHouse instance but are in a separate project:
dotnet test ClickHouse.Driver.IntegrationTests/ClickHouse.Driver.IntegrationTests.csproj --framework net9.0 -c ReleaseThe project uses Coverlet for code coverage:
dotnet test ClickHouse.Driver.Tests/ClickHouse.Driver.Tests.csproj \
--framework net9.0 \
-c Release \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=opencover \
/p:SkipAutoProps=trueCoverage reports are generated in the test project directory:
ClickHouse.Driver.Tests/coverage.net9.0.opencover.xml
Benchmarks use BenchmarkDotNet and require a running ClickHouse instance:
dotnet run --project ClickHouse.Driver.Benchmark/ClickHouse.Driver.Benchmark.csproj \
--framework net9.0 \
--configuration Release \
-- --join --filter "*" --artifacts ./results --job ShortResults will be saved in the results/ directory.
To pin tests to a specific ClickHouse version, set CLICKHOUSE_VERSION. Testcontainers will pull the matching clickhouse/clickhouse-server:<version> image:
export CLICKHOUSE_VERSION="25.3"
dotnet test ClickHouse.Driver.Tests/ClickHouse.Driver.Tests.csproj --framework net9.0 -c ReleaseIf you're using your own ClickHouse instance via CLICKHOUSE_CONNECTION, CLICKHOUSE_VERSION is still honored for feature-flag detection — otherwise the server version is queried at startup.
- All tests must pass on all target frameworks and ClickHouse versions
- Code coverage is reported to Codecov (must not decrease significantly)
- Benchmarks run but don't fail the build (used for performance regression detection)
- CodeQL must not find security issues
- Public API analyzer will fail if API surface changes aren't documented
Releases are managed by maintainers through the GitHub Actions release workflow.
Before release, update version in:
ClickHouse.Driver/ClickHouse.Driver.csproj-<Version>property- Ensure
PublicAPI.Shipped.txtis updated with new APIs - Move entries from
PublicAPI.Unshipped.txttoPublicAPI.Shipped.txt
The release is triggered manually via GitHub Actions:
- Go to Actions → Release workflow
- Click "Run workflow"
- The workflow will:
- Build the solution in Release mode
- Pack the NuGet package
- Publish to NuGet.org
- Create a GitHub release
- Issues: Open a GitHub issue for bugs or feature requests
- Discussions: Use GitHub Discussions for questions
- Pull Requests: Submit PRs with clear descriptions and tests
Please be respectful and constructive in all interactions. We aim to foster an inclusive and welcoming community.
By contributing to ClickHouse.Driver, you agree that your contributions will be licensed under the MIT License.