Nimblesite.Lql.Postgres 0.9.11-beta

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

DataProvider Suite

DataProvider is a complete toolkit for .NET database access that prioritises type safety. It provides CLI-driven source generation for SQL extension methods, a cross-database query language (LQL), offline-first bidirectional sync, and YAML schema migrations.

Philosophy

DataProvider fixes issues that have plagued .NET data access for decades.

The simplicity and safety of an ORM without the downsides. DataProvider generates extension methods directly from your SQL or LQL files. You write the queries. You see what executes. SQL errors become compilation errors. No magic, no reflection.

Errors you can see. Database operations fail. Networks drop. Constraints get violated. These are expected, not exceptional. DataProvider makes error handling explicit so failures surface in your types rather than hiding in catch blocks. The default output shape is fully customisable — swap the code template to fit your project's conventions.

SQL is the source of truth. Define schemas in YAML, write queries in SQL or LQL, and generate strongly-typed code from both.

Sync-native. Run occasionally connected apps or synchronise data across microservices. Conflict resolution, tombstones, and subscriptions included.

The Stack

Component Purpose
DataProvider CLI source generator: SQL/LQL files become type-safe extension methods
LQL Lambda Query Language: write once, transpile to any SQL dialect
Migrations YAML schemas: database-agnostic, version-controlled schema definitions
Sync Offline-first: bidirectional synchronisation with conflict resolution

Each component works independently or together. Use what you need.

Installation

DataProvider ships in two halves — three CLI tools that generate code at build time, and runtime library packages that your app references.

# 1. CLI tools (pinned in .config/dotnet-tools.json)
dotnet new tool-manifest
dotnet tool install DataProvider --version ${DATAPROVIDER_VERSION}
dotnet tool install DataProviderMigrate --version ${DATAPROVIDERMIGRATE_VERSION}
dotnet tool install Lql --version ${LQL_VERSION}

# 2. Runtime packages (pick your database)
dotnet add package Nimblesite.DataProvider.SQLite --version ${NIMBLESITE_VERSION}
# or: Nimblesite.DataProvider.Postgres / Nimblesite.DataProvider.SqlServer

See the installation guide for the full package list, including Nimblesite.Lql.*, Nimblesite.Sync.*, and Nimblesite.Reporting.Engine.

Quick Example

alt text

Write an LQL query in GetActiveCustomers.lql:

Customer
|> filter(fn(row) => Customer.IsActive = true)
|> join(Address, on = Customer.Id = Address.CustomerId)
|> select(Customer.Id, Customer.Name, Address.City)
|> limit(100)

Run the CLI tools (typically wired into MSBuild targets):

dotnet Lql sqlite --input GetActiveCustomers.lql --output GetActiveCustomers.generated.sql
dotnet DataProvider sqlite --project-dir . --config DataProvider.json --out ./Generated

Call the generated extension method with exhaustive error handling:

var result = await connection.GetActiveCustomersAsync();

var message = result switch
{
    Result<IReadOnlyList<GetActiveCustomersRow>, SqlError>.Ok ok =>
        $"Found {ok.Value.Count} customers",
    Result<IReadOnlyList<GetActiveCustomersRow>, SqlError>.Error err =>
        $"Failed: {err.Value.Message}"
};

The shape above is the default emitted template. Want Task<T>, a thrown exception, an Option<T>, or your own custom signature? Plug in a custom code template — see the DataProvider docs.

Reference Implementation

The Nimblesite Clinical Coding Platform is the canonical reference implementation — a full-stack healthcare app built on .NET 10, PostgreSQL + pgvector, FHIR R5, and every component of this toolkit. Not for production; technology demonstration only.

Prerequisites

  • .NET 10 SDK
  • A database (SQLite, PostgreSQL, or SQL Server)

Build from Source

git clone https://github.com/Nimblesite/DataProvider.git
cd DataProvider
make ci            # lint + test + build

Performance

  • Zero runtime overhead — generated code is pure ADO.NET
  • AOT compatible — full ahead-of-time compilation support
  • No reflection — all code generated at compile time
  • Minimal allocations — optimised for low memory usage

Contributing

See CLAUDE.md for code style, architecture rules, and testing requirements. Log an issue or start a discussion before submitting non-trivial PRs.

License

MIT © 2026 Nimblesite Pty Ltd. See LICENSE.

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

Showing the top 2 NuGet packages that depend on Nimblesite.Lql.Postgres:

Package Downloads
Nimblesite.DataProvider.Migration.Core

YAML-based database schema migration library

Nimblesite.Reporting.Engine

Embeddable reporting engine for Nimblesite.DataProvider.Core: JSON-defined report configs, SQL/LQL data source execution, and CSV/JSON format adapters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.12-beta 106 5/11/2026
0.9.11-beta 186 5/10/2026
0.9.10-beta 107 5/6/2026
0.9.9-beta 73 5/6/2026
0.9.8-beta 87 5/5/2026
0.9.7-beta 83 5/5/2026
0.9.6-beta 110 4/9/2026
0.9.5-beta 59 4/9/2026
0.9.4-beta 52 4/9/2026
0.9.3-beta 53 4/9/2026
0.9.2-beta 53 4/9/2026
0.9.1-beta 54 4/9/2026
0.9.0-beta 52 4/9/2026
0.8.0-beta 61 4/9/2026
0.7.0-beta 58 4/9/2026
0.4.0-beta 65 4/8/2026
0.3.0-beta 53 4/7/2026
0.2.0-beta 56 4/7/2026