Skip to content
rusthacks.dev

Library

Everything you need to level up your coding skills.

Flat illustration for the post “Per Test Databases in Rust With SQLx Test Attribute”, composed around testing.
Databases

Per Test Databases in Rust With SQLx Test Attribute

The sqlx::test attribute creates a fresh database for each test, runs your migrations, hands you a pool and drops it afterwards. Learn fixtures, the DATABASE_URL requirement, parallelism and common errors.

3 min read
Flat illustration for the post “Testing Database Code in Rust With Test Containers”, composed around deploy.
Databases

Testing Database Code in Rust With Test Containers

Run tests against a real PostgreSQL in a disposable container with the testcontainers crate. Start one per test run, migrate, isolate tests with transactions or databases, and keep CI fast with reuse.

4 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.