Conversation
… dynamic queries (#2386) Remove hardcoded sqlx/sqlite dependencies from zeph-memory, zeph-core, zeph-index, zeph-mcp, zeph-orchestration, and zeph-scheduler. All consumer crates now route through zeph-db re-exports. Add numbered_placeholder() and placeholder_list() helpers to zeph-db for dialect-agnostic dynamic IN clause construction. Fix 8 dynamic format!()-built queries in graph/store/mod.rs that used SQLite-only ? placeholders, making them portable across both backends. Add MAX_BATCH=490 chunking to mark_messages_graph_processed to prevent SQLite "too many SQL variables" errors on large batches. Closes #2386
…2387) Fix SQLite pool missing acquire_timeout and min_connections. Fix dead pool_size parameter in postgres connect (was using max_connections). Replace N+1 SELECT+INSERT in insert_edge_typed with atomic transaction. Fix get_vectors: use placeholder_list(), propagate errors instead of swallowing with unwrap_or_default(). Switch Qdrant hot-path upsert to wait(false) to reduce per-call latency by 3-15ms. Add migration 053 for importance_score index to prevent full table scans. Fix sql! macro doc comment to accurately describe Box::leak behavior. Fix all pre-existing clippy warnings exposed by broader workspace compilation: many_single_char_names, similar_names, float_cmp, format_collect, items_after_statements, needless_pass_by_value, and 30+ other lint categories across zeph-memory, zeph-tools, zeph-core, zeph-tui, and root binary. Closes #2387
…#2388) Replace direct sqlx::SqlitePool::connect usage in test code (root binary src/scheduler_executor.rs, src/agent_setup.rs) and crate tests (zeph-index/watcher.rs, zeph-scheduler/scheduler.rs) with zeph_db::sqlx re-exports. Move sqlx from [dependencies] to [dev-dependencies] in root Cargo.toml — no production code in the binary uses sqlx directly. Closes #2388
This was
linked to
issues
Mar 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the
zeph-dbdatabase abstraction layer introduced in PRs #2371–#2379. Eliminates all directsqlxleaks from consumer crates and adds security/performance hardening.sqlxdependencies from all 6 consumer crates — all SQL access now routes throughzeph-dbre-exportsformat!()-built queries ingraph/store/mod.rsusing SQLite-only?placeholders — now dialect-portable vianumbered_placeholder()/placeholder_list()helpersacquire_timeout(30s)andmin_connections(1)to SQLite pool; fix deadpool_sizeparameter in postgres pool configget_vectorssilently swallowing DB errors; wrapinsert_edge_typedin atomic transaction; switch Qdrant hot-path towait(false)(saves 3–15ms/call)importance_scoreindex migration (053) to prevent full table scanssslmodeabsent; SQLite file permissions0o600on unixsqlxdep to[dev-dependencies]Issues closed
Closes #2386, #2387, #2388, #2389
Part of epic #2385
Architecture decisions
Per pre-implementation review (
.local/handoff/db-arch-review.md):#[cfg]type aliases retained — generics migration withdrawn; sqlx compile-time macros (query!,migrate!) are fundamentally monomorphiczeph-memory— different concern from relational SQLfullTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full --all-targets -- -D warnings— 0 warningscargo nextest run --workspace --features full --lib --bins— 7233 passed, 22 skippedcargo check --workspace --features full— clean