Skip to content

Upgrading sqlx 0.5 to 0.6

Breaking0.5.13 → 0.6.3Breaking16New21Changed11Fixed36Other17

BreakingUpgrade verdict

16 breaking changes.

  • Upgrades `rustls` to 0.20; future upgrades should not be breaking as `webpki` is no longer exposed in the API.
  • Pool configuration and connection handling APIs changed; update option names, callback signatures and close/release calls.
  • Drops support for end-of-lifed database versions in `#[sqlx::test]`; see PR for details.
  • Code that accessed the Postgres server version through a trait now uses a method directly on the connection type.
Top 3 of 16 that need code or config changes
Breaking16
Upgrades rustls to 0.20; future upgrades should not be breaking as webpki is no longer exposed in the API.
rustlswebpki
Renames PoolOptions::connect_timeout to acquire_timeout, changes pool callback signatures, changes Pool::close(), and deletes PoolConnection::release().
PoolOptions::connect_timeoutPoolOptions::acquire_timeoutPoolOptions::after_connectPoolOptions::before_acquirePoolOptions::after_releasePool::close()PoolConnection::release()PoolConnection::detach()
Drops support for end-of-lifed database versions in #[sqlx::test]; see PR for details.
#[sqlx::test]
Moves server_version_num from a trait to an inherent impl for Postgres.
server_version_num
Bumps ipnetwork to 0.19, a backwards-incompatible dependency upgrade.
ipnetwork
Upgrades time to 0.3, a backwards-incompatible dependency upgrade.
time
Upgrades bigdecimal to 0.3, a backwards-incompatible dependency upgrade.
bigdecimal
Uses Oid everywhere instead of u32 in Postgres, dropping the Type, Decode and Encode impls for u32.
Oidu32TypeDecodeEncode
Makes all ConnectOptions types cloneable.
ConnectOptions
Stores SQLite chrono::DateTime<FixedOffset> with the correct timezone instead of always in UTC.
chrono::DateTime<FixedOffset>
Updates git2 to 0.14, a backwards-incompatible dependency upgrade.
git2
Makes PgLTree::push() infallible and take PgLTreeLabel directly.
PgLTree::push()PgLTreeLabel
Fixes the Rust type for SQLite REAL so macros always map it to f64 instead of f32.
REALf64f32
Improves SQLite support for sub-queries and CTEs, likely changing generated code for some sqlx::query!() invocations.
sqlx::query!()
Updates the uuid crate to v1, a backwards-incompatible dependency upgrade.
uuid
Derives PgHasArrayType for #[sqlx(transparent)] types, reverted in 0.5.13 and postponed to this release.
PgHasArrayType#[sqlx(transparent)]