Skip to content

Upgrading sqlx 0.4 to 0.5

Breaking0.4.2 → 0.5.13Breaking6New42Changed19Fixed47Other15

BreakingUpgrade verdict

6 breaking changes.

  • Removes the `'static` bound on `Connection::transaction`.
  • The attribute used to set the database-side type name has a new name.
  • Types previously named DbDone are now called DbQueryResult.
  • The Done trait is gone, but rows_affected is still available directly on result types like PgQueryResult.
Top 3 of 6 that need code or config changes
Breaking6
Removes the 'static bound on Connection::transaction.
Connection::transaction
Renames the #[sqlx(rename)] attribute to #[sqlx(type_name)].
#[sqlx(rename)]#[sqlx(type_name)]
Renames the DbDone types to DbQueryResult.
DbDoneDbQueryResult
Removes the Done trait; .rows_affected() is now an inherent method on query result types.
Donerows_affected()PgQueryResultMySqlQueryResult
Removes any::AnyType, replaced by directly implementing Type<Any>.
any::AnyTypeType<Any>
Reverts #1748 because the generated PgHasArrayType impl conflicts with manual impls of the trait; the change waits for 0.6.0.
PgHasArrayType