Koan.Data.Relational 0.5.2

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

Koan.Data.Relational

Adapter-agnostic relational schema + LINQ translator used by providers like Koan.Data.Sqlite and Koan.Data.SqlServer.

  • Contracts: IRelationalDialect, IRelationalSchemaModel, IRelationalSchemaSynchronizer
  • LINQ translator hooks: ILinqSqlDialect, LinqWhereTranslator<TEntity>, RelationalCommandCache

Capabilities

  • Build table/index models from entity annotations
  • Add-only schema synchronization (create table/index)
  • Minimal LINQ-to-SQL pushdown for simple predicates and projections

LINQ (minimal translator)

An intentionally small LINQ-to-SQL helper lives in Linq/:

  • ILinqSqlDialect: tiny hooks the translator needs (identifier quoting, LIKE escaping, parameter naming).
  • LinqWhereTranslator<TEntity>: translates a restricted subset of predicate expressions to a WHERE clause and parameters.
  • RelationalCommandCache: caches select lists per (entity, dialect) to avoid repeated string building.

Providers can implement ILinqSqlDialect (in addition to schema IRelationalDialect) to enable pushdown. Unsupported expressions should throw NotSupportedException; callers should fallback to in-memory filtering.

  • Builder: RelationalModelBuilder.FromEntity(typeof(TEntity)) builds a table model from annotations
  • Synchronizer: EnsureCreated(dialect, model, connection) emits CREATE TABLE + INDEX statements (add-only)

Notes:

  • Provider-specific SQL grammar belongs in the provider (e.g., SqliteDialect in Koan.Data.Sqlite).
  • Complex CLR types map to JSON-encoded TEXT columns; simple types map to native types.

References

  • Data access reference: ~/reference/data-access.md
  • Decision DATA-0061: ~/decisions/DATA-0061-data-access-pagination-and-streaming.md
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 (3)

Showing the top 3 NuGet packages that depend on Koan.Data.Relational:

Package Downloads
Koan.Data.Sqlite

SQLite provider for Koan relational data: lightweight local development and testing support.

Koan.Data.Postgres

PostgreSQL provider for Koan relational data: Dapper-based SQL integration with guardrails and governance.

Koan.Data.SqlServer

SQL Server provider for Koan relational data with JSON-projection pushdowns, guardrails, and governance.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.2 290 9/16/2025