feat(db): Phase 2 PostgreSQL backend for zeph-db#2372
Merged
Conversation
- 52 PostgreSQL migration files with full DDL translation (BIGSERIAL, TIMESTAMPTZ, BYTEA, BOOLEAN, tsvector/GIN for FTS, plpgsql triggers) - Dialect::EPOCH_NOW constant and epoch_from_col() method for portable epoch extraction across backends - FTS helper functions in fts.rs covering all 5 query patterns: basic search, ranked search (ts_rank with weight arrays), prefix search, graph entity FTS, and ORDER BY direction (ASC/DESC per backend) - Bootstrap guard rejects postgres:// URLs in sqlite-compiled binary with actionable error message - Replace bytemuck with to_le_bytes/from_le_bytes in db_vector_store.rs and response_cache.rs (fixes silent data loss on PostgreSQL BYTEA) - MemoryConfig::database_url field + ZEPH_DATABASE_URL vault key - testcontainers integration tests (4 #[ignore] tests) for migrations, idempotency, CRUD, and FTS trigger verification - Unit tests for all Dialect constants and FTS helpers Tests: 7155/7155 passed
This was referenced 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
crates/zeph-db/migrations/postgres/) — full DDL translation from SQLite schemaDialecttrait withEPOCH_NOWconstant andepoch_from_col()method; replace all#[cfg]-gated epoch SQL in consumersfts.rs: 6 helper functions covering SQLite FTS5 and PostgreSQLtsvector/GIN patternsis_postgres_url()bootstrap guard: runtime error when postgres URL passed to SQLite builddatabase_urlconfig field +ZEPH_DATABASE_URLvault key resolutiondb_vector_store.rsandresponse_cache.rs: replacecast_slicewith explicitto_le_bytes()/from_le_bytes(); removebytemuckfromzeph-memory#[cfg(feature = "test-utils")]integration tests with testcontainers (tests/postgres_integration.rs)Test plan
cargo check -p zeph-db(sqlite default)cargo check -p zeph-db --no-default-features --features postgrescargo nextest run --workspace --lib --bins— all unit tests passcargo nextest run -p zeph-db --features test-utils -- --ignored— requires Docker; runs 4 postgres integration testsAUTOINCREMENT/WITHOUT ROWID/SQLite-isms inmigrations/postgres/