storeit_mysql_async 0.1.7

MySQL backend adapter (mysql_async) for the storeit repository framework
Documentation

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