Rust ORM Libraries
Rust ORM Libraries
Rust ORM libraries provide memory safety and zero-cost abstractions. Diesel features compile-time type checking and safety, SeaORM offers async processing and migration management, and SQLx provides compile-time SQL validation through macros. They are suitable for systems where performance and security are critical.
GitHub Star Comparison
No | Name | GitHub Stars | Description | Trend | License | Type | Official Site |
---|---|---|---|---|---|---|---|
1 | SQLx | ⭐ 15.5k | SQLx is "The Rust SQL Toolkit" developed as an async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supporting PostgreSQL, MySQL, and SQLite with the concept of "Rust-like safety and performance," it achieves both type safety and SQL's native expressiveness. Providing comprehensive features necessary for full-scale web application development including compile-time query verification, connection pooling, migrations, and SQL injection prevention, it's a modern database library. | stable | MIT OR Apache-2.0 | Library | Official |
2 | Diesel | ⭐ 13.5k | Diesel is the most mature safe and extensible ORM and query builder in the Rust ecosystem. Featuring compile-time type checking, extensive query validation, and established performance, it maximizes Rust's ownership system and type system to guarantee database operation safety. From thin SQLite access wrappers to complex join queries, it supports a wide range of use cases and provides an innovative approach that eliminates runtime errors by verifying SQL syntax and schema consistency at compile time. | stable | MIT OR Apache-2.0 | Library | Official |
3 | SeaORM | ⭐ 8.6k | SeaORM is "an async & dynamic ORM for Rust" developed as a modern ORM (Object-Relational Mapping) library gaining attention in the contemporary Rust ecosystem. It provides native async processing support and powerful type safety for PostgreSQL, MySQL, and SQLite. Developed by the SeaQL team, it implements a Functional Relational Mapping (FRM) approach that achieves compile-time type checking and excellent performance. Integration with major web frameworks like Axum and Actix-web is straightforward, and schema-driven development with code generation significantly improves Rust productivity. | stable | MIT OR Apache-2.0 | Library | Official |
4 | Prisma Client Rust | ⭐ 1.9k | Prisma Client Rust is "a type-safe, auto-generated query builder for Rust" developed as an ORM (Object-Relational Mapping) crate to leverage the Prisma ecosystem in Rust. It provides a consistent and understandable API on top of Prisma's powerful database technology, functioning as an alternative to existing ORMs and tools like Diesel, SeaORM, and SQLx. In Rust applications, it enables consistent type-safe database access from frontend (Tauri, etc.) to server-side while leveraging the entire Prisma ecosystem. | stable | Apache-2.0 | Library | Official |
5 | Rustorm | ⭐ 250 | Rustorm is a Rust-exclusive Object-Relational Mapping (ORM) library that is "a SQL-centered ORM library with a focus on ease of use on conversion of database types to their appropriate Rust type." Rather than abstracting SQL away, it emphasizes SQL operations, providing a lightweight and practical approach that supports PostgreSQL and SQLite databases. Through derive macros (ToDao, FromDao, ToColumnNames, ToTableName) for struct definitions, it achieves type-safe database operations and enables the construction of performance-focused data access layers that leverage Rust's Memory Safety and Zero-cost Abstraction benefits. | stable | MIT | Library | Official |
6 | tokio-postgres | - | tokio-postgres is developed as "A native, asynchronous PostgreSQL client for Rust" - an asynchronous PostgreSQL client library for Rust. Fully integrated with the Tokio runtime, it provides non-blocking, high-performance database operations. It offers direct, low-level access to SQL queries without heavyweight ORM abstraction layers, making it ideal for performance-critical applications and systems requiring complete SQL control. | stable | MIT OR Apache-2.0 | Library | Official |