SharpCoreDB.Functional.Linq2DB
2.0.0-preview.2
See the version list below for details.
dotnet add package SharpCoreDB.Functional.Linq2DB --version 2.0.0-preview.2
NuGet\Install-Package SharpCoreDB.Functional.Linq2DB -Version 2.0.0-preview.2
<PackageReference Include="SharpCoreDB.Functional.Linq2DB" Version="2.0.0-preview.2" />
<PackageVersion Include="SharpCoreDB.Functional.Linq2DB" Version="2.0.0-preview.2" />
<PackageReference Include="SharpCoreDB.Functional.Linq2DB" />
paket add SharpCoreDB.Functional.Linq2DB --version 2.0.0-preview.2
#r "nuget: SharpCoreDB.Functional.Linq2DB, 2.0.0-preview.2"
#:package SharpCoreDB.Functional.Linq2DB@2.0.0-preview.2
#addin nuget:?package=SharpCoreDB.Functional.Linq2DB&version=2.0.0-preview.2&prerelease
#tool nuget:?package=SharpCoreDB.Functional.Linq2DB&version=2.0.0-preview.2&prerelease
SharpCoreDB.Functional.Linq2DB
linq2db adapter for SharpCoreDB.Functional.
Version: v1.9.5 (production-ready)
Package: SharpCoreDB.Functional.Linq2DB
Overview
SharpCoreDB.Functional.Linq2DB is the production-ready linq2db adapter for SharpCoreDB's functional stack. It delivers compile-time type safety, expressive LINQ, zero change-tracking overhead, and railway-oriented return types (Option<T>, Fin<T>, Seq<T>).
Perfect for:
- ✅ High-throughput AI/agentic workflows and GraphRAG
- ✅ Compile-time safe queries with full IntelliSense
- ✅ Low memory/CPU overhead (no EF-style tracking)
- ✅ Bulk operations via
BulkCopyAsync - ✅ Native AOT and .NET 10/C# 14
- ✅ Railway-oriented error handling (
Fin<T>)
Installation
dotnet add package SharpCoreDB.Functional.Linq2DB --version 2.0.0
Quick Start (Production)
1. Basic LINQ (raw linq2db)
using SharpCoreDB.Functional.Linq2DB;
using LinqToDB;
var conn = new SharpCoreDBDataConnection("Data Source=./app.scdb");
var users = await conn.GetTable<User>()
.Where(u => u.IsActive)
.OrderBy(u => u.Email)
.ToListAsync();
2. Functional API (recommended — Option/Fin/Seq)
var db = new FunctionalLinq2DbContext(conn);
// Option<T> for safe lookups
var user = await db.FindOneAsync<User>(u => u.Email == "test@example.com");
// Seq<T> for collections
var activeUsers = await db.QueryAsync<User>(u => u.IsActive);
// Fin<T> for mutations (railway-oriented)
var insertResult = await db.InsertBatchAsync(new[] { user1, user2 }); // uses BulkCopyAsync internally
insertResult.IfSucc(count => Console.WriteLine($"Inserted {count} rows"))
.IfFail(err => Console.WriteLine($"Error: {err.Message}"));
Connection note: Use "Data Source=..." for full linq2db/SQLite compatibility. SharpCoreDB "Path=..." works via the core provider but may require the underlying ADO.NET path for DDL.
Key Production Features
- BulkCopy support in
InsertBatchAsyncfor high-speed ingestion (GraphRAG, analytics) - Full type mapping (ULID as string, GUID as compact string, DateTime ISO, bool→int for SQLite compat)
- Transaction support with
TransactionAsync<TResult> - DeleteWhereAsync,
CountAsync,ExistsAsync,GetAllAsync - Seamless with SharpCoreDB.Functional (
Prelude,Option,Fin,Seq,Error) - Works alongside
SharpCoreDB.Functional.Dapperand EF Core functional wrapper
Documentation & Links
- Full API in
FunctionalLinq2DbContext.csandExtensions.cs - Test coverage:
tests/SharpCoreDB.Functional.Linq2DB.Tests/ - See also:
docs/FEATURE_MATRIX.md,docs/functional/OPTIONALLY_SQL_OPTION_SUPPORT_v1.7.2.md,docs/graphrag/LINQ_API_GUIDE.md - 🔗 SharpCoreDB GitHub
License: MIT
| Product | Versions 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. |
-
net10.0
- linq2db (>= 6.4.0)
- Microsoft.Data.Sqlite (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.ObjectPool (>= 10.0.11)
- SharpCoreDB.Data.Provider (>= 2.0.0-preview.2)
- SharpCoreDB.Functional (>= 2.0.0-preview.2)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 3.0.5)
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 |
|---|---|---|
| 2.0.0-preview.3 | 39 | 8/30/2026 |
| 2.0.0-preview.2 | 41 | 8/30/2026 |
| 2.0.0-preview.1 | 34 | 8/29/2026 |
| 1.9.9 | 33 | 8/30/2026 |
| 1.9.8 | 40 | 8/29/2026 |
| 1.9.3 | 111 | 7/29/2026 |
v1.9.6: Fixes the critical WHERE IN (...) regression (#339) that silently returned ALL rows: IN / NOT IN are now evaluated correctly for literal and parameterized lists across single-file and directory mode, and single-file parameterized queries normalize @-prefixed parameter names. Includes all v1.9.5 fixes (token-aware parameter binding resolving @t/@tid collisions, server parameter pass-through, standards-compliant ULID encoding, legacy UI removal, English-only documentation, updated dependencies).