Skip to content

fix(db): remove compile_error for --all-features, gate sqlite-only test assertions#2736

Merged
bug-ops merged 1 commit intomainfrom
fix/2734-all-features-db-compile
Apr 6, 2026
Merged

fix(db): remove compile_error for --all-features, gate sqlite-only test assertions#2736
bug-ops merged 1 commit intomainfrom
fix/2734-all-features-db-compile

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 6, 2026

Summary

  • Removes the compile_error! guard in zeph-db/src/lib.rs that blocked compilation when both sqlite and postgres features were simultaneously active (e.g. cargo test --workspace --all-features)
  • postgres now takes priority when both are enabled, consistent with the #[cfg(all(feature = "sqlite", not(feature = "postgres")))] pattern already used throughout the codebase
  • Fixes two test assertion blocks in lib.rs that used bare #[cfg(feature = "sqlite")] — they now correctly yield to postgres when both are active
  • Adds missing # Errors doc sections to the postgres variants of run_migrations and begin_write, which were previously unreachable by clippy due to the compile error

Test plan

  • cargo test -p zeph-db --all-features --lib --no-run compiles cleanly
  • cargo clippy -p zeph-db --all-features -- -D warnings passes
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 7992 passed

Closes #2734

@github-actions github-actions bot added bug Something isn't working size/S Small PR (11-50 lines) labels Apr 6, 2026
@bug-ops bug-ops enabled auto-merge (squash) April 6, 2026 22:55
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes dependencies Dependency updates and removed size/S Small PR (11-50 lines) labels Apr 6, 2026
…st assertions

When both sqlite and postgres features are enabled (e.g. cargo test
--workspace --all-features --lib --bins --no-run), the compile_error!
guard in lib.rs prevented compilation. postgres now takes priority when
both are active, consistent with the cfg guards already used throughout
the codebase.

Changes:
- Remove #[cfg(all(feature="sqlite", feature="postgres"))] compile_error!
  from lib.rs; keep the no-feature guard
- Fix two test assertions in lib.rs to use
  #[cfg(all(feature="sqlite", not(feature="postgres")))] so they do not
  conflict with the postgres assertion when both features are active
- Add missing # Errors doc sections to the postgres variants of
  run_migrations (migrate.rs) and begin_write (transaction.rs), which
  were previously unreachable by clippy due to the compile error
- Fix doc_markdown clippy warning in driver/postgres.rs and lib.rs
- Update Cargo.toml comment to reflect the new priority semantics

Closes #2734
@bug-ops bug-ops force-pushed the fix/2734-all-features-db-compile branch from e3dea8e to 692e599 Compare April 6, 2026 23:00
@github-actions github-actions bot added the size/S Small PR (11-50 lines) label Apr 6, 2026
@bug-ops bug-ops merged commit 7c050c8 into main Apr 6, 2026
27 checks passed
@bug-ops bug-ops deleted the fix/2734-all-features-db-compile branch April 6, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Dependency updates documentation Improvements or additions to documentation rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(db): test compilation fails with --all-features (sqlite+postgres duplicate definitions in test cfg)

1 participant