Skip to content

chore(deps): update sqlx requirement from 0.8 to 0.9#272

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/cargo/sqlx-0.9
Open

chore(deps): update sqlx requirement from 0.8 to 0.9#272
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/cargo/sqlx-0.9

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github May 25, 2026

Updates the requirements on sqlx to permit the latest version.

Changelog

Sourced from sqlx's changelog.

0.9.0 - 2026-05-06

Important Announcements

New Github Organization

Shortly after this release is published, the SQLx repository will be transferred to a new GitHub organization: https://github.com/transact-rs/

This is because SQLx has not been owned or maintained by LaunchBadge, LLC. for a few years now, and has since been informally transferred to the collective ownership of its principal authors. Moving the repository to a new organization makes this change more clear, and also allows for potentially inviting outside collaborators.

Cargo.lock Removed from Tracking

The Cargo.lock has been removed from tracking in Git. CI should now always test with the latest versions of all dependencies by default, alongside our pass that checks with cargo generate-lockfile -Z minimal-versions.

This should eliminate the need for any PRs that update dependencies to also update Cargo.lock or contend with an endless stream of merge conflicts against it.

N.B. cargo install --locked sqlx-cli will no longer work. However, cargo install sqlx-cli has always used the latest dependencies by default, ignoring the lockfile, so most users should not be affected. For users requiring reproducible builds, consider maintaining your own lockfile instead; historically, we only ran cargo update sporadically, so relying on SQLx's lockfile offered few guarantees anyway.

See [the manual page for cargo install][man-cargo-install] for details.

Breaking

As per our MSRV policy, the supported Rust version for this release cycle is 1.94.0.

  • [#3383]: feat: create sqlx.toml format [[@​abonander]]
    • SQLx and sqlx-cli now support per-crate configuration files (sqlx.toml)
    • New functionality includes, but is not limited to:
      • Rename DATABASE_URL for a crate (for multi-database workspaces)
      • Set global type overrides for the macros (supporting custom types)
      • Rename or relocate the _sqlx_migrations table (for multiple crates using the same database)
      • Set characters to ignore when hashing migrations (e.g. ignore whitespace)
    • More to be implemented in future releases.
    • Enable feature sqlx-toml to use.
      • sqlx-cli has it enabled by default, but sqlx does not.
      • Default features of library crates can be hard to completely turn off because of [feature unification], so it's better to keep the default feature set as limited as possible. [This is something we learned the hard way.][preferred-crates]
    • Guide: see sqlx::_config module in documentation.
    • Reference: [Link]
    • Examples (written for Postgres but can be adapted to other databases; PRs welcome!):
      • Multiple databases using DATABASE_URL renaming and global type overrides: [Link]
      • Multi-tenant database using _sqlx_migrations renaming and multiple schemas: [Link]
      • Force use of chrono when time is enabled (e.g. when using tower-sessions-sqlx-store): [[Link][preferred-crates]]
        • Forcing bigdecimal when rust_decimal is enabled is also shown, but problems with chrono/time are more common.

... (truncated)

Commits
  • 75bc048 Release 0.9.0 (#4256)
  • 6956cef Prefer to give real data to .bind() in README.md (#4257)
  • 45ba990 Add the possibility to skip migrations (#3846)
  • 66533fa Ensure Deterministic Migration Order (#4136)
  • db47fe3 ci: check direct minimal versions (#4173)
  • 9ecb76d Unescape PostgreSQL passfile password (#3993)
  • c0a3218 breaking(any+mysql): correctly convert text and blob types to AnyTypeInfo (...
  • d82b781 test(sqlite): add regression test for ORDER BY + LIMIT nullability (#4223)
  • b77ba16 chore: update to axum 0.8 (#4253)
  • c0ec9c0 fix(tls): potential deadlock in StdSocket::poll_ready() (#4251)
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [sqlx](https://github.com/launchbadge/sqlx) to permit the latest version.
- [Changelog](https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md)
- [Commits](transact-rs/sqlx@v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: sqlx
  dependency-version: 0.9.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels May 25, 2026
Copy link
Copy Markdown

@doubleword-code doubleword-code Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR upgrades sqlx from version 0.8 to 0.9, a major version bump with significant breaking changes. While the dependency change itself is straightforward (single line in Cargo.toml), the codebase contains multiple usages that will fail to compile with sqlx 0.9 due to the new SqlSafeStr requirement for dynamic queries.

Verdict: BLOCKED - Cannot merge without fixing the dynamic query usages identified below.

Research notes

I reviewed the sqlx 0.9.0 changelog extensively. Key breaking changes relevant to this codebase:

  1. [#3723]: SqlSafeStr trait - All query*() functions now take impl SqlSafeStr, which is only implemented for &'static str and AssertSqlSafe. This is a security feature to make dynamic SQL construction more visible during code review.

  2. MSRV increased to 1.94.0 - Per sqlx's MSRV policy, this release cycle supports Rust 1.94.0+

  3. Other breaking changes (not affecting this codebase): Changes to Migrate trait, RawSql, PgHasArrayType, Cow decoding behavior, PostgreSQL options escaping

The codebase does NOT use the other breaking change patterns (no manual PgHasArrayType impls, no Migrator::set_* methods, no RawSql usage).

Suggested next steps

  1. BLOCKING: Wrap all dynamic SQL strings in sqlx::AssertSqlSafe() or refactor to use sqlx::query() with static strings where possible
  2. Verify Rust MSRV is compatible (1.94.0+)
  3. Regenerate .sqlx/ query cache after making code changes
  4. Run full test suite to ensure no regressions
  5. Consider adding a note to CLAUDE.md about the AssertSqlSafe pattern for future contributors

General findings

Dependency upgrade scope

This is a well-scoped PR that only changes the sqlx version constraint. However, the impact extends beyond this single line change because sqlx 0.9 introduces API-breaking changes that affect existing code patterns.

Features used by this codebase

The fusillade codebase uses sqlx for:

  • Compile-time checked queries via sqlx::query!(), sqlx::query_as!(), sqlx::query_scalar!() macros
  • Runtime-checked dynamic queries via sqlx::query(), sqlx::query_as(), sqlx::query_scalar()
  • Type derives: #[derive(sqlx::FromRow)], #[derive(sqlx::Type)]
  • Migrations via sqlx::migrate!()
  • Connection pooling via sqlx::PgPool
  • Advisory locks via pg_try_advisory_lock()

All of these continue to work in 0.9 EXCEPT the dynamic query construction pattern.

Comment thread Cargo.toml
hostname = "0.4"
dashmap = { version = "6", features = ["serde"] }
sqlx = { version = "0.8", features = ["runtime-tokio", "postgres", "uuid", "chrono", "json", "tls-rustls"], optional = true }
sqlx = { version = "0.9", features = ["runtime-tokio", "postgres", "uuid", "chrono", "json", "tls-rustls"], optional = true }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: This version upgrade will cause compilation failures due to the SqlSafeStr breaking change introduced in sqlx 0.9.

Why it matters: In sqlx 0.9, all query*() functions now require impl SqlSafeStr parameter, which is only implemented for &'static str and AssertSqlSafe. The codebase has at least 6 locations using format!() to construct dynamic SQL queries:

  1. src/manager/postgres.rs:3678 - count_sql = format!(...)
  2. src/manager/postgres.rs:3697 - sqlx::query_scalar(&count_sql)
  3. src/manager/postgres.rs:3723 - sqlx::query_scalar(&format!(...))
  4. src/manager/postgres.rs:3755 - sqlx::query_as(&format!(...))
  5. src/manager/response_step.rs:122 - sqlx::query(&query) where query is from format!()
  6. src/manager/response_step.rs:138 - same pattern
  7. src/manager/response_step.rs:172 - same pattern

These will all fail to compile with sqlx 0.9 because String (from format!()) does not implement SqlSafeStr.

Suggested fix: Wrap each dynamic query string in sqlx::AssertSqlSafe(). For example:

// Before:
let query = format!("SELECT {} FROM ...", columns);
sqlx::query(&query)

// After:
let query = format!("SELECT {} FROM ...", columns);
sqlx::query(sqlx::AssertSqlSafe(&query))

Alternatively, consider whether these queries can be refactored to use static SQL with parameter binding instead of string interpolation (safer long-term).

Comment thread Cargo.toml
hostname = "0.4"
dashmap = { version = "6", features = ["serde"] }
sqlx = { version = "0.8", features = ["runtime-tokio", "postgres", "uuid", "chrono", "json", "tls-rustls"], optional = true }
sqlx = { version = "0.9", features = ["runtime-tokio", "postgres", "uuid", "chrono", "json", "tls-rustls"], optional = true }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: MSRV (Minimum Supported Rust Version) consideration.

Why it matters: According to the sqlx 0.9 changelog, this release increases the MSRV to Rust 1.94.0. You should verify that your CI pipeline and deployment targets support this Rust version.

Check your .github/workflows/ or CI configuration to ensure the Rust toolchain version is compatible.

Suggested fix: Update CI configuration if necessary to use Rust 1.94.0 or later. Add an rust-version field to Cargo.toml to document the MSRV for future maintainers:

[package]
rust-version = "1.94"

Comment thread Cargo.toml
hostname = "0.4"
dashmap = { version = "6", features = ["serde"] }
sqlx = { version = "0.8", features = ["runtime-tokio", "postgres", "uuid", "chrono", "json", "tls-rustls"], optional = true }
sqlx = { version = "0.9", features = ["runtime-tokio", "postgres", "uuid", "chrono", "json", "tls-rustls"], optional = true }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: After resolving the breaking changes, remember to regenerate the .sqlx/ query cache.

Run cargo sqlx prepare after making code changes to update the offline query metadata cache. This ensures the project can build in CI environments without direct database access and keeps compile-time query checking working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants