Sylin.Koan.Data.Connector.Postgres 0.21.0

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

Sylin.Koan.Data.Connector.Postgres

PostgreSQL provider for Koan managed entities and existing relational data.

  • Target framework: net10.0
  • License: Apache-2.0

Capabilities

  • Connection + health checks with minimal options
  • JSON projection, filter, and paging pushdowns where supported
  • Schema helpers (create table/index) via Koan.Data.Relational
  • Provider-bounded Entity streams through DataCaps.Query.ProviderBoundedPaging
  • Compact flat, structured, nested-path, composite-key, and generated-key maps
  • Read-only fail-fast safety and non-creating StorageLifecycle.External
  • Provider-neutral container inspection and bounded record sampling
  • Registered parameterized SQL reads and scalars through provider-enforced read lanes

Install

The generated product surface owns support maturity. This page owns PostgreSQL behavior and limits; they do not imply parity with every relational backend.

dotnet add package Sylin.Koan.Data.Connector.Postgres

Minimal setup

  • Keep the application's ordinary services.AddKoan() bootstrap.
  • For autonomous local discovery, run a reachable PostgreSQL service and omit explicit configuration.
  • Otherwise set ConnectionStrings:Postgres or Koan:Data:Postgres:ConnectionString; keep secrets outside source control.
builder.Services.AddKoan();

public sealed class Order : Entity<Order>;

var saved = await new Order().Save();
var same = await Order.Get(saved.Id);

Connect an existing table without introducing a parallel data API:

builder.Services.AddKoan(koan => koan.Data
    .Source("Legacy")
    .Map<Customer>(map => map
        .Container("CUSTOMER")
        .Key(customer => customer.Id).Name("CUSTOMER_NO")
        .Property(customer => customer.DisplayName).Name("DISPLAY_NM")
        .Property(customer => customer.Profile).Object("PROFILE_JSON")));

using (EntityContext.Source("Legacy"))
{
    var customer = await Customer.Get(7);
}

Set StorageLifecycle=External when Koan must validate but never create or repair the table. Set Access=ReadOnly when writes must reject before provider mutation. Nested .Path("NAME_DATA", "full") updates preserve unbound values inside the same jsonb object.

Explore or name a useful read without adding a second data API:

koan.Data.Source("Legacy").Query("customers.active", query => query
    .Lane("Reports")
    .Sql("select id as Id, name as Name from customers where active = @active")
    .Parameter<bool>("active"));

var legacy = Data.Source("Legacy");
var active = await legacy.Query("customers.active", new { active = true });
var containers = await legacy.Inspect().Containers(100, null, ct);

Opaque SQL requires a configured read lane. PostgreSQL executes it in a native read-only transaction.

Usage - safe snippets

  • Use first-class model statics from your entities:
    • Order.FirstPage(50, ct) / Order.Page(2, 50, ct)
    • Order.Query(o => o.CustomerId == id, ct)
    • await foreach (var o in Order.QueryStream(o => o.Total > 100, ct)) { ... }
// Stream a filtered set through consumer-paced provider pages
await foreach (var o in Order.QueryStream(o => o.IsActive, ct))
{
    // process
}

Streaming boundary

AllStream and QueryStream request one numbered PostgreSQL page at a time. batchSize caps the Koan-visible candidate page; it does not claim a bound for opaque provider-driver buffers. Streaming accepts only DATA-0107's first proved user-sort floor: top-level, non-nullable bool, byte, sbyte, short, ushort, or int. Other user sorts reject before provider I/O. Data.Core separately appends the usual string Entity identifier as an opaque provider-stable tie-break, not a cross-provider collation promise.

These streams do not provide snapshot consistency, mutation-safe traversal, resumability, or a public cursor. Concurrent writes can therefore cause skips or duplicates during offset-based traversal.

See TECHNICAL.md for options and pushdown coverage.

References

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

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.21.0 38 7/30/2026
0.20.4 101 7/23/2026
0.20.2 92 7/22/2026
0.20.1 147 7/22/2026
0.17.0 108 6/12/2026
0.8.0 103 5/16/2026