Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

microrm is a simple object relational manager (ORM) for sqlite that requires no external tooling, keeping all specifications in natural Rust types with no DSLs and few annotations. It supports zero-allocation queries, the standard battery of entity relationships, migrations, and leverages the Rust type system for type-safe entity access and querying.

Unlike heavier-weight ORM systems, microrm is designed to be lightweight both in terms of boilerplate and runtime speed. By necessity, microrm sacrifices some flexibility in favour of these goals, and so can be thought of as more opinionated than SeaORM or Diesel — both of which are fine libraries in their own right, but they solve a different problem than microrm. In particular, you might want microrm if:

  • You don’t have to deal with an existing schema from a different ORM.
  • You want your server/application to run with a minimal number of external runtime dependencies, such as database servers.
  • You care about having a minimal crate dependency tree.
  • Your application lives on the same server that stores its database.
  • You want type-safety to sit front and centre for your database interactions.

As of the writing of this book, the latest stable release is 0.7.0. Details may change as the library itself evolves; double-check what version you’re using if something here doesn’t match up with what your compiler or API documentation reports.

Interested? Take a look at the quickstart, or start reading about the data model.