3 unstable releases

0.13.1 Apr 14, 2024
0.13.0 Dec 9, 2023
0.12.0 Sep 23, 2023

#2086 in Database interfaces

MIT/Apache

3.5MB
6.5K SLoC

Rust 5K SLoC // 0.0% comments JavaScript 1.5K SLoC // 0.0% comments

aide-axum-sqlx-tx

A drop-in replacement for axum-sqlx-tx that provides an aide compatible re-export.

It is not the original type, but it implements deref and deref-mut, so if you have issues and need the real axum-sqlx-tx::Tx type try using the deref operator: *tx or &*tx or &mut *tx

Features

  • default or sqlx-07: uses axum-sqlx-tx:0.6.0 and is compatible with sqlx:0.7
  • sqlx-06: overrides default sqlx-07 and uses axum-sqlx-tx:0.5.0 and is compatible with sqlx:0.6
  • all the axum-sqlx-tx features except sqlite due to build issues.

Example

use aide_axum_sqlx_tx::Tx;
use sqlx::{Postgres, query};

async fn get_hello_world(
     mut tx: Tx<Postgres>,
 ) -> Result<String, String> {
    let (res,): (String,) = sqlx::query_as("select 'hello world'")
    .fetch_one(&mut *tx) // deref mut
    .await.map_err(|err|err.to_string())?;
    Ok(res)
 }

Dependencies

~9–28MB
~446K SLoC