Pure.RelationalSchema.Storage.PureQL.Projection 0.1.0-preview.4.0.0

This is a prerelease version of Pure.RelationalSchema.Storage.PureQL.Projection.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Pure.RelationalSchema.Storage.PureQL.Projection --version 0.1.0-preview.4.0.0
                    
NuGet\Install-Package Pure.RelationalSchema.Storage.PureQL.Projection -Version 0.1.0-preview.4.0.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="Pure.RelationalSchema.Storage.PureQL.Projection" Version="0.1.0-preview.4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pure.RelationalSchema.Storage.PureQL.Projection" Version="0.1.0-preview.4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Pure.RelationalSchema.Storage.PureQL.Projection" />
                    
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 Pure.RelationalSchema.Storage.PureQL.Projection --version 0.1.0-preview.4.0.0
                    
#r "nuget: Pure.RelationalSchema.Storage.PureQL.Projection, 0.1.0-preview.4.0.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 Pure.RelationalSchema.Storage.PureQL.Projection@0.1.0-preview.4.0.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=Pure.RelationalSchema.Storage.PureQL.Projection&version=0.1.0-preview.4.0.0&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Pure.RelationalSchema.Storage.PureQL.Projection&version=0.1.0-preview.4.0.0&prerelease
                    
Install as a Cake Tool

Pure.RelationalSchema.Storage.PureQL.Projection

Executes PureQL queries against in-memory relational schema datasets: a PureQLQuery from PureQL.CSharp.Model becomes an enumerable IStoredTableDataSet.

.NET build & test Build and Deploy NuGet License: MIT

Overview

Pure.RelationalSchema.Storage.PureQL.Projection is an interpreter for the PureQL specification 0.1.0-preview.2.0.1 over the Pure relational storage model. Given a collection of IStoredSchemaDataSet objects and a PureQLQuery, it produces an IStoredTableDataSet whose rows are the query's result under the specification's semantics.

Everything runs in memory: no SQL, no external engine.

Public API

PureQLProjection

The only public type. Implements IStoredTableDataSet, IAsyncEnumerable<IRow> and IQueryable<IRow>.

Member Description
PureQLProjection(IEnumerable<IStoredSchemaDataSet> datasets, PureQLQuery query) Validates the query against the datasets' schemas and builds the projection.
PureQLProjection(IEnumerable<IStoredSchemaDataSet> datasets, Query query) The same for a query without subqueries (the model's subquery type).
ITable TableSchema An unnamed table with one column per select item, named by its alias and typed by its declared type.
IEnumerator<IRow> GetEnumerator() Runs the query and enumerates the result rows. Every enumeration runs the query again.
IAsyncEnumerator<IRow> GetAsyncEnumerator(...) Async enumeration over the same rows.
Type ElementType / Expression / Provider IQueryable<IRow> plumbing for further LINQ composition.

What is supported

Every clause and operator of the specification: from and joins (inner, left, right, full, aliases and self-joins), where, groupBy over any row expression with keys referenced by alias, having, select, aggregate (total queries), orderBy over any expression, distinctBy, pagination, and subqueries read through from, join and in. All operators in the row, projection, group and total contexts are supported, including aggregates with predicate and over, and comparisons, min and max over every type.

A plain query returns one row per row left by where, a total query exactly one row (even over no rows) and a grouped query one row per group. distinctBy runs after orderBy and keeps, of the rows equal on the listed columns, the first in order.

The semantics are the specification's: null equals null and sorts first, ordering comparisons against null are false, lifted operators are null on a null operand, integer is a checked 64-bit integer, decimal is exact (System.Decimal), strings compare by code point, a datetime is an instant written in UTC, and seconds and time / datetime averages round half away from zero to the microsecond. Overflow, division by zero and dates outside the calendar fail the query with the corresponding .NET exception.

The checks the specification leaves to the interpreter run when the projection is built, and a failing query raises ArgumentException: entities, subqueries, sources and fields exist; each field declares its column's type and, after outer joins, its nullability; group key references name a key and repeat its type; source names, group key aliases, column aliases and subquery names are unique; distinctBy lists only column aliases; a subquery reads only subqueries declared before it.

Storage mapping

Column type PureQL type
long, int, uint, ulong, ushort integer
double, float decimal
string, bool, date, time, datetime, uuid string, boolean, date, time, datetime, uuid

Empty cell text is NULL. A stored datetime without an offset is read as UTC. Result columns are typed long for integer and double for decimal; result cells hold invariant text (True/False, yyyy-MM-dd, HH:mm:ss[.fffffff], yyyy-MM-ddTHH:mm:ss[.fffffff] in UTC, lower case uuids).

Not supported

  • Parameters. There is no API to bind parameter values, so evaluating a parameter (in an expression, a list or pagination) raises NotSupportedException.
  • Stored times and datetimes are read to the .NET tick (100 ns); the specification's values have microsecond precision, so finer stored digits are kept as read.

Dependencies

Target Frameworks

  • .NET 8
  • .NET 9
  • .NET 10

Installation

dotnet add package Pure.RelationalSchema.Storage.PureQL.Projection

Usage

// datasets: IEnumerable<IStoredSchemaDataSet> populated by your storage layer
// query:    a PureQLQuery, built directly or deserialized with
//           PureQL.CSharp.Model.Serialization

IStoredTableDataSet result = new PureQLProjection(datasets, query);

foreach (IRow row in result)
{
    // ...
}

await foreach (IRow row in result)
{
    // ...
}

A query selecting one field:

PureQLQuery query = new PureQLQuery(
    new MainPlainQuery(
        new From(new FromEntity("mySchema.myTable")),
        [
            new SelectItemProjection(
                new SelectItemProjectionNonNullable(
                    new SelectItemProjectionString(
                        "name",
                        new StringProjection(new FieldString("mySchema.myTable", "name"))
                    )
                )
            ),
        ]
    )
);

PureQL.CSharp.Model.Samples holds a query for every feature of the specification; this package's tests run all of them.

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 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.4.4.0 0 10/23/2026
0.1.0-preview.4.3.0 19 10/22/2026
0.1.0-preview.4.2.0 38 10/22/2026
0.1.0-preview.4.1.0 76 10/15/2026
0.1.0-preview.4.0.0 64 10/14/2026
0.1.0-preview.3.0.0 70 10/10/2026
0.1.0-preview.2.2.2 542 7/24/2026
0.1.0-preview.2.2.1 108 7/22/2026
0.1.0-preview.2.2.0 89 7/22/2026
0.1.0-preview.2.1.3 205 7/14/2026
0.1.0-preview.2.1.2 129 7/12/2026
0.1.0-preview.2.1.1 106 7/11/2026
0.1.0-preview.2.1.0 208 6/23/2026
0.1.0-preview.2.0.1 130 6/15/2026
0.1.0-preview.2.0.0 221 5/28/2026
0.1.0-preview.1.0.1 631 3/21/2026
0.1.0-preview.1.0.0 271 3/9/2026
0.1.0-preview.0.1.0 146 2/25/2026