Besu

A typesafe, async, database-agnostic SQL query builder for Rust.

Besu is a typesafe, async, database-agnostic SQL query builder for Rust. It is not an ORM: every query you write maps onto exactly the SQL you would have written by hand, and the compiler checks the parts it can see — column names, column types, nullability, which tables are in the query, and whether a bulk write was intentional.

The structure follows Drizzle ORM, because that is where the design comes from. If you know Drizzle, the pages here will feel familiar; if you do not, read them in order.

Fundamentals

Manage schema

Access your data

Migrations

Advanced

Reference

  • Performance — what a query costs, with numbers
  • Architecture — the crate graph and how a query becomes SQL
  • Writing a driver — Dialect, Driver, SchemaDriver, Ddl, Decode
  • Comparison — Besu against Diesel, SeaORM, sqlx and Drizzle
  • Roadmap — what is missing, and what it would take

How to read a page

Pages are code first: a short statement of what the thing is, an example you can paste, then the details that are easy to get wrong. Each page ends with What is checked or Gotchas — the honest part, where the compiler stops helping and what still bites.

Examples use SQLite because it needs no server. The same query code works with every driver; only the connection setup changes.