storeit_mysql_async

Crates.iostoreit_mysql_async
lib.rsstoreit_mysql_async
version0.1.7
created_at2025-08-22 11:20:48.570341+00
updated_at2025-08-28 08:37:50.442018+00
descriptionMySQL backend adapter (mysql_async) for the storeit repository framework
homepage
repositoryhttps://github.com/dahankzter/storeit-rs/
max_upload_size
id1806208
size127,922
Henrik Johansson (dahankzter)

documentation

README

storeit_mysql_async

Crates.io Docs.rs

MySQL backend adapter for storeit, built on mysql_async.

  • Feature: mysql-async enables the implementation using the mysql_async crate and Tokio runtime.
  • Provides MysqlAsyncRepository<T, A> and a MysqlAsyncTransactionManager.

Quick start:

use storeit_core::{RowAdapter, Repository};
use storeit_mysql_async::MysqlAsyncRepository;

#[derive(Clone, Debug)]
struct User { id: Option<i64>, email: String, active: bool }
// implement Fetchable/Identifiable/Insertable/Updatable for User...
struct UserAdapter;
impl RowAdapter<User> for UserAdapter {
    type Row = mysql_async::Row;
    fn from_row(&self, row: &Self::Row) -> storeit_core::RepoResult<User> { /* map columns */ }
}
# async fn demo() -> storeit_core::RepoResult<()> {
let repo = MysqlAsyncRepository::from_url("mysql://user:pass@localhost:3306/db", UserAdapter).await?;
let _ = repo.find_by_id(&1).await?;
# Ok(()) }

Integration tests (ignored by default) can run against a MariaDB/MySQL Testcontainers image.

MSRV: 1.70 License: MIT OR Apache-2.0

Commit count: 26

cargo fmt