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

Rust ORM Libraries GitHub Star Comparison
NoNameGitHub StarsDescriptionTrendLicenseTypeOfficial Site
1SQLx⭐ 15.5kSQLx 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.stableMIT OR Apache-2.0LibraryOfficial
2Diesel⭐ 13.5kDiesel 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.stableMIT OR Apache-2.0LibraryOfficial
3SeaORM⭐ 8.6kSeaORM 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.stableMIT OR Apache-2.0LibraryOfficial
4Prisma Client Rust⭐ 1.9kPrisma 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.stableApache-2.0LibraryOfficial
5Rustorm⭐ 250Rustorm 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.stableMITLibraryOfficial
6tokio-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.stableMIT OR Apache-2.0LibraryOfficial