sqlite-wal

Detect WAL-tagged SQLite databases and downgrade them to DELETE journaling mode.

2|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/jonaseck2/slaktforskning --skill sqlite-wal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlite-wal
Source: https://github.com/jonaseck2/slaktforskning/tree/main/.claude/skills/sqlite-wal
Command: npx skills add https://github.com/jonaseck2/slaktforskning --skill sqlite-wal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents silent genealogy data loss when SQLite databases are copied or restored, by ensuring the database never ends up in WAL mode that depends on missing sidecar files.

Core Features & Use Cases

  • Enforces DELETE journaling as a project rule: ensures the app and any related tooling sets PRAGMA journal_mode = DELETE instead of WAL.
  • Guides safe review of journal_mode usage: tells maintainers what to check when reviewing any PRAGMA journal_mode code paths.
  • Provides a WAL downgrade rescue procedure: explains how to detect WAL-tagged databases and how to recover them without losing authored data.

Quick Start

Verify whether a user database is WAL-tagged by inspecting its header bytes write_v/read_v, then run the provided walfix recovery script to downgrade it back to DELETE mode.

Frequently Asked Questions about sqlite-wal

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQLite database data loss when copying or restoring backup files?

To prevent SQLite data loss during backups, enforce `PRAGMA journal_mode = DELETE` instead of WAL mode. WAL relies on sidecar files that can be lost during copies, causing silent corruption. Enforcing DELETE mode keeps all journaling within the main database file.

Why does my SQLite database have missing recent writes after a backup restore?

Missing writes after a SQLite backup restore typically happen because the database was in WAL mode. If the required `-wal` sidecar file is not copied alongside the `.db` file, recent transactions logged there are silently lost. Enforcing DELETE journaling prevents this.

How do I detect if a SQLite database is in WAL mode using its file header?

You can detect if a SQLite database is in WAL mode by inspecting its header bytes, specifically checking the `write_v` and `read_v` values. If these header bytes indicate WAL mode, you should run a checkpoint and downgrade procedure to revert to DELETE mode.

What is the best way to downgrade a SQLite database from WAL mode back to DELETE?

The best way to downgrade a SQLite database from WAL mode is to run a checkpoint and downgrade recovery workflow using a script like `walfix`. This process safely merges WAL data back into the main database file and enforces `PRAGMA journal_mode = DELETE` without losing authored data.

What should I check when reviewing new code or sibling tools that touch the same SQLite database file?

When reviewing new sibling-tool integrations touching a shared SQLite database, verify they explicitly enforce `PRAGMA journal_mode = DELETE`. Any tool defaulting to WAL mode risks corrupting the database if sidecar files are missed during copies or incident recovery.

When should I not use SQLite WAL mode for my application database?

You should not use SQLite WAL mode if your database undergoes frequent copies, backup restores, or incident recovery operations. Because WAL separates transaction logs into sidecar files, it creates a risk of silent data loss if those files are missing during file-level operations.