Rask.SQLite.Snapshots
0.20.0
See the version list below for details.
dotnet add package Rask.SQLite.Snapshots --version 0.20.0
NuGet\Install-Package Rask.SQLite.Snapshots -Version 0.20.0
<PackageReference Include="Rask.SQLite.Snapshots" Version="0.20.0" />
<PackageVersion Include="Rask.SQLite.Snapshots" Version="0.20.0" />
<PackageReference Include="Rask.SQLite.Snapshots" />
paket add Rask.SQLite.Snapshots --version 0.20.0
#r "nuget: Rask.SQLite.Snapshots, 0.20.0"
#:package Rask.SQLite.Snapshots@0.20.0
#addin nuget:?package=Rask.SQLite.Snapshots&version=0.20.0
#tool nuget:?package=Rask.SQLite.Snapshots&version=0.20.0
Rask.SQLite.Snapshots
Scheduled, consistent SQLite backups — no external binary. Takes point-in-time file snapshots of a
live SQLite database on a schedule using SQLite's Online Backup API (never an unsafe File.Copy of
a WAL database), keeps the newest N, and writes them to a directory — or a pluggable store for object
storage.
Use it on its own for simple periodic full backups without a sidecar or object storage, or alongside
Rask.SQLite.Litestream (continuous streaming)
as a second line of defence. Standalone: depends only on Microsoft.Data.Sqlite and the
Microsoft.Extensions hosting/DI abstractions.
Install
dotnet add package Rask.SQLite.Snapshots
Use
builder.Services.AddRaskSqliteSnapshots(o =>
{
o.DatabasePath = "/data/app.db";
o.DestinationDirectory = "/backups";
o.Interval = TimeSpan.FromHours(6);
o.Retain = 14; // keep the 14 newest
o.SnapshotOnStartup = true; // also take one at boot
});
Snapshots land as app-20260714-030000000.db — each a complete, standalone SQLite database you can
open, copy or archive.
Need a backup on demand (say, before a risky migration)? Inject ISqliteSnapshotter:
var name = await snapshotter.SnapshotAsync(ct);
Sending snapshots to object storage instead of a directory? Register your own ISqliteSnapshotStore
before AddRaskSqliteSnapshots and DestinationDirectory is no longer required.
To show what you've captured, await store.ListAsync(ct) returns each snapshot's name, size and timestamp,
newest first. A custom store inherits a default that returns an empty list — override it if yours can
enumerate, because callers can't tell "no snapshots yet" from "this store doesn't list".
Notes
- Consistent, not a raw copy. The Online Backup API copies pages while writers continue, so the snapshot is a valid database even under load — unlike copying the file yourself.
- Resilient. A failed snapshot is logged and the schedule continues; a backup problem never crashes the app.
- Dedicated directory. Point
DestinationDirectoryat a directory used only for snapshots — pruning is scoped to this database's own files, but a dedicated directory keeps things tidy.
Full documentation: https://github.com/pal-tamas/rask/blob/main/docs/sqlite.md#scheduled-snapshots
| 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.Data.Sqlite (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 3.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rask.SQLite.Snapshots:
| Package | Downloads |
|---|---|
|
Rask.SQLite.Browser
Runs Microsoft.Data.Sqlite (and Entity Framework Core on top of it) inside a browser WebAssembly app, with the database persisted across reloads. The database file lives in the WASM runtime's in-memory filesystem; this package restores it from IndexedDB at boot and writes it back on a schedule and on page-hide, using SQLite's Online Backup API (never an unsafe file copy) via Rask.SQLite.Snapshots. A Web Lock elects one tab as the owner, so several open tabs cannot write over each other. Register `AddRaskBrowserSqlite("app")` and point your DbContext at `BrowserSqlite.ConnectionString("app")` — the same registration you would write on the server. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.20.1-alpha.0.36 | 34 | 8/10/2026 |
| 0.20.1-alpha.0.18 | 35 | 8/8/2026 |
| 0.20.1-alpha.0.17 | 38 | 8/8/2026 |
| 0.20.1-alpha.0.16 | 36 | 8/8/2026 |
| 0.20.1-alpha.0.15 | 40 | 8/7/2026 |
| 0.20.1-alpha.0.14 | 37 | 8/7/2026 |
| 0.20.1-alpha.0.13 | 38 | 8/7/2026 |
| 0.20.1-alpha.0.12 | 34 | 8/7/2026 |
| 0.20.1-alpha.0.11 | 37 | 8/7/2026 |
| 0.20.1-alpha.0.9 | 31 | 8/7/2026 |
| 0.20.1-alpha.0.8 | 40 | 8/7/2026 |
| 0.20.1-alpha.0.7 | 39 | 8/7/2026 |
| 0.20.1-alpha.0.5 | 38 | 8/7/2026 |
| 0.20.1-alpha.0.4 | 36 | 8/7/2026 |
| 0.20.1-alpha.0.3 | 38 | 8/7/2026 |
| 0.20.1-alpha.0.2 | 35 | 8/6/2026 |
| 0.20.0 | 46 | 8/6/2026 |
| 0.19.1-alpha.0.75 | 35 | 8/6/2026 |
| 0.19.1-alpha.0.74 | 38 | 8/6/2026 |
| 0.19.1-alpha.0.73 | 40 | 8/6/2026 |