-
Notifications
You must be signed in to change notification settings - Fork 2
epic: Complete database abstraction layer — eliminate sqlx leaks, migrate to generics #2385
Copy link
Copy link
Closed
3 / 33 of 3 issues completedClosed
3 / 33 of 3 issues completed
Copy link
Labels
P1High ROI, low complexity — do next sprintHigh ROI, low complexity — do next sprintarchitectureArchitecture improvementsArchitecture improvementsenhancementNew feature or requestNew feature or request
Description
Problem
The zeph-db crate (introduced in PRs #2371, #2372, #2379) provides a database abstraction layer, but the abstraction is incomplete and leaky:
- 6 consumer crates hardcode
sqlxwithfeatures = ["sqlite"], bypassingzeph-dbentirely - The design uses
#[cfg]type aliases instead of Rust generics (violates established project feedback) - Building with
--features postgres(without sqlite) will fail in all consumer crates zeph-memoryhas 367 directsqlx::occurrences across 31 files alongsidezeph-dbimports
Affected Crates
zeph-memory(Cargo.toml:28 — hardcodedsqlx/sqlite)zeph-core(Cargo.toml:50 — hardcodedsqlx/sqlite)zeph-orchestration(Cargo.toml:19 — hardcodedsqlx/sqlite)zeph-index(Cargo.toml:23 — hardcodedsqlx/sqlite)zeph-mcp(Cargo.toml:35 — hardcodedsqlx/sqlite)zeph-scheduler(Cargo.toml:23 — hardcodedsqlx/sqlite)
Implementation Phases
- Phase 1: Remove direct
sqlxdeps from consumer crates, re-export fromzeph-db, add feature propagation - Phase 2: Migrate from
#[cfg]type aliases toPool<DB>generics perfeedback_db_generics.md - Phase 3: Port test infrastructure, add postgres CI matrix
Architectural Review
Full report: .local/handoff/db-arch-review.md
Key findings:
- Qdrant placement in
zeph-memoryis CORRECT (do not move tozeph-db) VectorStoretrait abstraction is well-designedDialecttrait and FTS helpers are solidsql!macro postgres variant has a memory leak (Box::leak without LazyLock caching)- Feature flags: postgres correctly excluded from
full, mutual exclusion enforced - Pattern compliance: thiserror, no async-trait, rustls, no hardcoded models — all pass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High ROI, low complexity — do next sprintHigh ROI, low complexity — do next sprintarchitectureArchitecture improvementsArchitecture improvementsenhancementNew feature or requestNew feature or request