CH.Toolkit.Sql
0.0.1-preview.3
dotnet add package CH.Toolkit.Sql --version 0.0.1-preview.3
NuGet\Install-Package CH.Toolkit.Sql -Version 0.0.1-preview.3
<PackageReference Include="CH.Toolkit.Sql" Version="0.0.1-preview.3" />
<PackageVersion Include="CH.Toolkit.Sql" Version="0.0.1-preview.3" />
<PackageReference Include="CH.Toolkit.Sql" />
paket add CH.Toolkit.Sql --version 0.0.1-preview.3
#r "nuget: CH.Toolkit.Sql, 0.0.1-preview.3"
#:package CH.Toolkit.Sql@0.0.1-preview.3
#addin nuget:?package=CH.Toolkit.Sql&version=0.0.1-preview.3&prerelease
#tool nuget:?package=CH.Toolkit.Sql&version=0.0.1-preview.3&prerelease
CH.Toolkit.Sql
SQL abstract syntax tree (AST) and ClickHouse-specific SQL renderer using the visitor pattern.
Key Types
SqlNode-- abstract base record for all AST nodes- DDL nodes:
CreateTableNode,AlterTableNode,DropTableNode,CreateMaterializedViewNode,CreateDictionaryNode - DML nodes:
SelectQueryNode,SetOperationQueryNode,InsertSelectNode,RawSqlNode - Expressions:
ColumnRefNode,LiteralNode,FunctionCallNode,BinaryOpNode,CaseNode,CastNode,WindowFunctionNode,ParameterNode,LambdaNode - Supporting:
ColumnDefNode,EngineClause,SkippingIndexDef,ProjectionDef,AlterAction(and subclasses) SqlVisitor<TResult>-- abstract visitor base class for traversing the ASTClickHouseSqlRenderer-- the main visitor implementation; rendersSqlNodetrees into ClickHouse SQL strings
Dependencies
CH.Toolkit.Types
Usage
using CH.Toolkit.Sql;
using CH.Toolkit.Types;
// Build an AST node
var createTable = new CreateTableNode(
Database: "analytics",
Table: "events",
Columns: [new ColumnDefNode("timestamp", new ChDateTime())],
Engine: new EngineClause("MergeTree", OrderBy: ["timestamp"]));
// Render to SQL
var renderer = new ClickHouseSqlRenderer();
var sql = renderer.Render(createTable);
// CREATE TABLE IF NOT EXISTS `analytics`.`events` ...
See the root README for full project documentation.
| Product | Versions 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 was computed. 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. |
-
net10.0
- CH.Toolkit.Types (>= 0.0.1-preview.3)
-
net8.0
- CH.Toolkit.Types (>= 0.0.1-preview.3)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on CH.Toolkit.Sql:
| Package | Downloads |
|---|---|
|
CH.Toolkit.Query
LINQ query provider and fluent query builder for ClickHouse. Supports PREWHERE, FINAL, SAMPLE, LIMIT BY, CTEs, joins, and ClickHouse-specific functions. |
|
|
CH.Toolkit.Schema
ClickHouse schema model and DDL compiler. Defines table, column, engine, materialized view, and dictionary schemas with compilation to SQL. |
|
|
CH.Toolkit.Introspection
Schema introspection for ClickHouse. Reads tables, columns, engines, indexes, projections, materialized views, and dictionaries from ClickHouse system tables. |
|
|
CH.Toolkit
ClickHouse schema modeling, migrations, and query building for .NET. Meta-package that includes Types, Sql, Schema, Modeling, Query, Introspection, and Migrations. |
|
|
CH.Toolkit.Migrations
ClickHouse migration system with schema diffing, C# code generation, and a migration runner with distributed locking, checksum validation, and safety policies. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1-preview.3 | 57 | 2/23/2026 |
| 0.0.1-preview.2 | 46 | 2/23/2026 |
| 0.0.1-preview.1 | 57 | 2/23/2026 |