Upgrading sqlx 0.8 to 0.9
Breaking0.8.6 → 0.9.0Breaking28Platform2New23Changed23Fixed42Other20
BreakingUpgrade verdict
27 breaking changes and 2 platform requirement changes.
In plain terms
- Installing the CLI with the --locked flag will fail; install without it or keep your own lockfile.
- Removes the lifetime from `PgAdvisoryLockGuard`.
- If you enabled combined runtime and TLS features, switch to separate runtime and TLS features.
- Removes the re-export of the unstable `TransactionManager` trait from `sqlx`.
Must act Top 5 of 29 that need code or config changes
Requires Rust 1.94.0 from 0.9.0 (none stated before).
What you must change
Breaking27
Makes
cargo install --locked sqlx-cli no longer work after Cargo.lock removal.cargo install --locked sqlx-clicargo install sqlx-cliRemoves the lifetime from
PgAdvisoryLockGuard.PgAdvisoryLockGuardDeletes deprecated combination runtime+TLS features such as
runtime-tokio-native-tls.runtime-tokio-native-tlsRemoves the re-export of the unstable
TransactionManager trait from sqlx.TransactionManagerSET NAMES utf8mb4 is sent by default instead of SET NAMES utf8mb4 COLLATE utf8_general_ci, letting the server pick the default collation.SQLite no longer borrows bound values and the lifetime on
SqliteArguments is deleted.SqliteArgumentsRemoves the lifetime parameter from
AnyArguments.AnyArgumentsRemoves the lifetime parameter from the
Arguments trait.Arguments#[derive(sqlx::Type)] now automatically generates impl PgHasArrayType by default for newtype structs.#[derive(sqlx::Type)]PgHasArrayType#[sqlx(no_pg_array)]Changes the
Migrate trait significantly and hides sqlx::migrate::resolve_blocking().Migratesqlx::migrate::resolve_blocking()Corrects spelling of the
aquired_after_secs tracing field to acquired_after_secs.aquired_after_secsacquired_after_secsMakes
Migrator::set_ignore_missing and set_locking return &mut Self instead of &Self.Migrator::set_ignore_missingMigrator::set_lockingForces generic plans in Postgres, which may change
query!() macro output for some queries.query!()Adds a
DB type parameter to all methods of RawSql.RawSqlImplements
Decode, Encode and Type for Box, Arc, Cow and Rc, changing Cow decoding.DecodeEncodeTypeBoxArcCowRcAdds
SqlStr so query*() functions take impl SqlSafeStr, requiring AssertSqlSafe for non-static strings.SqlStrSqlSafeStrAssertSqlSafequery*()Query<'static, DB>Automatically escapes options passed to
PgConnectOptions::options().PgConnectOptions::options()MySQL now assumes all non-binary collations are compatible with
str, inferring text columns as String instead of Vec<u8>.RawSql::fetch_optional() now returns sqlx::Result<Option<DB::Row>> instead of sqlx::Result<DB::Row>.RawSql::fetch_optional()libsqlite3-sys version is now specified using a range, with the maximum increasable in backwards-compatible releases.libsqlite3-sysSQLite extension loading, including via the new
sqlx-toml feature, is now unsafe.sqlx-tomlSqliteValue is now !Sync and SqliteValueRef is !Send to prevent data races from concurrent accesses.SqliteValueSqliteValueRefMoves
PgLTree::from to a From<Vec<PgLTreeLabel>> implementation.PgLTree::fromFrom<Vec<PgLTreeLabel>>PgLTreeLabelPostgreSQL passfile passwords now process backslash-escapes, which may change the password sent to the server.
Makes the
offline feature optional to allow building without serde.offlineserdeAdds
mysql-rsa feature for non-TLS RSA auth; connections requiring RSA password encryption need it or fail at runtime.mysql-rsaCorrectly converts text and blob types to
AnyTypeInfo for any and MySQL drivers.AnyTypeInfoPlatform2
Raises the supported Rust version (MSRV) for this release cycle to 1.94.0.
Increases MSRV to 1.86 and sets rust-version.
rust-version