Rask.SQLite.Litestream 0.20.1-alpha.0.42

This is a prerelease version of Rask.SQLite.Litestream.
dotnet add package Rask.SQLite.Litestream --version 0.20.1-alpha.0.42
                    
NuGet\Install-Package Rask.SQLite.Litestream -Version 0.20.1-alpha.0.42
                    
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="Rask.SQLite.Litestream" Version="0.20.1-alpha.0.42" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rask.SQLite.Litestream" Version="0.20.1-alpha.0.42" />
                    
Directory.Packages.props
<PackageReference Include="Rask.SQLite.Litestream" />
                    
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 Rask.SQLite.Litestream --version 0.20.1-alpha.0.42
                    
#r "nuget: Rask.SQLite.Litestream, 0.20.1-alpha.0.42"
                    
#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 Rask.SQLite.Litestream@0.20.1-alpha.0.42
                    
#: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=Rask.SQLite.Litestream&version=0.20.1-alpha.0.42&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Rask.SQLite.Litestream&version=0.20.1-alpha.0.42&prerelease
                    
Install as a Cake Tool

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 litestream binary 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=false and set your own ExecutablePath.

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 Critical but never crashes the app.
  • Checkable. A log line tells you when replication broke; nothing tells you it's healthy. Resolve the LitestreamStatus singleton for IsReplicating, LastStartedAt/LastExitedAt, RestartCount, LastExitCode and LastError. A clean shutdown clears IsReplicating without counting a restart, so a climbing RestartCount means backups are flapping.
  • Advanced config. Point ConfigPath at a full litestream.yml for multiple databases or custom retention / sync intervals.

Full documentation: https://github.com/pal-tamas/rask/blob/main/docs/sqlite.md

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.20.1-alpha.0.42 0 8/12/2026
0.20.1-alpha.0.41 0 8/12/2026
0.20.1-alpha.0.40 0 8/12/2026
0.20.1-alpha.0.38 0 8/12/2026
0.20.1-alpha.0.36 46 8/10/2026
0.20.1-alpha.0.18 54 8/8/2026
0.20.1-alpha.0.17 47 8/8/2026
0.20.1-alpha.0.16 47 8/8/2026
0.20.1-alpha.0.15 47 8/7/2026
0.20.1-alpha.0.14 57 8/7/2026
0.20.1-alpha.0.13 45 8/7/2026
0.20.1-alpha.0.12 46 8/7/2026
0.20.1-alpha.0.11 55 8/7/2026
0.20.1-alpha.0.9 53 8/7/2026
0.20.1-alpha.0.8 62 8/7/2026
0.20.1-alpha.0.7 45 8/7/2026
0.20.1-alpha.0.5 51 8/7/2026
0.20.1-alpha.0.4 43 8/7/2026
0.20.1-alpha.0.3 49 8/7/2026
0.20.1-alpha.0.2 55 8/6/2026
Loading failed