Make SQLx migration/checksum support fully opt-in
Author: lesebCreated Sep 23, 2026Updated Sep 23, 2026
Labelsenhancement
I have found these related issues/pull requests
No
Description
With default features disabled, the sqlx facade still unconditionally enables sqlx-core/migrate:
sqlx = { version = "0.9", default-features = false, features = ["runtime-tokio"] }This compiles migration support and its sha2-based checksum implementation even when an application does not use migrations. Because Cargo features are additive, downstream applications cannot disable it.
This matters for dependency minimization and environments where cryptographic implementations must come exclusively from approved modules, including FIPS-oriented builds.
Prefered solution
- Remove the unconditional migrate feature from the facade’s sqlx-core dependency.
- Enable sqlx-core/migrate and backend migration features only through SQLx’s public migrate feature.
- Ensure macro and CLI dependency edges activate migration support only when requested.
- Preserve existing behavior for users enabling migrate.
Is this a breaking change? Why or why not?
No intended public API break. It may expose downstream builds relying on accidental transitive feature activation; those builds should explicitly enable migrate.
Source: transact-rs/sqlx