Sora.Data.Relational 0.4.0

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

Sora.Data.Relational

Adapter-agnostic relational schema + LINQ translator used by providers like Sora.Data.Sqlite and Sora.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 Sora.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 Sora.Data.Relational:

Package Downloads
Sora.Data.Sqlite

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

Sora.Data.SqlServer

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

Sora.Data.Postgres

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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.0 81 9/5/2025
0.2.20 77 8/22/2025
0.2.18 127 8/20/2025
0.2.17 130 8/19/2025
0.2.16 125 8/18/2025