Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Prisma | 35,087 | 442 | 16 hours ago | 4,993 | September 24, 2022 | 3,033 | apache-2.0 | TypeScript | ||
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB | ||||||||||
Typeorm | 32,562 | 1,994 | 3,683 | 2 days ago | 784 | October 05, 2023 | 2,296 | mit | TypeScript | |
ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms. | ||||||||||
Prisma1 | 16,626 | 592 | 12 | a year ago | 859 | January 12, 2021 | 2 | apache-2.0 | Scala | |
💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated] | ||||||||||
Efcore | 12,983 | 3,575 | 9,591 | 20 hours ago | 188 | November 14, 2023 | 1,997 | mit | C# | |
EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. | ||||||||||
Greendao | 12,595 | 781 | 6 | 18 days ago | 11 | November 12, 2015 | 235 | Java | ||
greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases. | ||||||||||
Sqlalchemy | 8,099 | 41,853 | 5,930 | a day ago | 294 | November 02, 2023 | 207 | mit | Python | |
The Database Toolkit for Python | ||||||||||
Exposed | 7,599 | 41 | 20 hours ago | 27 | November 28, 2023 | 247 | apache-2.0 | Kotlin | ||
Kotlin SQL Framework | ||||||||||
Sled | 7,410 | 43 | 292 | 24 days ago | 100 | September 11, 2023 | 138 | apache-2.0 | Rust | |
the champagne of beta embedded databases | ||||||||||
Mikro Orm | 6,674 | 189 | 17 hours ago | 2,311 | December 04, 2023 | 55 | mit | TypeScript | ||
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases. | ||||||||||
Bookshelf | 6,338 | 6,417 | 442 | 2 months ago | 88 | June 07, 2020 | 235 | mit | JavaScript | |
A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js |
If you like what we do, consider starring, sharing and contributing!
Please help us with maintaining SeaORM by completing the SeaQL Community Survey 2023!
Integration examples:
Join our Discord server to chat with other members of the SeaQL community!
Professional support on Rust programming and best practices is available. You can email us for a quote!
Async
Relying on SQLx, SeaORM is a new library with async support from day 1.
Dynamic
Built upon SeaQuery, SeaORM allows you to build complex dynamic queries.
Testable
Use mock connections and/or SQLite to write tests for your application logic.
Service Oriented
Quickly build services that join, filter, sort and paginate data in REST, GraphQL and gRPC APIs.
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<super::fruit::Entity> for Entity {
fn to() -> RelationDef {
Relation::Fruit.def()
}
}
// find all models
let cakes: Vec<cake::Model> = Cake::find().all(db).await?;
// find and filter
let chocolate: Vec<cake::Model> = Cake::find()
.filter(cake::Column::Name.contains("chocolate"))
.all(db)
.await?;
// find one model
let cheese: Option<cake::Model> = Cake::find_by_id(1).one(db).await?;
let cheese: cake::Model = cheese.unwrap();
// find related models (lazy)
let fruits: Vec<fruit::Model> = cheese.find_related(Fruit).all(db).await?;
// find related models (eager)
let cake_with_fruits: Vec<(cake::Model, Vec<fruit::Model>)> =
Cake::find().find_with_related(Fruit).all(db).await?;
let apple = fruit::ActiveModel {
name: Set("Apple".to_owned()),
..Default::default() // no need to set primary key
};
let pear = fruit::ActiveModel {
name: Set("Pear".to_owned()),
..Default::default()
};
// insert one
let pear = pear.insert(db).await?;
// insert many
Fruit::insert_many([apple, pear]).exec(db).await?;
use sea_orm::sea_query::{Expr, Value};
let pear: Option<fruit::Model> = Fruit::find_by_id(1).one(db).await?;
let mut pear: fruit::ActiveModel = pear.unwrap().into();
pear.name = Set("Sweet pear".to_owned());
// update one
let pear: fruit::Model = pear.update(db).await?;
// update many: UPDATE "fruit" SET "cake_id" = NULL WHERE "fruit"."name" LIKE '%Apple%'
Fruit::update_many()
.col_expr(fruit::Column::CakeId, Expr::value(Value::Int(None)))
.filter(fruit::Column::Name.contains("Apple"))
.exec(db)
.await?;
let banana = fruit::ActiveModel {
id: NotSet,
name: Set("Banana".to_owned()),
..Default::default()
};
// create, because primary key `id` is `NotSet`
let mut banana = banana.save(db).await?;
banana.name = Set("Banana Mongo".to_owned());
// update, because primary key `id` is `Set`
let banana = banana.save(db).await?;
// delete one
let orange: Option<fruit::Model> = Fruit::find_by_id(1).one(db).await?;
let orange: fruit::Model = orange.unwrap();
fruit::Entity::delete(orange.into_active_model())
.exec(db)
.await?;
// or simply
let orange: Option<fruit::Model> = Fruit::find_by_id(1).one(db).await?;
let orange: fruit::Model = orange.unwrap();
orange.delete(db).await?;
// delete many: DELETE FROM "fruit" WHERE "fruit"."name" LIKE 'Orange'
fruit::Entity::delete_many()
.filter(fruit::Column::Name.contains("Orange"))
.exec(db)
.await?;
Seaography is a GraphQL framework built on top of SeaORM. Seaography allows you to build GraphQL resolvers quickly. With just a few commands, you can launch a GraphQL server from SeaORM entities!
Starting 0.12
, seaography
integration is built into sea-orm
. While Seaography development is still in an early stage, it is especially useful in prototyping and building internal-use admin panels.
Look at the Seaography Example to learn more.
The following products are powered by SeaORM:
![]() A lightweight web security auditing toolkit |
The enterprise ready webhooks service |
A personal search engine |
For more projects, see Built with SeaORM. Feel free to submit yours!
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
SeaORM is a community driven project. We welcome you to participate, contribute and together help build Rust's future.
A big shout out to our contributors!
SeaQL.org is an independent open-source organization run by passionate developers. If you enjoy using our libraries, please star and share our repositories. If you feel generous, a small donation via GitHub Sponsor will be greatly appreciated, and goes a long way towards sustaining the organization.
We invite you to participate, contribute and together help build Rust's future.
A friend of Ferris, Terres the hermit crab is the official mascot of SeaORM. His hobby is collecting shells.