Skip to content
rusthacks.dev

Tag

patterns

6 posts

Flat illustration for the post “Repository Pattern in Rust and Whether You Need It”, composed around traits.
Databases

Repository Pattern in Rust and Whether You Need It

A repository hides the database behind a trait. See when that helps (testing, swapping stores) and when it only adds indirection, with a concrete trait, an SQLx impl and an in-memory fake.

3 min read