Skip to content

v0.3.0 — sqlx migration

Choose a tag to compare

@oonxt oonxt released this 11 Jun 09:39
· 187 commits to main since this release

Breaking changes

  • Driver migrated from tokio-postgres/deadpool-postgres to sqlx. Engine::new now takes sqlx::PgPool — share the pool your application already has.
  • Engine::transaction closure now receives &mut TxClient; TxClient methods take &mut self.
  • Error::Pool removed; pool errors surface as Error::Database(sqlx::Error).

Fixes

  • uuid / numeric / timestamp(tz) / jsonb binds were broken at the wire-protocol level in 0.2 (incorrect binary data format). All bind placeholders now carry an explicit cast ($1::uuid) and convert server-side. Covered by new integration tests.

Features

  • Typed results: engine.run_as::<T>() (unwraps the root field: Vec<T> / Option<T> / MutationResult<T>), engine.query_as::<T>(), same on TxClient.
  • _in / _nin now render as = ANY($1) / <> ALL($1) with a single array bind — stable prepared-statement cache keys, O(1) SQL size, empty lists fold to constant FALSE/TRUE.
  • CLI connects via sqlx with rustls TLS support (NoTls-only limitation lifted).