---
name: "sea-orm-async-dynamic-rust-orm"
description: "Build async SQL database applications in Rust with SeaORM, Tokio, and SQLx under the hood."
metadata:
  author: "SeaQL"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "define sea-orm entity"
  - "sea-orm async crud queries"
  - "run sea-orm migrations"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# SeaORM Async & Dynamic Object-Relational Mapping for Rust

Develops with SeaORM: defining Entities (Model, Column, ActiveModel), async CRUD operations, relationship navigation (find_also_related), migrations with sea-orm-migration, and dynamic query builders.

## When to Invoke
Invoke this skill whenever you need to:
- define sea-orm entity
- sea-orm async crud queries
- run sea-orm migrations

## Execution SOP & Rules
1. Define entity: #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = 'posts')].
2. Connect: let db = Database::connect('postgres://...').await?;
3. Query records: let posts = Post::find().filter(post::Column::Title.contains('Rust')).all(&db).await?;
4. Mutate records: let mut post: post::ActiveModel = post.into(); post.title = Set('New'.into()); post.update(&db).await?;

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
