| Crates.io | tank-postgres |
| lib.rs | tank-postgres |
| version | 0.16.0 |
| created_at | 2025-10-09 19:45:44.887949+00 |
| updated_at | 2026-01-20 23:42:04.866092+00 |
| description | Postgres driver implementation for Tank: the Rust data layer |
| homepage | |
| repository | https://github.com/TankHQ/tank |
| max_upload_size | |
| id | 1876124 |
| size | 156,885 |
Postgres driver implementation for Tank: the Rust data layer.
Implements Tank’s Driver and related traits for Postgres, mapping Tank operations and queries into direct Postgres commands. It does not replace the main tank crate. you still use it to define entities, manage schemas, and build queries.
https://tankhq.github.io/tank/
https://github.com/TankHQ/tank ⭐
tokio-postgrespostgres-opensslcargo add tank
cargo add tank-postgres
use tank::{Connection, Driver, Executor};
use tank_postgres::PostgresDriver;
let driver = PostgresDriver::new();
let connection = driver
.connect("postgres://user:pass@hostname:5432/database?sslmode=require&sslrootcert=/path/to/root.crt&sslcert=/path/to/client.crt&sslkey=/path/to/client.key".into())
.await?;
Tests need a Postgres instance. Provide a connection URL via TANK_POSTGRES_TEST. If absent, a containerized Postgres will be launched automatically using testcontainers-modules.
systemctl status docker
docker group if needed (linux):sudo usermod -aG docker $USER
[!CAUTION] Avoid aborting tests mid‑run (e.g. killing the process at a breakpoint). Containers might be left running and consume resources.
List containers:
docker psStop container:
docker kill <container_id_or_name>