Upgrading sqlx 0.7 to 0.8
Breaking0.7.4 → 0.8.6Breaking17Security3Deprecated1New42Changed24Fixed73Other48
SecurityFixes RUSTSEC-2024-0363, a protocol handling vulnerability; Postgres users are advised to upgrade ASAP as an exploit has been demonstrated.GHSA-xmrp-424f-vfpx ↗
BreakingUpgrade verdict
17 breaking changes and 3 security fixes.
In plain terms
- Bumps syn to 2.0 and removes deprecated type ascription syntax in the query macros.
- Allows rename with rename_all, changing precedence so #[sqlx(rename)] wins over #[sqlx(rename_all)].
- Removes the Send trait bound from argument binding.
- Replaces HasValueRef, HasArguments and HasStatement with Generic Associated Types in Database.
Must act Top 5 of 21 that need code or config changes
What you must change
Breaking17
Bumps syn to 2.0 and removes deprecated type ascription syntax in the query macros.
Allows rename with rename_all, changing precedence so #[sqlx(rename)] wins over #[sqlx(rename_all)].
sqlx(rename)sqlx(rename_all)Removes the Send trait bound from argument binding.
SendReplaces HasValueRef, HasArguments and HasStatement with Generic Associated Types in Database.
DatabaseHasValueRefHasArgumentsHasStatementFixes describe on PostgreSQL views with rules, potentially changing nullability inference for Postgres.
Implements PgHasArrayType for all references, conflicting with existing manual implementations.
PgHasArrayTypeFixes Decode and Encode derives, changing lifetime obligations for field types.
DecodeEncodeAdds Sqlite explain graph, potentially changing nullability inference for SQLite.
Makes Encode return a result.
EncodeAdds version information for failed CLI migration, with breaking changes to MigrateError.
MigrateErrorAdds no-transaction migrations for Postgres and a new field to Migration.
MigrationSQLite always uses i64 as intermediate when decoding, erroring loudly on integer overflow instead of truncating.
query!()Fixes #[derive(sqlx::Type)] in Postgres; manual PgHasArrayType impls for enums now conflict with the generated one.
sqlx::TypePgHasArrayTypePgTypeInfosqlx(no_pg_array)Fixes handling of arrays of custom types in Postgres; PgTypeInfo::with_name() now infers names starting with _ as arrays.
PgTypeInfo::with_name()Fixes name collision in FromRow and returns Error::ColumnDecode for TryFrom errors.
FromRowError::ColumnDecodeError::ColumnNotFoundsqlx(try_from = "T")sqlx(default)Uses correct names for sslmode options, changing the output of ConnectOptions::to_url_lossy().
ConnectOptions::to_url_lossy()Reorders attributes in the sqlx::test macro so attributes are applied in the correct order.
sqlx::testSecurity3
Fixes RUSTSEC-2024-0363, a protocol handling vulnerability; Postgres users are advised to upgrade ASAP as an exploit has been demonstrated.
Fixes audit protocol handling, addressing RUSTSEC-2024-0363 with regression tests for MySQL, Postgres and SQLite.
Bumps rustls to 0.21.11.
rustlsDeprecations to plan for
Deprecated1
Deprecates misspelled
MySqlConnectOptions::no_engine_subsitution() in favor of the correctly spelled version.MySqlConnectOptions::no_engine_subsitution()MySqlConnectOptions::no_engine_substitution()