Craticula.Sql 1.3.0

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

Craticula.Sql

The SQL compiler of Craticula. It turns the canonical IR into a parameterized statement ({ sql, params[] }) for PostgreSQL, SQL Server, MySQL/MariaDB, SQLite and Oracle. Values are always bound as parameters and identifiers come only from your GridSchema allowlist. It compiles; it never opens a connection (use Craticula.Dapper or Craticula.EntityFrameworkCore to run it).

Install

dotnet add package Craticula.Sql

Example

using Craticula.Core.Ir;
using Craticula.Core.Schema;
using Craticula.Sql;

public static class Example
{
    public static SqlQuery Compile(GridSchema schema, FilterNode? filter, IReadOnlyList<SortItem>? sort, PageSpec page)
    {
        SqlQuery query = SqlQueryBuilder.Build(
            new SqlQueryRequest { Schema = schema, Filter = filter, Sort = sort, Page = page },
            PostgresDialect.Instance);

        // query.Sql is the statement text, query.Parameters the values to bind in order.
        return query;
    }
}

Dialects: PostgresDialect, MssqlDialect, MySqlDialect, SqliteDialect, OracleDialect.

Counting rows

SqlQueryBuilder.BuildCount compiles the total a grid shows next to a page: the same filter, but no sort and no row window, so the database does not order rows it only counts. Pass GridFilterPipeline.Process a NonePage for a count, so the page-size limit does not apply to it. A grouped level counts its groups. At a million rows this made the PostgreSQL count 3.6 to 5.5 times faster for filters that match many rows.

Compatibility

Implements Craticula spec version 0.3.0 (the language-neutral semantics and conformance fixtures in the repository, spec/). Targets .NET 10.

License

Apache-2.0. Source and issues: https://github.com/pluries/craticula.

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 Craticula.Sql:

Package Downloads
Craticula.Dapper

Craticula execution adapter for Dapper: compiles the IR to parameterized SQL and runs it, with paging, counts and streamed export.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 87 11/26/2026
1.2.1 117 11/15/2026
1.2.0 156 11/12/2026
1.1.0 110 11/12/2026
1.0.0 113 11/10/2026