Tank
Tank (Table Abstraction & Navigation Kit) is the Rust data layer for teams that want one entity model, explicit queries, and the freedom to move across very different databases without rewriting their whole stack.
One entity model. Any terrain.
📘 Docs: https://tankhq.github.io/tank
🖥️ Repo: https://github.com/TankHQ/tank
📦 Crate: https://crates.io/crates/tank
[!IMPORTANT]
Authenticity Notice: This is not AI slop. It was meticulously crafted by me (human) barsdeveloper.
Mission Briefing
In plain terms, Tank is a thin layer over your database workflow, designed for the Rust operator who needs to deploy across multiple environments without changing the kit. It doesn't matter if you are digging into a local SQLite trench, coordinating a distributed ScyllaDB offensive, or managing a Postgres stronghold, Tank provides a unified interface. You define your entities, Tank handles the ballistics.
Known battlefields:
- Postgres
- SQLite
- MySQL/MariaDB
- DuckDB
- MongoDB
- ScyllaDB/Cassandra
- Valkey/Redis
Mission Objectives
Tank exists to implement the best possible design for a ORM written in Rust. A a clean-slate design focused on ergonomics, flexibility and broad database support.
- Async operations - Fire and forget.
- Designed to be extensible - Swap databases like changing magazines mid-battle.
- SQL and NoSQL support - One Tank, all terrains.
- Transactions abstraction - Commit on success or rollback and retreat.
- Rich type arsenal - Automatic conversions between Rust and database types.
- Optional appender API - High caliber bulk inserts.
- TLS - No open radios on this battlefield.
- Joins - Multi unit coordination.
- Raw SQL - You're never limited by the abstractions provided.
- Zero setup - Skip training. Go straight to live fire.
No-Fly Zone
- No schema migrations (just table creation and destroy for fast setup).
- No implicit joins (no entities as fields, joins are explicit, every alliance is signed).
Why Tank?
Intelligence Report: A quick recon of the battlefield revealed that while existing heavy weaponry is effective, there was a critical need for a more adaptable, cleaner design. Tank was designed from scratch to address these weaknesses.
1. Modular Architecture: Some systems rely on hardcoded enums for database support, which limits flexibility. If a backend isn't in the core list, it cannot be used. Tank is designed to be extensible: a driver can be implemented for any database (SQL or NoSQL) without touching the core library. If it can hold data, Tank can likely target it.
2. Zero Boilerplate: Field operations shouldn't require filling out forms in triplicate. Some tools force data definition twice: once in a complex DSL and again as a Rust struct. Tank keeps it simple: one struct, one definition. The macros handle table creation, selection, and insertion automatically. You can set up tables and get database communication running in just a few lines of code, all through a unified API that works the same regardless of the backend. Perfect for spinning up tests and prototypes rapidly while still scaling to production backends.
Operational Guide
- Arm your cargo
- Choose your battlefield
- Define unit schematics
use Cow;
use ;
- Fire for effect
use ;
use ;
use DuckDBDriver;
async
Examples
Books
let result = executor
.fetch
.map_ok
.map
.
.await
.expect;
assert_eq!;
Radio Logs
let operator = Operator ;
insert_one.await?;
let op_id = operator.id;
let logs: =
.map
.collect;
insert_many.await?;
if let Some = find_one
.await?
let mut query =
prepare_find.await?;
query.bind?;
let _messages: = executor
.fetch
.map_ok
.try_collect
.await?;
Support the Mission
Building and maintaining drivers for half a dozen different databases is a massive effort. If Tank saves your company time, infrastructure headaches, or boilerplate, please consider supporting its development.
Donations ensure that Tank stays maintained, well-tested, and gets new capabilities (like more advanced driver features) faster.
🔗 Sponsor the Commander via GitHub Sponsors
Rustaceans don't hide behind ORMs, they drive Tanks.