Skip to content

refactor(db): eliminate repeated #[allow(unused_imports)] for feature-gated sql! macro #4841

@bug-ops

Description

@bug-ops

Description

Five crates (zeph-scheduler, zeph-orchestration) repeat the pattern:

#[allow(unused_imports)]
use zeph_db::sql;  // or pub(crate) use zeph_db::sql;

This is a workaround for sql! being a #[macro_export] defined under both #[cfg(feature = "sqlite")] and #[cfg(feature = "postgres")], but the Rust compiler still warns about the use being unused when neither feature is active.

Affected Files

  • crates/zeph-scheduler/src/lib.rs:80
  • crates/zeph-scheduler/src/store.rs:5
  • crates/zeph-scheduler/src/scheduler.rs:7
  • crates/zeph-orchestration/src/lib.rs:69
  • crates/zeph-orchestration/src/plan_cache.rs:16

Expected Behavior

Either:

  1. Wrap each use zeph_db::sql in #[cfg(any(feature = "sqlite", feature = "postgres"))], or
  2. Re-export sql! from zeph-db under a single #[cfg(any(...))] attribute so importing it never triggers the warning.

Avoids suppressing a potentially real diagnostic with allow(unused_imports).

Environment

Metadata

Metadata

Assignees

Labels

P4Long-term / exploratoryrefactorCode refactoring without functional changes

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions