CSharpDB.Execution 1.1.0

dotnet add package CSharpDB.Execution --version 1.1.0
                    
NuGet\Install-Package CSharpDB.Execution -Version 1.1.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="CSharpDB.Execution" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CSharpDB.Execution" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="CSharpDB.Execution" />
                    
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 CSharpDB.Execution --version 1.1.0
                    
#r "nuget: CSharpDB.Execution, 1.1.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 CSharpDB.Execution@1.1.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=CSharpDB.Execution&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=CSharpDB.Execution&version=1.1.0
                    
Install as a Cake Tool

CSharpDB.Execution

Query planner, operator tree, and expression evaluator for the CSharpDB embedded database engine.

NuGet License: MIT

Overview

CSharpDB.Execution transforms parsed SQL (AST from CSharpDB.Sql) into executable query plans. It implements the classic iterator model with physical operators for scans, joins, aggregation, sorting, filtering, and projection. Expression evaluation is handled by both an interpreter (for one-off use) and a compiler (for hot-path evaluation with column binding at compile time).

Key Components

Query Planner

  • Translates AST statements into physical operator trees
  • Dispatches to type-specific handlers for all DDL and DML statements
  • System catalog virtual tables: system_tables, system_columns, system_indexes, system_views, system_triggers
  • Compiled expression cache (up to 4096 entries) for repeated queries
  • Trigger body caching with schema-sensitive invalidation
  • Sync point-lookup fast path for SELECT ... WHERE pk = value

Operator Tree (Iterator Model)

  • IOperator interface: OpenAsync, MoveNextAsync, Current, OutputSchema
  • TableScanOperator with pre-decode filtering, projection pushdown, and row count estimation
  • Join operators, filter, sort, aggregate, limit/offset, projection, and more
  • Internal optimization interfaces: IPreDecodeFilterSupport, IProjectionPushdownTarget, IMaterializedRowsProvider

Expression Evaluation

  • ExpressionEvaluator - Static interpreter for simple/infrequent evaluations
  • ExpressionCompiler - Compiles expression ASTs into Func<DbValue[], DbValue> delegates with column indices bound at compile time, eliminating per-row schema lookups

Query Result

  • Wraps operator output (SELECT) or rows-affected counts (DML/DDL)
  • Sync fast-path for point lookups via FromSyncLookup
  • ToListAsync for materializing full result sets

Usage

using CSharpDB.Execution;
using CSharpDB.Sql;

// Parse SQL
var statements = Parser.Parse("SELECT name, age FROM users WHERE age > 21");

// Plan and execute (typically called through CSharpDB.Engine)
var planner = new QueryPlanner(storageContext);
var result = await planner.ExecuteAsync(statements[0]);

// Iterate results
while (await result.MoveNextAsync())
{
    DbValue[] row = result.Current;
    Console.WriteLine($"{row[0].AsText}, {row[1].AsInteger}");
}

Installation

dotnet add package CSharpDB.Execution

Dependencies

  • CSharpDB.Core - shared type system
  • CSharpDB.Sql - SQL parser and AST
  • CSharpDB.Storage - B+tree storage engine
Package Description
CSharpDB.Engine Embedded database engine that wraps this execution layer
CSharpDB.Sql SQL parser producing the AST this package consumes
CSharpDB.Storage Storage layer for physical I/O

License

MIT - see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET 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 (1)

Showing the top 1 NuGet packages that depend on CSharpDB.Execution:

Package Downloads
CSharpDB.Engine

Lightweight embedded SQL database engine for .NET. Single-file storage, WAL durability, concurrent readers, and a typed Collection<T> NoSQL API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 38 3/4/2026
1.0.0 82 3/1/2026