Skip to content
rusthacks.dev
Topic

Rust

The language itself: ownership, lifetimes, error handling, Serde and the idioms that make the borrow checker feel like help.

Flat illustration for the post “SQLx Error Handling and Unique Violation Detection”, composed around database.
Databases

SQLx Error Handling and Unique Violation Detection

Turn a PostgreSQL unique violation into a friendly conflict instead of a 500. Check is_unique_violation on the database error, read the constraint name and map foreign key errors too.

3 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.