tank-mysql
MySQL and MariaDB driver implementation for Tank: the Rust data layer.
Implements Tank’s Driver and related traits for MySQL and MariaDB, mapping Tank operations and queries into direct MySQL commands. It does not replace the main tank crate. You still need it to define entities, manage schemas, and build queries.
📘 https://tankhq.github.io/tank
🖥️ https://github.com/TankHQ/tank
📦 https://crates.io/crates/tank
Features
- Async connection and execution via
mysql_async - TLS support via
native-tls - Support for MariaDB and MySQL
Install
Quick Start
use ;
use MySQLDriver;
let driver = new;
let connection = driver
.connect
.await?;
Running Tests
Tests need a MySQL instance. Provide a connection URL via TANK_MYSQL_TEST. If absent, a containerized MySQL will be launched automatically using testcontainers-modules.
- Ensure Docker is running (linux):
- Add your user to the
dockergroup if needed (linux):
[!CAUTION] Avoid aborting tests mid‑run (e.g. killing the process at a breakpoint). Containers might be left running and consume resources.
List containers:
Stop container: