1 unstable release
0.0.1 | Aug 29, 2024 |
---|
#7 in #typesafe
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–11MB
~136K SLoC