Rask.SQLite.EntityFrameworkCore
0.20.1-alpha.0.207
See the version list below for details.
dotnet add package Rask.SQLite.EntityFrameworkCore --version 0.20.1-alpha.0.207
NuGet\Install-Package Rask.SQLite.EntityFrameworkCore -Version 0.20.1-alpha.0.207
<PackageReference Include="Rask.SQLite.EntityFrameworkCore" Version="0.20.1-alpha.0.207" />
<PackageVersion Include="Rask.SQLite.EntityFrameworkCore" Version="0.20.1-alpha.0.207" />
<PackageReference Include="Rask.SQLite.EntityFrameworkCore" />
paket add Rask.SQLite.EntityFrameworkCore --version 0.20.1-alpha.0.207
#r "nuget: Rask.SQLite.EntityFrameworkCore, 0.20.1-alpha.0.207"
#:package Rask.SQLite.EntityFrameworkCore@0.20.1-alpha.0.207
#addin nuget:?package=Rask.SQLite.EntityFrameworkCore&version=0.20.1-alpha.0.207&prerelease
#tool nuget:?package=Rask.SQLite.EntityFrameworkCore&version=0.20.1-alpha.0.207&prerelease
Rask.SQLite.EntityFrameworkCore
The Entity Framework Core integration for Rask.SQLite.
UseRaskSqlite(...) is a drop-in replacement for UseSqlite that also wires a ConnectionOpened
interceptor applying the production pragma set — WAL, synchronous=NORMAL,
foreign_keys=ON, a busy_timeout, mmap_size, journal_size_limit — to every connection the context
opens.
It also makes decimal correct. EF Core stores one as invariant TEXT and sorts it with a collating
sequence it registers as decimal.Parse(x) — with no IFormatProvider, so it reads that invariant text
under the machine's CurrentCulture. On de-DE an ORDER BY silently mis-sorts ("19.95" parses as
1995); on en-HU it throws inside a native callback that cannot be unwound and takes the process
down. UseRaskSqlite re-registers the collation invariantly on every open, changing nothing in the
database file — no column type, no DDL, no migration.
Split out from Rask.SQLite so apps that only use the raw Microsoft.Data.Sqlite path (or run on
mobile / under AOT, where you don't want EF Core) can stay lean.
Install
dotnet add package Rask.SQLite.EntityFrameworkCore
Use
builder.Services.AddDbContextFactory<AppDb>(o =>
o.UseRaskSqlite($"Data Source={dbPath}"));
Override any pragma via the optional configure delegate:
o.UseRaskSqlite($"Data Source={dbPath}", p =>
{
p.BusyTimeout = TimeSpan.FromSeconds(10);
p.CacheSize = -20_000; // negative ⇒ KiB, so 20 MB
});
STRICT tables
SQLite is dynamically typed: the text "lots" stores happily in an INTEGER column and surfaces as a
cast error much later. Pass o => o.StrictTables = true and tables are created as
STRICT tables, so the store rejects the write instead:
o.UseRaskSqlite($"Data Source={dbPath}", o => o.StrictTables = true);
Every column must then declare one of INT, INTEGER, REAL, TEXT, BLOB or ANY — EF Core's
defaults all qualify, so a normal model needs no changes, and an explicit HasColumnType(...) outside
that set is reported against the table and column it came from. Strictness is decided when a table is
created, so this needs no migration and affects tables created from then on; rask new --data
scaffolds it on, where it is free.
Busy-retry for SaveChanges
Pass configureRetry (even empty) to register a fair-interval execution strategy so
SaveChanges/queries retry on SQLITE_BUSY/SQLITE_LOCKED at a constant 1 ms interval, awaiting
(not blocking) between attempts:
o.UseRaskSqlite($"Data Source={dbPath}", o => o.Retry.Enabled = true);
The truly non-blocking, BEGIN IMMEDIATE write path lives in Rask.SQLite
(InImmediateTransactionAsync); see the docs for when to reach for it.
Non-overlapping ranges
UseRaskSqlite also enforces Rask.Data's HasNonOverlappingRange(...): migrations emit an index plus a
BEFORE INSERT/BEFORE UPDATE trigger pair, re-emitted after the table rebuilds SQLite needs for most
ALTERs (which would otherwise drop them). A violating save throws RangeOverlapException naming the
table. Both are inert until an entity declares a rule.
Not using EF Core? Use Rask.SQLite directly: services.AddRaskSqlite(cs) + inject
ISqlite.
Full documentation: https://github.com/pal-tamas/rask/blob/main/docs/sqlite.md
| 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
- Microsoft.EntityFrameworkCore.Sqlite (>= 10.0.11)
- Rask.Data (>= 0.20.1-alpha.0.207)
- Rask.SQLite (>= 0.20.1-alpha.0.207)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 3.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rask.SQLite.EntityFrameworkCore:
| Package | Downloads |
|---|---|
|
Rask
The one reference a Rask application needs, server or browser. On net10.0 it brings the ASP.NET host plus every battery — database, mediator, background jobs, transactional email, cache, outbox, operator dashboard, durable logs, Web Push, and SQLite snapshots and continuous backup — with RaskApp.Create(args) as the entry point. On net10.0-browser it brings the WebAssembly host, the source-generated mediator, the query cache and remote dispatch. Everything referenced is wired and on; app.Configure(c => c.Jobs.Off()) is how an app does without one. Reference Rask.Server for a lean host with no database. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.20.1-alpha.0.228 | 30 | 9/4/2026 |
| 0.20.1-alpha.0.227 | 27 | 9/4/2026 |
| 0.20.1-alpha.0.226 | 34 | 9/4/2026 |
| 0.20.1-alpha.0.225 | 34 | 9/4/2026 |
| 0.20.1-alpha.0.224 | 37 | 9/4/2026 |
| 0.20.1-alpha.0.223 | 35 | 9/4/2026 |
| 0.20.1-alpha.0.221 | 33 | 9/4/2026 |
| 0.20.1-alpha.0.220 | 37 | 9/4/2026 |
| 0.20.1-alpha.0.217 | 30 | 9/4/2026 |
| 0.20.1-alpha.0.216 | 32 | 9/4/2026 |
| 0.20.1-alpha.0.215 | 35 | 9/3/2026 |
| 0.20.1-alpha.0.213 | 34 | 9/3/2026 |
| 0.20.1-alpha.0.212 | 32 | 9/3/2026 |
| 0.20.1-alpha.0.211 | 45 | 9/3/2026 |
| 0.20.1-alpha.0.210 | 38 | 9/3/2026 |
| 0.20.1-alpha.0.209 | 36 | 9/2/2026 |
| 0.20.1-alpha.0.208 | 36 | 9/2/2026 |
| 0.20.1-alpha.0.207 | 38 | 9/2/2026 |
| 0.20.1-alpha.0.206 | 36 | 9/2/2026 |
| 0.20.0 | 328 | 8/6/2026 |