CH.Toolkit.Sql 0.0.1-preview.3

This is a prerelease version of CH.Toolkit.Sql.
dotnet add package CH.Toolkit.Sql --version 0.0.1-preview.3
                    
NuGet\Install-Package CH.Toolkit.Sql -Version 0.0.1-preview.3
                    
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="CH.Toolkit.Sql" Version="0.0.1-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CH.Toolkit.Sql" Version="0.0.1-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="CH.Toolkit.Sql" />
                    
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 CH.Toolkit.Sql --version 0.0.1-preview.3
                    
#r "nuget: CH.Toolkit.Sql, 0.0.1-preview.3"
                    
#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 CH.Toolkit.Sql@0.0.1-preview.3
                    
#: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=CH.Toolkit.Sql&version=0.0.1-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CH.Toolkit.Sql&version=0.0.1-preview.3&prerelease
                    
Install as a Cake Tool

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 AST
  • ClickHouseSqlRenderer -- the main visitor implementation; renders SqlNode trees 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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