SeaORM
🐚 An async & dynamic ORM for Rust
[](https://crates.io/crates/sea-orm)
[](https://docs.rs/sea-orm)
[](https://github.com/SeaQL/sea-orm/actions/workflows/rust.yml)
# SeaORM
#### SeaORM is a relational ORM to help you build web services in Rust with the familiarity of dynamic languages.
## Getting Started
[](https://github.com/SeaQL/sea-orm/stargazers/)
If you like what we do, consider starring, commenting, sharing and contributing!
[](https://discord.com/invite/uCPdDXzbdv)
Join our Discord server to chat with others in the SeaQL community!
+ [Getting Started](https://www.sea-ql.org/SeaORM/docs/index)
+ [Step-by-step Tutorials](https://www.sea-ql.org/sea-orm-tutorial/)
+ [Cookbook](https://www.sea-ql.org/sea-orm-cookbook/)
+ [Usage Example](https://github.com/SeaQL/sea-orm/tree/master/examples/basic)
Integration examples
+ [Actix v4 Example](https://github.com/SeaQL/sea-orm/tree/master/examples/actix_example)
+ [Actix v3 Example](https://github.com/SeaQL/sea-orm/tree/master/examples/actix3_example)
+ [Axum Example](https://github.com/SeaQL/sea-orm/tree/master/examples/axum_example)
+ [GraphQL Example](https://github.com/SeaQL/sea-orm/tree/master/examples/graphql_example)
+ [jsonrpsee Example](https://github.com/SeaQL/sea-orm/tree/master/examples/jsonrpsee_example)
+ [Poem Example](https://github.com/SeaQL/sea-orm/tree/master/examples/poem_example)
+ [Rocket Example](https://github.com/SeaQL/sea-orm/tree/master/examples/rocket_example)
+ [Salvo Example](https://github.com/SeaQL/sea-orm/tree/master/examples/salvo_example)
+ [Tonic Example](https://github.com/SeaQL/sea-orm/tree/master/examples/tonic_example)
## Features
1. Async
Relying on [SQLx](https://github.com/launchbadge/sqlx), SeaORM is a new library with async support from day 1.
2. Dynamic
Built upon [SeaQuery](https://github.com/SeaQL/sea-query), SeaORM allows you to build complex queries without 'fighting the ORM'.
3. Testable
Use mock connections to write unit tests for your logic.
4. Service Oriented
Quickly build services that join, filter, sort and paginate data in APIs.
## A quick taste of SeaORM
### Entity
```rust
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "cake")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::fruit::Entity")]
Fruit,
}
impl Related