{"id":17431964,"url":"https://github.com/kazuma512/sea-orm","last_synced_at":"2026-04-12T02:32:26.702Z","repository":{"id":176388242,"uuid":"657214021","full_name":"kazuma512/sea-orm","owner":"kazuma512","description":"SeaORM is a Rust ORM (Object Relational Mapping) library that provides an easy-to-use and efficient API for developers to interact with databases.","archived":false,"fork":false,"pushed_at":"2023-06-22T18:33:53.000Z","size":5947,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T17:08:21.077Z","etag":null,"topics":["database","graphql","kazuma512","orm","rocket","rust"],"latest_commit_sha":null,"homepage":"https://www.sea-ql.org/SeaORM/docs/index/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kazuma512.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-22T15:04:34.000Z","updated_at":"2024-04-16T09:23:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"efdd0ed6-6744-4291-971b-8610077cc5cf","html_url":"https://github.com/kazuma512/sea-orm","commit_stats":null,"previous_names":["uchiha123456/sea-orm","kazuma512/sea-orm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kazuma512/sea-orm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazuma512%2Fsea-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazuma512%2Fsea-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazuma512%2Fsea-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazuma512%2Fsea-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kazuma512","download_url":"https://codeload.github.com/kazuma512/sea-orm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazuma512%2Fsea-orm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31702579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","graphql","kazuma512","orm","rocket","rust"],"created_at":"2024-10-17T08:09:20.597Z","updated_at":"2026-04-12T02:32:26.687Z","avatar_url":"https://github.com/kazuma512.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003cimg src=\"https://www.sea-ql.org/SeaORM/img/SeaORM banner.png\"/\u003e\n\n  \u003ch1\u003eSeaORM\u003c/h1\u003e\n\n  \u003ch3\u003e🐚 An async \u0026 dynamic ORM for Rust\u003c/h3\u003e\n\n\u003c/div\u003e\n\n# SeaORM\n\n#### SeaORM is a relational ORM to help you build web services in Rust with the familiarity of dynamic languages.\n\n## Getting Started\n\n[![GitHub stars](https://img.shields.io/github/stars/SeaQL/sea-orm.svg?style=social\u0026label=Star\u0026maxAge=1)](https://github.com/SeaQL/sea-orm/stargazers/)\nIf you like what we do, consider starring, commenting, sharing and contributing!\n\n[![Discord](https://img.shields.io/discord/873880840487206962?label=Discord)](https://discord.com/invite/uCPdDXzbdv)\nJoin our Discord server to chat with others in the SeaQL community!\n\n+ [Getting Started](https://www.sea-ql.org/SeaORM/docs/index)\n+ [Step-by-step Tutorials](https://www.sea-ql.org/sea-orm-tutorial/)\n+ [Cookbook](https://www.sea-ql.org/sea-orm-cookbook/)\n+ [Usage Example](https://github.com/SeaQL/sea-orm/tree/master/examples/basic)\n\nIntegration examples\n\n+ [Actix v4 Example](https://github.com/SeaQL/sea-orm/tree/master/examples/actix_example)\n+ [Actix v3 Example](https://github.com/SeaQL/sea-orm/tree/master/examples/actix3_example)\n+ [Axum Example](https://github.com/SeaQL/sea-orm/tree/master/examples/axum_example)\n+ [GraphQL Example](https://github.com/SeaQL/sea-orm/tree/master/examples/graphql_example)\n+ [jsonrpsee Example](https://github.com/SeaQL/sea-orm/tree/master/examples/jsonrpsee_example)\n+ [Poem Example](https://github.com/SeaQL/sea-orm/tree/master/examples/poem_example)\n+ [Rocket Example](https://github.com/SeaQL/sea-orm/tree/master/examples/rocket_example)\n+ [Salvo Example](https://github.com/SeaQL/sea-orm/tree/master/examples/salvo_example)\n+ [Tonic Example](https://github.com/SeaQL/sea-orm/tree/master/examples/tonic_example)\n\n## Features\n\n1. Async\n\n    Relying on [SQLx](https://github.com/launchbadge/sqlx), SeaORM is a new library with async support from day 1.\n\n2. Dynamic\n\n    Built upon [SeaQuery](https://github.com/SeaQL/sea-query), SeaORM allows you to build complex queries without 'fighting the ORM'.\n\n3. Testable\n\n    Use mock connections to write unit tests for your logic.\n\n4. Service Oriented\n\n    Quickly build services that join, filter, sort and paginate data in APIs.\n\n## A quick taste of SeaORM\n\n### Entity\n```rust\nuse sea_orm::entity::prelude::*;\n\n#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]\n#[sea_orm(table_name = \"cake\")]\npub struct Model {\n    #[sea_orm(primary_key)]\n    pub id: i32,\n    pub name: String,\n}\n\n#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]\npub enum Relation {\n    #[sea_orm(has_many = \"super::fruit::Entity\")]\n    Fruit,\n}\n\nimpl Related\u003csuper::fruit::Entity\u003e for Entity {\n    fn to() -\u003e RelationDef {\n        Relation::Fruit.def()\n    }\n}\n```\n\n### Select\n```rust\n// find all models\nlet cakes: Vec\u003ccake::Model\u003e = Cake::find().all(db).await?;\n\n// find and filter\nlet chocolate: Vec\u003ccake::Model\u003e = Cake::find()\n    .filter(cake::Column::Name.contains(\"chocolate\"))\n    .all(db)\n    .await?;\n\n// find one model\nlet cheese: Option\u003ccake::Model\u003e = Cake::find_by_id(1).one(db).await?;\nlet cheese: cake::Model = cheese.unwrap();\n\n// find related models (lazy)\nlet fruits: Vec\u003cfruit::Model\u003e = cheese.find_related(Fruit).all(db).await?;\n\n// find related models (eager)\nlet cake_with_fruits: Vec\u003c(cake::Model, Vec\u003cfruit::Model\u003e)\u003e =\n    Cake::find().find_with_related(Fruit).all(db).await?;\n\n```\n### Insert\n```rust\nlet apple = fruit::ActiveModel {\n    name: Set(\"Apple\".to_owned()),\n    ..Default::default() // no need to set primary key\n};\n\nlet pear = fruit::ActiveModel {\n    name: Set(\"Pear\".to_owned()),\n    ..Default::default()\n};\n\n// insert one\nlet pear = pear.insert(db).await?;\n\n// insert many\nFruit::insert_many([apple, pear]).exec(db).await?;\n```\n### Update\n```rust\nuse sea_orm::sea_query::{Expr, Value};\n\nlet pear: Option\u003cfruit::Model\u003e = Fruit::find_by_id(1).one(db).await?;\nlet mut pear: fruit::ActiveModel = pear.unwrap().into();\n\npear.name = Set(\"Sweet pear\".to_owned());\n\n// update one\nlet pear: fruit::Model = pear.update(db).await?;\n\n// update many: UPDATE \"fruit\" SET \"cake_id\" = NULL WHERE \"fruit\".\"name\" LIKE '%Apple%'\nFruit::update_many()\n    .col_expr(fruit::Column::CakeId, Expr::value(Value::Int(None)))\n    .filter(fruit::Column::Name.contains(\"Apple\"))\n    .exec(db)\n    .await?;\n\n```\n### Save\n```rust\nlet banana = fruit::ActiveModel {\n    id: NotSet,\n    name: Set(\"Banana\".to_owned()),\n    ..Default::default()\n};\n\n// create, because primary key `id` is `NotSet`\nlet mut banana = banana.save(db).await?;\n\nbanana.name = Set(\"Banana Mongo\".to_owned());\n\n// update, because primary key `id` is `Set`\nlet banana = banana.save(db).await?;\n\n```\n### Delete\n```rust\n// delete one\nlet orange: Option\u003cfruit::Model\u003e = Fruit::find_by_id(1).one(db).await?;\nlet orange: fruit::Model = orange.unwrap();\nfruit::Entity::delete(orange.into_active_model())\n    .exec(db)\n    .await?;\n\n// or simply\nlet orange: Option\u003cfruit::Model\u003e = Fruit::find_by_id(1).one(db).await?;\nlet orange: fruit::Model = orange.unwrap();\norange.delete(db).await?;\n\n// delete many: DELETE FROM \"fruit\" WHERE \"fruit\".\"name\" LIKE 'Orange'\nfruit::Entity::delete_many()\n    .filter(fruit::Column::Name.contains(\"Orange\"))\n    .exec(db)\n    .await?;\n\n```\n\n## Learn More\n\n1. [Design](https://github.com/SeaQL/sea-orm/tree/master/DESIGN.md)\n1. [Architecture](https://www.sea-ql.org/SeaORM/docs/internal-design/architecture/)\n1. [Release Model](https://www.sea-ql.org/SeaORM/blog/2021-08-30-release-model)\n1. [Change Log](https://github.com/SeaQL/sea-orm/tree/master/CHANGELOG.md)\n\n## Who's using SeaORM?\n\nThe following products are powered by SeaORM:\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cbr\u003e\u003ca href=\"https://caido.io/\"\u003e\u003cimg src=\"https://www.sea-ql.org/SeaORM/img/other/caido-logo.png\" width=\"250\"/\u003e\u003c/a\u003e\u003cbr\u003eA lightweight web security auditing toolkit\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.svix.com/\"\u003e\u003cimg src=\"https://www.sea-ql.org/SeaORM/img/other/svix-logo.svg\" width=\"250\"/\u003e\u003c/a\u003e\u003cbr\u003eThe enterprise ready webhooks service\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.spyglass.fyi/\"\u003e\u003cimg src=\"https://www.sea-ql.org/SeaORM/img/other/spyglass-logo.svg\" width=\"250\"/\u003e\u003c/a\u003e\u003cbr/\u003eA personal search engine\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nSeaORM is the foundation of:\n+ [StarfishQL](https://github.com/SeaQL/starfish-ql): an experimental graph database\n+ [Seaography](https://github.com/SeaQL/seaography): GraphQL framework for SeaORM\n\nFor more projects, see [Built with SeaORM](https://github.com/SeaQL/sea-orm/blob/master/COMMUNITY.md#built-with-seaorm).\n\n## License\n\nLicensed under either of\n\n-   Apache License, Version 2.0\n    ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n-   MIT license\n    ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n## Mascot\n\nA friend of Ferris, Terres the hermit crab is the official mascot of SeaORM. His hobby is collecting shells.\n\n\u003cimg alt=\"Terres\" src=\"https://www.sea-ql.org/SeaORM/img/Terres.png\" width=\"400\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazuma512%2Fsea-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkazuma512%2Fsea-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazuma512%2Fsea-orm/lists"}