Skip to main content

Database

Rust provides an impressive ecosystem of database integration crates, from full-fledged ORM libraries to lightweight SQL query builders. One of the most popular ORMs is SeaORM, which comes with a rich set of features and fantastic documentation to help you get started here. Since the official documentation already does an excellent job, we'll focus more on SQLx in this section.

We’ll also explore other crates that fit different needs, from performance to flexibility, depending on your project requirements.

CrateWhen to UseLink
SeaORMBest for feature-rich, full ORM solutions with async capabilities and strong documentation.SeaORM Docs
SQLxFor async, compile-time checked SQL queries across multiple databases. Highly performant.SQLx Repo
DieselWhen you need synchronous, schema-first queries and powerful query DSL support.Diesel Repo
TiberiusFor Microsoft SQL Server integrations, async support, and feature completeness.Tiberius Repo
SurrealDBAn advanced distributed database, ideal for handling structured and unstructured data at scale.SurrealDB