A zero-dependency, ultra-lightweight database time machine for SQLite
Summary
An open-source, zero-dependency SQLite debugging tool that tracks database changes and allows instant rewinding to any previous state via snapshots, a web UI, and a CLI watcher daemon.
View Cached Full Text
Cached at: 08/09/26, 08:29 PM
nsrht/time-travel-sqlite-debugger
Source: https://github.com/nsrht/time-travel-sqlite-debugger
⏱️ Time-Travel SQLite Debugger (Database Time Machine)
An open-source, ultra-lightweight web application and CLI daemon designed to track and instantly rewind a corrupted or modified SQLite database file back to any previous state (e.g. 3 minutes ago) during local development — just like scrubbing a video.
🇹🇷 Türkçe Dokümantasyon: Türkçe rehber için lütfen README.tr.md dosyasına bakın.
🚀 Features
- ⚡ Zero Dependencies: Built with pure PHP 8+ and Vanilla JS. Requires no heavy frameworks or npm packages.
- 🌐 Full i18n / Multi-Language: Translation files are completely decoupled in
lang/. Switch languages dynamically from the UI (e.g., 🇹🇷 Turkish, 🇬🇧 English). Easily contribute by adding or updatinglang/xx.jsonfiles. - 💾 SQLite WAL Mode Aware: Seamlessly backs up and restores
.sqlite-waland.sqlite-shmfiles for databases runningPRAGMA journal_mode=WAL;. - 🔍 Visual Data & Table Diff Viewer: Compare row counts and table changes (
+3 rows in live) between any historic snapshot and your current live database before restoring. - 📌 Snapshot Pinning & Tagging: Pin important snapshots with one click to protect them from auto-cleanup.
- 📥 One-Click Snapshot Export: Download any historic database state directly as a
.sqlitefile. - ⌨️ Keyboard Navigation Shortcuts: Navigate through the timeline smoothly using Left Arrow (⬅️) and Right Arrow (➡️) keys.
- 🔄 Automatic Instant Snapshots (Watcher Daemon): Background CLI script (
watcher.php) listens for modifications indatabase.sqliteand automatically creates timestamped snapshots (backups/1715000000_database.sqlite). - 🧹 Automatic Cleanup: Maintains up to 50 backups, purging older unpinned snapshots to prevent disk clutter.
📁 Project Layout
time-travel/
├── index.html # Chrono Console UI (Tailwind CSS + Vanilla JS + i18n Engine)
├── api.php # Snapshot listing, restoration, diff, export, and i18n API
├── watcher.php # CLI background listener daemon script (WAL & signal aware)
├── lang.php # Multi-language (i18n) helper class
├── lang/ # JSON language files directory
│ ├── tr.json # Turkish language file
│ └── en.json # English language file
├── database.sqlite # Target SQLite database file (created automatically)
├── backups/ # Timestamped backups directory (created automatically)
├── README.md # Primary English documentation
└── README.tr.md # Turkish documentation & guide
🌍 Translation Guide: Adding & Updating Language Files
1. Adding a New Language
Create a JSON file inside lang/ matching the ISO code (e.g., lang/es.json, lang/de.json):
{
"code": "es",
"name": "Español",
"flag": "🇪🇸",
"cli": { ... },
"api": { ... },
"ui": { ... }
}
2. Updating Existing Translations
Open any file in lang/*.json and edit strings. Changes reflect immediately on the Web UI and CLI without restarting the server.
💻 Installation & Usage
1. Start the Watcher Daemon (Terminal 1)
php watcher.php
To specify custom language or database file:
php watcher.php database.sqlite en
2. Start Local Web Server (Terminal 2)
php -S 127.0.0.1:8000
3. Open Web Interface
Open your browser and navigate to: http://127.0.0.1:8000
🧪 How to Test
- Open the web interface.
- Click “✍️ Add Test Data (DB Write)”.
- Observe terminal output from
watcher.php:[+] Created snapshot: 1715000000_database.sqlite - Drag the timeline slider or use ⬅️ / ➡️ arrow keys.
- Click “🔍 Compare Diff” to inspect table row changes.
- Click “⚡ Restore To This State” to rewind your database!
🔒 File Permissions (Linux / Unix)
chmod -R 775 .
📄 License
This project is open-source under the MIT license.
Similar Articles
How We Built a Zero-Disk, S3-Tiered Storage Engine for SQLite
Rivet engineers detail how they built a zero-disk, S3-tiered storage engine for SQLite, enabling isolated databases with instant startup, low-latency writes, point-in-time recovery, and bottomless storage for millions of Actors.
@weswinder: this mac app is insanely good for databases > free > open source > beautiful > super fast handy for viewing local codex…
A tweet highlights a free, open-source Mac app that is great for databases and fast for viewing local SQLite files.
sqlite-utils 4.0, now with database schema migrations
sqlite-utils 4.0 introduces database schema migrations, nested transactions, and compound foreign keys, making it easier to manage SQLite database schema changes programmatically.
I'm building an ambient memory agent that watches my screen all day, and its memory lives in SQLite instead of the model. Come tell me where it breaks.
The author describes building an ambient memory agent that runs locally on a Mac, watching the screen and optionally audio, OCRs/transcribes everything into structured Markdown in an Obsidian vault, with SQLite as the source of truth. They invite feedback on design choices like using SQLite over vector/graph DB, cost, and durability of such systems.
sqlite-utils 4.0rc2, mostly written by Claude Fable (for about $149.25)
sqlite-utils 4.0rc2 is released, largely written with the help of Claude Fable AI. The release fixes critical bugs in transaction handling and includes comprehensive documentation.