Databases and storage · Library

sqlx

A Rust library for talking to SQL databases that checks your queries against the real database while the code compiles.

Talking to a database · Open source · updated

How it works

sqlx is asynchronous (it runs on Tokio) and supports PostgreSQL, MySQL and SQLite. Its query macros connect to a development database, or read a saved snapshot, at build time and confirm that each query is valid and that the Rust types match the columns, so a renamed column breaks the build instead of the app.

It is not an ORM: you write plain SQL and get typed rows back. It also ships a migration runner.

sqlx pricing

Open source

Free (MIT or Apache 2.0).

Approximate, checked September 2026.What the other tools cost

More in Databases and storage

Talking to a database

All 25 Databases and storage terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.