1 unstable release

0.0.1 Aug 29, 2024

#10 in #typesafe

Download history 116/week @ 2024-08-27

116 downloads per month

MIT license

27KB
479 lines

Besu MySQL

MySQL dialect and driver for Besu a typesafe, async, and database-agnostic query builder for Rust.

Checkout the documentation for more information.


lib.rs:

MySQL dialect and driver for Besu.

Example

use besu::{Database, Table};
use besu_mysql::Sqlx;

#[derive(Debug, Table)]
pub struct User {
    pub id: i32,
    pub name: String,
}

#[tokio::main]
async fn main() {
    let db = Database::new(
        Sqlx::new("mysql://root:@localhost:3306/besu")
            .await
            .unwrap(),
    );

    // TODO: Insert a user

    println!("{:#?}", db.select(User).await.unwrap());
}

Dependencies

~0–12MB
~134K SLoC