Repository navigation
feat!: upgrade sqlx to 0.9 and raise MSRV to 1.94.0 - #124
Merged
Merged
Conversation
sqlx is part of Hammerwork's public API (pools, JobQueue<DB>, DatabaseQueue, migration runners), so applications must move to sqlx 0.9 together with Hammerwork 3.0. - Workspace sqlx 0.9 with runtime-tokio + tls-rustls-ring-webpki (the combined runtime/TLS features were removed). - Wrap every runtime-built SQL string in sqlx::AssertSqlSafe (library, CLI, dashboard, tests). Migrations keep their protocols: MySQL runs each statement over the text protocol, PostgreSQL through sqlx::query. - CLI and dashboard enable sqlx's mysql-rsa so non-TLS MySQL logins with caching_sha2_password keep working; the library leaves it to users. - rust-version and the CI MSRV job move to 1.94.0. - CHANGELOG breaking-changes entry, docs/upgrading-to-3.0.md (doctested), README link, quick-start sqlx dependency line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodingAnarchy
force-pushed
the
feat/85-sqlx-0.9
branch
from
October 11, 2026 19:53
bc7900b to
74c020b
Compare
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.
Closes #85
Part of #122
What
Moves the whole workspace (library,
cargo-hammerwork,hammerwork-web,integrations/*) from sqlx 0.8 to 0.9 and raises the MSRV to Rust 1.94.0, which sqlx 0.9 requires.sqlx is in Hammerwork's public API (the pool passed to
JobQueue::new,JobQueue<DB: sqlx::Database>,DatabaseQueue, the migration runners, sqlxEncode/DecodeonJobStatus/BatchStatus), so users have to move to sqlx 0.9 together with Hammerwork 3.0. Hammerwork's own signatures don't change.Changes
sqlx = "0.9"withruntime-tokio+tls-rustls-ring-webpki(sqlx 0.9 removed the combinedruntime-tokio-rustlsfeature; this is the same rustls/ring/webpki stack). Default sqlx features (any,macros,migrate,json) are kept as before.query*/raw_sql/Executor::executeonly accept&'static strunless the string is wrapped insqlx::AssertSqlSafe. Every runtime-built query is now wrapped, preferring ownedStrings, which sqlx stores without copying. All of these were already parameterised; the wrapper just marks them as reviewed.tx.execute(AssertSqlSafe(stmt)), no arguments, so there's no prepare step), and PostgreSQL still usessqlx::query.IntoArguments: the lifetime parameter was dropped. This affected one test-only bound inkey_manager.rs.mysql-rsa.cargo-hammerworkandhammerwork-webenable it so the binaries connect as before. The library doesn't enable it; users opt in through their own sqlx dependency (documented). Thersaaudit ignore in.cargo/audit.tomlstays, with an updated comment.rust-version = "1.94.0", and the CI MSRV job uses 1.94.0.### Breaking changesunder[Unreleased]in CHANGELOG, a newdocs/upgrading-to-3.0.md(doctested viadoc_examples; later 3.0 PRs append sections to it), a README link, a sqlx dependency line in the quick start, and CLAUDE.md notes.Things I checked
TIMESTAMP(6)and PostgreSQLTIMESTAMPTZdecoding: unchanged, and both suites pass. sqlx still sets the MySQL sessiontime_zoneto+00:00.SET NAMES utf8mb4with noCOLLATEclause, so connections get the server default (utf8mb4_0900_ai_cion 8.0) instead ofutf8mb4_unicode_ci. Freshly migrated tables useutf8mb4_0900_ai_ci, and Hammerwork compares columns with parameters, so behaviour doesn't change. This is noted in the upgrade guide.mysql-rsa: I confirmed it fails with "RSA auth backend disabled" for a freshcaching_sha2_passworduser. This is why the binaries enable the feature.Cargo.lock: only sqlx and its dependencies changed. The lockfile now has fewer duplicate crate versions than before; the one new duplicate issha10.10/0.11.cargo deny check advisoriesis clean.Testing
cargo fmt --all --checkcargo clippy --workspace --all-features --all-targets -- -D warningscargo clippy --no-default-features -- -D warningscargo clippy --features mysql -- -D warningscargo check --examples --all-featurescargo +1.94.0 check --workspace --all-features --all-targets --lockedcargo metadata --locked--include-ignored --skip mysql): 2102 passed, 0 failed--include-ignored mysql): 232 passed, 0 failedhammerwork_sqlx09databases (PostgreSQL, and MySQL withssl-mode=disabled), then a second run to check idempotency. The scratch databases were dropped afterwards.🤖 Generated with Claude Code