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
<PackageReference Include="Koan.Data.Relational" Version="0.5.2" />
<PackageVersion Include="Koan.Data.Relational" Version="0.5.2" />
<PackageReference Include="Koan.Data.Relational" />
paket add Koan.Data.Relational --version 0.5.2
#r "nuget: Koan.Data.Relational, 0.5.2"
#:package Koan.Data.Relational@0.5.2
#addin nuget:?package=Koan.Data.Relational&version=0.5.2
#tool nuget:?package=Koan.Data.Relational&version=0.5.2
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
inKoan.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 | Versions 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. |
-
net9.0
- Koan.Data.Abstractions (>= 0.5.2)
- Koan.Data.Core (>= 0.5.2)
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 |
See release notes: https://github.com/sylin-labs/Koan-framework/releases