Rask.SQLite.Litestream
0.20.0
See the version list below for details.
dotnet add package Rask.SQLite.Litestream --version 0.20.0
NuGet\Install-Package Rask.SQLite.Litestream -Version 0.20.0
<PackageReference Include="Rask.SQLite.Litestream" Version="0.20.0" />
<PackageVersion Include="Rask.SQLite.Litestream" Version="0.20.0" />
<PackageReference Include="Rask.SQLite.Litestream" />
paket add Rask.SQLite.Litestream --version 0.20.0
#r "nuget: Rask.SQLite.Litestream, 0.20.0"
#:package Rask.SQLite.Litestream@0.20.0
#addin nuget:?package=Rask.SQLite.Litestream&version=0.20.0
#tool nuget:?package=Rask.SQLite.Litestream&version=0.20.0
Rask.SQLite.Litestream
Managed Litestream backup for SQLite, supervised from inside your app. Restores the database from its replica on startup (when the local file is missing) and continuously streams the write-ahead log to S3 / GCS / Azure Blob / file storage for the life of the process — all driven by a hosted background service, so there is no separate sidecar container to orchestrate.
Pairs with Rask.SQLite, whose WAL default is exactly
what Litestream requires. Standalone otherwise: it depends only on the Microsoft.Extensions
hosting/DI abstractions and CliWrap.
The
litestreambinary is downloaded at build time and dropped next to your app (SHA-256-verified, cached, tiny package) — nothing to install. Opt out with-p:RaskLitestreamDownload=falseand set your ownExecutablePath.
Install
dotnet add package Rask.SQLite.Litestream
Use
var dbPath = "/data/app.db"; // local disk — see the notes on network filesystems
builder.Services.AddRaskSqliteLitestream(o =>
{
o.DatabasePath = dbPath;
o.ReplicaUrl = "s3://my-bucket/app"; // or gcs://, abs:// (Azure Blob), file:///backups/app
// o.ExecutablePath = "/usr/local/bin/litestream"; // if it isn't on PATH
});
builder.Services.AddDbContextFactory<AppDb>(o => o.UseRaskSqlite($"Data Source={dbPath}"));
var app = builder.Build();
// Restore from the replica BEFORE opening the DB (no-op if the file already exists locally).
await app.Services.RestoreSqliteFromLitestreamAsync();
// ... EnsureCreated / migrate / seed, then app.Run();
Continuous replication then runs automatically as a hosted service until the app stops; on shutdown
it interrupts litestream and lets it flush (see ShutdownGracePeriod).
Notes
- Single writer only. Litestream assumes one process writes the database. Run a single instance — do not scale out — or the replica diverges.
- Local disk, not a network share. SQLite WAL needs real filesystem locking; keep the database on local/ephemeral disk and let Litestream replicate to durable storage. This is the pattern Litestream was built for (ephemeral container + object-storage backup).
- Resilient by design. A backup failure is logged at
Criticalbut never crashes the app. - Checkable. A log line tells you when replication broke; nothing tells you it's healthy. Resolve the
LitestreamStatussingleton forIsReplicating,LastStartedAt/LastExitedAt,RestartCount,LastExitCodeandLastError. A clean shutdown clearsIsReplicatingwithout counting a restart, so a climbingRestartCountmeans backups are flapping. - Advanced config. Point
ConfigPathat a fulllitestream.ymlfor multiple databases or custom retention / sync intervals.
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
- CliWrap (>= 3.10.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rask.SQLite.Litestream:
| 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 | 34 | 9/4/2026 |
| 0.20.1-alpha.0.227 | 29 | 9/4/2026 |
| 0.20.1-alpha.0.226 | 35 | 9/4/2026 |
| 0.20.1-alpha.0.225 | 36 | 9/4/2026 |
| 0.20.1-alpha.0.224 | 35 | 9/4/2026 |
| 0.20.1-alpha.0.223 | 37 | 9/4/2026 |
| 0.20.1-alpha.0.221 | 36 | 9/4/2026 |
| 0.20.1-alpha.0.220 | 36 | 9/4/2026 |
| 0.20.1-alpha.0.217 | 34 | 9/4/2026 |
| 0.20.1-alpha.0.216 | 39 | 9/4/2026 |
| 0.20.1-alpha.0.215 | 40 | 9/3/2026 |
| 0.20.1-alpha.0.213 | 38 | 9/3/2026 |
| 0.20.1-alpha.0.212 | 36 | 9/3/2026 |
| 0.20.1-alpha.0.211 | 41 | 9/3/2026 |
| 0.20.1-alpha.0.210 | 37 | 9/3/2026 |
| 0.20.1-alpha.0.209 | 40 | 9/2/2026 |
| 0.20.1-alpha.0.208 | 34 | 9/2/2026 |
| 0.20.1-alpha.0.207 | 44 | 9/2/2026 |
| 0.20.1-alpha.0.206 | 43 | 9/2/2026 |
| 0.20.0 | 108 | 8/6/2026 |