A powerful, async relational ORM for Rust with advanced relations, nested persistence, and GraphQL integration.
SeaORM is a relational Object-Relational Mapping library for Rust that provides a high-level, async interface for interacting with databases like PostgreSQL, SQLite, and MySQL. It solves the problem of writing repetitive and error-prone SQL by offering a type-safe, expressive API for modeling relationships, performing queries, and handling migrations. It is designed to accelerate the development of REST, GraphQL, and gRPC APIs.
Rust developers building data-intensive web services, backends, or applications that require complex database interactions and relationships. It is particularly suited for teams seeking a production-ready ORM with features like nested persistence and GraphQL integration.
Developers choose SeaORM for its advanced relationship modeling, performance optimizations like the Smart Entity Loader to prevent N+1 queries, and its comprehensive feature set including migrations, raw SQL support, and seamless integration with popular Rust web frameworks. Its philosophy of being 'batteries-included' reduces boilerplate and accelerates development.
🐚 A powerful relational ORM for Rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles 1-1, 1-N, M-N, and self-referential relationships with high-level abstractions, as shown in the entity format examples, making complex data schemas intuitive to define.
Intelligently uses joins for 1-1 and data loaders for 1-N relations to eliminate N+1 queries in nested loads, demonstrated in the code snippet with only three queries for a user with profile and posts.
ActiveModel allows persisting entire object graphs like user, profile, posts, and tags in a single save() operation with automatic dependency resolution, reducing transactional boilerplate.
Enables automatic schema creation and synchronization from Rust entities when using the entity-registry feature, streamlining database migrations as highlighted in the 2.0 blog posts.
SQL Server support is locked behind SeaORM-X, a commercial offering based on SeaORM 1.0, creating fragmentation and added cost for enterprises needing MSSQL compatibility.
SeaORM 2.0 introduces breaking changes requiring a migration guide, which can disrupt existing projects and increase maintenance effort, as admitted in the release notes.
Core functionalities like entity-registry and schema-sync require enabling specific feature flags, adding setup steps and potential confusion for new users beyond basic usage.