CH.Toolkit.Query 0.0.1-preview.3

This is a prerelease version of CH.Toolkit.Query.
dotnet add package CH.Toolkit.Query --version 0.0.1-preview.3
                    
NuGet\Install-Package CH.Toolkit.Query -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.Query" 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.Query" Version="0.0.1-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="CH.Toolkit.Query" />
                    
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.Query --version 0.0.1-preview.3
                    
#r "nuget: CH.Toolkit.Query, 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.Query@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.Query&version=0.0.1-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CH.Toolkit.Query&version=0.0.1-preview.3&prerelease
                    
Install as a Cake Tool

CH.Toolkit.Query

LINQ-style and fluent query builders for ClickHouse with full support for ClickHouse-specific SQL features.

Key Types

  • Query -- static entry point: Query.From<T>() creates a typed IClickHouseQueryable<T>
  • IClickHouseQueryable<T> -- extends IOrderedQueryable<T> with ToSql()
  • ClickHouseQueryExtensions -- ClickHouse-specific LINQ operators (Prewhere, Final, Sample, LimitBy, ArrayJoin, WithTotals, Setting, DistinctOn)
  • FluentQueryBuilder -- string-based fluent builder with From(), Select(), Where(), joins, CTEs, set operations, and ToSql()
  • Ch -- function stubs for ClickHouse functions usable in LINQ expressions (aggregates, date/time, hashing, window functions, dictionary lookups, raw SQL)
  • ChWindow -- extension methods for window function OVER clauses in LINQ expressions

Dependencies

Sql, Types

Usage (LINQ)

using CH.Toolkit.Query;

string sql = Query.From<Event>("analytics", "event")
    .Where(e => e.Timestamp > DateTime.UtcNow.AddDays(-7))
    .OrderByDescending(e => e.Timestamp)
    .Select(e => new { e.UserId, e.EventType, e.Value })
    .Take(100)
    .ToSql();

Usage (Fluent)

string sql = FluentQueryBuilder
    .From("analytics", "event")
    .Select("user_id", "count() AS cnt")
    .Prewhere("timestamp > now() - INTERVAL 7 DAY")
    .GroupBy("user_id")
    .OrderByDesc("cnt")
    .Limit(100)
    .ToSql();

See the root README for full 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 (3)

Showing the top 3 NuGet packages that depend on CH.Toolkit.Query:

Package Downloads
CH.Toolkit.Data

ClickHouse data context for executing queries and bulk inserts. Bridges CH.Toolkit.Query (SQL generation) with ClickHouse.Driver (ADO.NET execution).

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.Modeling

Fluent SchemaBuilder API for defining ClickHouse schemas from C# POCOs. Supports all MergeTree engines, column overrides, materialized views, and dictionaries.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1-preview.3 55 2/23/2026
0.0.1-preview.2 44 2/23/2026
0.0.1-preview.1 53 2/23/2026