Rask.SQLite.Snapshots 0.23.1-alpha.0.76

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

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();
// appsettings.json
{
  "Rask": {
    "Snapshots": {
      "DestinationDirectory": "/backups",
      "Interval": "06:00:00",
      "Retain": 14,                 // keep the 14 newest
      "SnapshotOnStartup": true     // also take one at boot
    }
  }
}

It snapshots the database behind Rask:ConnectionStrings:App unless DatabasePath names another. A callback — AddRaskSqliteSnapshots(o => …) — runs after the Rask:Snapshots section and wins.

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 DestinationDirectory at 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 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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Rask.SQLite.Snapshots:

Package Downloads
Rask.Server

The ASP.NET host for Rask, a full-stack .NET web framework, with every battery: database (SQLite, PostgreSQL or SQL Server, picked by Rask:Database:Provider), mediator and query cache, accounts, background jobs, transactional email, cache, file storage, outbox, operator dashboard, durable logs, Web Push, SQLite snapshots and continuous backup. Renders Rask components with live updates over a WebSocket. RaskApp.Create(args).Run<App>() is the whole Program.cs; app.Configure(c => c.Jobs.Off()) is how an app does without one. Depends on Rask, the shared core.

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. Add `UseRaskFullTextSearch()` from Rask.SQLite.EntityFrameworkCore and Rask.Data's full-text search (`HasFullTextSearch`, `Search(text)`) runs on FTS5 in the browser too.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.23.1-alpha.0.84 0 9/25/2026
0.23.1-alpha.0.82 0 9/25/2026
0.23.1-alpha.0.81 0 9/25/2026
0.23.1-alpha.0.80 0 9/25/2026
0.23.1-alpha.0.79 0 9/25/2026
0.23.1-alpha.0.78 0 9/25/2026
0.23.1-alpha.0.76 0 9/25/2026
0.23.1-alpha.0.74 0 9/25/2026
0.23.1-alpha.0.72 0 9/25/2026
0.23.1-alpha.0.70 0 9/25/2026
0.23.1-alpha.0.69 0 9/25/2026
0.23.1-alpha.0.68 0 9/25/2026
0.23.1-alpha.0.67 0 9/25/2026
0.23.1-alpha.0.66 25 9/24/2026
0.23.1-alpha.0.65 32 9/24/2026
0.23.1-alpha.0.64 31 9/24/2026
0.23.1-alpha.0.62 28 9/24/2026
0.23.1-alpha.0.61 29 9/24/2026
0.23.1-alpha.0.50 35 9/24/2026
0.23.0 151 9/18/2026
Loading failed