manage-sqlite-wasm-lifecycle — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited manage-sqlite-wasm-lifecycle (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
In client-side Blazor WebAssembly applications using SQLite (via WebAssembly virtual disk drivers), the SQLite engine binds directly to the virtual filesystem in the browser (e.g., OPFS or memory-backed storage). Overwriting or replacing the database file while active connections are open leads to unrecoverable engine corruption (SQLITE_CORRUPT or SQLITE_BUSY errors).
This skill provides a safe playbook for importing, exporting, and managing browser-embedded SQLite database files, preventing file-handle lockups and data corruption.
Before executing this workflow, the agent needs:
DbContext.IJSRuntime (for browser-level interop) and the local assembly System.IO API.byte[] array or base64 string.Before modifying the SQLite file on the virtual disk, release all active file locks:
DbContext instances have been fully disposed. Microsoft.Data.Sqlite.SqliteConnection.ClearAllPools();Checkpoint: ClearAllPools() completes synchronously, ensuring no active lock remains on `contest.db`.
Never write incoming bytes directly to the virtual disk without confirming file integrity:
var magic = "SQLite format 3\0"u8;ArgumentException early if validation fails.Checkpoint: Mismatched magic headers are caught before writing, preventing file corruption.
Perform the filesystem replacement safely:
await File.WriteAllBytesAsync("contest.db", backupBytes);Checkpoint: The target database file is completely replaced with valid SQLite structures.
To confirm the database was successfully restored:
DbContext instance. var isAvailable = await context.Categories.AnyAsync();SqliteException or crash is thrown.| Pitfall | Why It Fails | Correct Approach |
|---|---|---|
Overwriting the file with active DbContext instances open | SQLite locks the file and throws SQLITE_BUSY. | Close active contexts and call ClearAllPools() before writing. |
Trusting unverified inputs from JS localStorage | Corrupt or empty localStorage keys will write blank or malformed files, crashing the app on reload. | Always validate incoming sizes and magic headers prior to a write operation. |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.