| Crates.io | storeit_mysql_async |
| lib.rs | storeit_mysql_async |
| version | 0.1.7 |
| created_at | 2025-08-22 11:20:48.570341+00 |
| updated_at | 2025-08-28 08:37:50.442018+00 |
| description | MySQL backend adapter (mysql_async) for the storeit repository framework |
| homepage | |
| repository | https://github.com/dahankzter/storeit-rs/ |
| max_upload_size | |
| id | 1806208 |
| size | 127,922 |
MySQL backend adapter for storeit, built on mysql_async.
mysql-async enables the implementation using the mysql_async crate and Tokio runtime.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