Skip to main content
net10.0

Durable embedded SQLite provider for Koan Entity data with zero-config local storage, schema management, queries, and bounded paging.

Published
Jul 21, 2026
3mo ago
Total Downloads
4.1K
4,143

Install

dotnet add package Sylin.Koan.Data.Connector.Sqlite --version 0.20.4
ProductVersions
.NET
net10.0

README

Sylin.Koan.Data.Connector.Sqlite

SQLite provider for Koan relational data—suited to local development, tests, and single-node applications.

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

Capabilities

  • Zero-config file database at .koan/data/Koan.sqlite
  • Basic LINQ predicate pushdown via Koan.Data.Relational translator
  • Schema helpers (create table/index) via Koan.Data.Relational
  • Provider-bounded Entity streams through DataCaps.Query.ProviderBoundedPaging

Install

0.20 preview: SQLite belongs to the supported foundation. Public-feed publication follows the final package-only proof; until then, use the source checkout or the exact staged candidate feed.

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

Minimal setup

Reference the package and keep the application's normal services.AddKoan() bootstrap. No provider registration, schema scaffold, environment label, or configuration is required. The default AutoCreate policy creates the embedded store on first use even under the .NET Generic Host's standard Production environment. Choose Validate or NoDdl when schema is provisioned externally. Configure a source only when the default target is not appropriate:

{
  "Koan": {
    "Data": {
      "Sources": {
        "Default": {
          "Adapter": "sqlite",
          "ConnectionString": "Data Source=./data/app.db"
        }
      }
    }
  }
}

Use a Data Source=... connection string for a durable file. Data Source=:memory: and explicit Mode=Memory targets create private, source-isolated databases that survive per-operation connections for one Koan host and disappear when that host is disposed.

Usage - safe snippets

  • Prefer first-class model statics:
    • Todo.FirstPage(100, ct) then Todo.Page(2, 100, ct)
    • await foreach (var t in Todo.QueryStream(x => x.Done == false, ct)) { ... }
// Materialize a small filtered set
var open = await Todo.Query(x => !x.Done, ct);

// Stream when the set may be large
await foreach (var t in Todo.QueryStream(x => !x.Done, ct))
{
    // process
}

Streaming boundary

AllStream and QueryStream request one numbered SQLite 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 the technical reference for options and dialect notes.

References

Changes from Previous Version

v0.17.0v0.20.4
Added Dependencies
Removed Dependencies
Dapper(net10.0)

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.