Skip to content

Upgrading sqlx 0.3 to 0.4

Breaking0.3.5 → 0.4.2Breaking3New25Changed3Fixed16Other1

BreakingUpgrade verdict

3 breaking changes.

  • Runtime features now need a TLS backend suffix, so existing feature names must be updated.
  • Transactions no longer take ownership of the connection, so you can start another transaction from the same connection.
  • When reading SQLite integer columns, the default Rust type is now a 64-bit integer instead of a 32-bit one. Columns declared as INT4 still map to 32-bit integers.
3 items need code or config changes
Breaking3
Adds rustls support and requires choosing -native-tls or -rustls on each runtime feature.
runtime-async-stdruntime-async-std-native-tls-native-tls-rustls
Changes Transaction to mutably borrow a connection instead of owning it, enabling new or nested transactions from &mut conn.
Transaction
SQLite INTEGER now resolves to i64 instead of i32, while INT4 still resolves to i32.
INTEGERINT4i64i32