Repository navigation
Open
Labels
status/needs-researchDeep multi-source research required before committing to an approachtype/choreRoutine maintenance / repo hygiene
Description
Per docs/research/architecture_audit.md §3.7 and §4.4.
Problem
Current connection model has three parallel issues:
- Three separate eager
Mutex<Connection>instances (metadata, tag, search — each opened at startup incrates/desktop/src/lib.rs). - Per-command
open_and_migrateinfile_repo.rsandvolume_repo.rs— re-negotiates WAL shm files + re-applies pragmas on every call. Mutex<Connection>serializes reads unnecessarily.
Target shape
Write-actor + read-pool hybrid:
- Writer: one
std::thread::spawnowning therusqlite::Connection, consumingflume::Receiver<WriteCmd>. Migrations applied once at startup viarusqlite_migration 2.4.1. Domain events published onto the bus ONLY after COMMIT from inside this actor — free ordering guarantee. - Readers:
deadpool-sqlite = "0.13"(Feb 2026; tracks rusqlite 0.38) withmax_size = 4,post_createhook applyingPRAGMA busy_timeout=5000; temp_store=MEMORY; query_only=1; mmap_size=268435456;.SQLITE_OPEN_READ_ONLYmakes write separation a hard invariant. - Kill per-command
open_and_migratein file/volume repos.
Reference
silvermine/tauri-plugin-sqlite ships exactly this architecture (using sqlx) for Tauri apps — strongest 2026 precedent.
Label: needs-research
Verify before implementing:
deadpool-sqlitecurrent version (was 0.13 in Feb 2026).rusqlite_migrationcompat with rusqlite 0.38 (bundled feature).flumevscrossbeam::channeltrade-off.
Rejected alternatives
From architecture_audit.md §4.4:
sqlx-sqlite— awkward compile-time checks on templated FTS5 triggers; Keeping in-memory sqlite database connection pool alive transact-rs/sqlx#2011.libsql/ Turso — 200x slowdown in local mode (libsql rust slow compare to rusqlite in local-mode tursodatabase/libsql#1458); no sync-layer value until post-v1 CRDT work.turso-database(Rust rewrite w/ MVCC) — beta in 2026; Turso themselves say "use libSQL for mission-critical".- WAL2 / BEGIN CONCURRENT / HCTree — SQLite branch-only; data-model constraints.
Constraint
Move to write-actor NOW, not mid-Phase-6. The refactor is ~300 LOC, removes more code than it adds. Doing it inside the axum work means every new HTTP handler gets written against the wrong shape.
Source
docs/research/architecture_audit.md §3.7, §4.4.
Execution hint
Brainstorm → plan cycle. Block Phase 6 (issue #59) on this.
Metadata
Metadata
Assignees
Labels
status/needs-researchDeep multi-source research required before committing to an approachtype/choreRoutine maintenance / repo hygiene
Activity
utof commentedon Apr 19, 2026
Correction: The body's parenthetical "Phase 6 (issue #59)" is wrong — GH issue #59 is a different FTS refactor. "Phase 6" here refers to the internal task-tracker epic (Local HTTP API: axum + keychain + OpenAPI); there is no matching GH issue yet. This issue is a blocker/prep for that epic whenever it starts.