Zongsoft.Data.ClickHouse 2.11.0

dotnet add package Zongsoft.Data.ClickHouse --version 2.11.0
                    
NuGet\Install-Package Zongsoft.Data.ClickHouse -Version 2.11.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zongsoft.Data.ClickHouse" Version="2.11.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zongsoft.Data.ClickHouse" Version="2.11.0" />
                    
Directory.Packages.props
<PackageReference Include="Zongsoft.Data.ClickHouse" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zongsoft.Data.ClickHouse --version 2.11.0
                    
#r "nuget: Zongsoft.Data.ClickHouse, 2.11.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zongsoft.Data.ClickHouse@2.11.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zongsoft.Data.ClickHouse&version=2.11.0
                    
Install as a Cake Addin
#tool nuget:?package=Zongsoft.Data.ClickHouse&version=2.11.0
                    
Install as a Cake Tool

Zongsoft.Data.ClickHouse Data Driver Plugin Library

License NuGet Version NuGet Downloads GitHub Stars

English | 简体中文


Overview

Zongsoft.Data.ClickHouse is a low-level data engine driver in the Zongsoft open-source framework. It provides access to ClickHouse and is transparent to upper-layer applications; deploy this plugin library to the application plugin directory to enable it.

When to Use This Driver

Choose this package when a Zongsoft data model is stored in ClickHouse. The public application contract remains IDataAccess/IDataService<T>; this package translates expressions and mutations into the database dialect and creates connections through ClickHouse.Driver.

ClickHouse is column-oriented and optimized for analytical workloads. Review mutation and transaction expectations before using data-service patterns designed for OLTP databases.

Installation and Plugin Deployment

dotnet add package Zongsoft.Data.ClickHouse

Deploy Zongsoft.Data.ClickHouse.plugin with the assembly. Its manifest registers the connection-settings parser and data driver under the framework workbench. A NuGet reference without the plugin manifest does not activate the driver in a plugin host.

Connection Configuration

<options>
	<option path="/Data">
		<connectionSettings default="Application">
			<connectionSetting connectionSetting.name="Application"
			                   driver="ClickHouse"
			                   value="Server=127.0.0.1;Port=8123;Database=docs;UserName=docs_app;Password=REPLACE_WITH_TEST_PASSWORD;Protocol=http" />
		</connectionSettings>
	</option>
</options>

The driver value is case-insensitive but should use the canonical ClickHouse spelling. The value is parsed by this package's connection settings driver and ultimately passed to ClickHouse.Driver; consult the provider documentation for supported keywords.

💡 Keep entity mappings, criteria, paging, transactions, and IDataAccess usage in the shared Zongsoft.Data guide. Switching drivers should not require application services to depend on provider connection classes.

The connection string uses this driver's public settings model, which does not necessarily expose every underlying SDK keyword. Examples target local test environments only. Prepare databases, accounts and permissions, and replace explicitly marked test credentials; this is not a server initialization script.

Access Through Application Contracts

The consumer module references Core; the host deploys Data and this driver. After startup, obtain the accessor matching the configured connection name:

using Zongsoft.Data;
using Zongsoft.Services;

var provider = ApplicationContext.Current.Services
	.ResolveRequired<Zongsoft.Services.IServiceProvider<IDataAccess>>();
var data = provider.GetService("Application")
	?? throw new InvalidOperationException("Data accessor not found.");
Console.WriteLine(data.Name);

Obtaining an accessor does not prove query execution succeeded. Follow the real Discussions composition in the Data guide through its module, mapping and services. That walkthrough does not establish Discussions compatibility with this driver: verify database structures, field types and required operations, rather than assuming a driver-name change makes the application portable. Business services use shared contracts instead of constructing database connections.

The provider is ClickHouse.Driver 1.4.0. ADO.NET connections and commands serve the data engine; bulk imports use ClickHouseClient.InsertBinaryAsync with the leased connection's settings and current database. The Compression setting also controls binary-insert compression. The provider has no UseServerTimezone switch; configure date/time behavior through ClickHouse column types and explicit query conversions.

Runtime Behavior

The driver supplies a provider-specific statement builder/visitor, command parameterization, execution primitives, and an importer. The data engine selects it from the named connection setting. Ambient data transactions are honored where the provider and operation support them.

🚨 Never commit production connection strings. Use deployment-time configuration or a secret provider, grant the database identity only the required permissions, and verify destructive mutations against a disposable database first.

Compatibility and Testing

Database behavior is not completely portable. Verify identifier casing, null and comparison rules, date/time precision, generated values, transaction semantics, and bulk-import constraints on the same server/provider versions used in production. Connection-settings and command-construction tests run offline. End-to-end query and bulk-import validation requires an explicitly configured disposable ClickHouse database.

Plugin-Based Integration

Compose this feature through the host; a package reference supplies compile-time APIs, while plugin loading also requires deployed manifests and runtime assets. See the complete plugin workflow.

The manifest adds the driver to /Workbench/Data/Drivers and the connection-settings registry. Configure the exact driver key shown above, deploy the application's mapping, then obtain IDataAccess from the host. Database creation/migration remains an explicit application operation.

Runtime artifact Source of truth
Zongsoft.Data.ClickHouse Zongsoft.Data.ClickHouse.plugin
File copying and dependencies Zongsoft.Data.ClickHouse.deploy

Add this fragment to an existing host .deploy (retain Main and the host’s other base manifests; do not replace the whole file):

[plugins zongsoft data]
nuget:Zongsoft.Data

[plugins zongsoft data clickhouse]
nuget:Zongsoft.Data.ClickHouse

Run dotnet deploy against a test deployment as explained in the workflow, with the host's framework, platform, architecture and, where needed, site. Pin compatible versions in real deployments; application dependencies such as databases, caches or commercial runtimes are still separate prerequisites.

Additional artifacts listed by the deployment manifest include Zongsoft.Data.ClickHouse.plugin. Retain assemblies, dependencies and satellite resource directories as well. Restart the host after deployment, check plugin loading and service/driver registration, then verify the workflow above; copied files alone do not prove that the feature is active.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.11.0 73 9/27/2026
2.10.0 98 9/18/2026
2.9.0 119 8/11/2026
2.8.0 123 7/30/2026
2.7.2 120 7/28/2026
2.7.1 132 4/10/2026
2.7.0 142 3/12/2026
2.6.0 134 2/11/2026
2.5.0 182 1/22/2026
2.4.0 152 1/8/2026
2.3.0 334 11/12/2025
2.2.0 247 9/23/2025
2.1.0 245 6/23/2025
2.0.0 218 2/24/2025