SeaORM is a relational ORM for Rust that enables developers to build web services with type-safe database access.
SeaORM addresses the need for ergonomic database interaction in Rust by providing an ORM inspired by popular frameworks in Ruby, Python, and Node.js ecosystems. It handles complex relationships including one-to-one, one-to-many, many-to-many, and self-referential patterns through high-level abstractions. The tool includes an entity loader that intelligently uses joins for one-to-one relations and data loaders for one-to-many relations, eliminating the N+1 query problem even in nested queries. ActiveModel enables persisting entire object graphs in a single operation through a fluent builder API, with automatic dependency resolution for correct insertion and deletion order. The project supports both schema-first and entity-first workflows, offering a migration system for schema management and automatic detection of entity changes to generate tables, columns, and foreign keys.
SeaORM suits teams building REST, GraphQL, and gRPC APIs in Rust who want a batteries-included ORM with built-in filtering, pagination, and nested query support. It works with PostgreSQL, MySQL, MariaDB, and SQLite. The tool provides integration examples across multiple web frameworks including Actix, Axum, Rocket, Poem, and Salvo, making it adaptable to different architectural choices. Developers familiar with ORMs from other language ecosystems will recognize the conceptual patterns and API design.
The project maintains active development with regular updates and examples demonstrating integration across diverse frameworks and use cases. The codebase includes comprehensive documentation and a quickstart example for new users. The tool has established production usage across startups and enterprises, indicating maturity and reliability in real-world applications.