#mysql #async #storeit #back-end #repository

storeit_mysql_async

MySQL backend adapter (mysql_async) for the storeit repository framework

6 releases

0.1.7 Aug 28, 2025
0.1.6 Aug 28, 2025

#4 in #storeit

Download history 1/week @ 2025-09-18 11/week @ 2025-09-25 12/week @ 2025-10-02 1/week @ 2025-10-09 10/week @ 2025-10-16

146 downloads per month
Used in 2 crates

MIT/Apache

91KB
2K SLoC

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

Dependencies

~0.6–16MB
~142K SLoC