Agent skill

Sea Orm 2

by FlyinPancake in FlyinPancake/yoink

Expert guidance for SeaORM 2.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow.

Apache-2.0Auto-check passedDatabases

Install Sea Orm 2

skills CLI
$ npx skills add FlyinPancake/yoink --skill sea-orm-2 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install FlyinPancake/yoink sea-orm-2 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/FlyinPancake/yoink.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/sea-orm-2 .claude/skills/sea-orm-2 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sea-orm-2
GitHub stars
112
Token cost
~2.9k tokens
SKILL.md length
500 words
Files
5 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

Expert guidance for SeaORM 2.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow.

  • Works in 7 steps: Do Not Specify column_type on Custom… → Use Text for Long Strings on MySQL/MSSQL → Missing ExprTrait Import → …
  • Working with SeaORM entities
  • SKILL.md covers Quick Reference, Entity Definition (2.0 Format), Strongly-Typed Columns (2.0) and ActiveModel Builder Pattern…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Sea Orm 2 is an agent skill from FlyinPancake/yoink. Expert guidance for SeaORM 2.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow. Use when working with SeaORM entities, queries, migrations, relations, or any database operations in Rust projects using SeaORM. Covers the new 2.0 API patterns, anti-patterns to avoid, and migration from 1.0.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/activemodel-patterns.md`, `references/entity-patterns.md` and `references/migration-guide.md`).

It sits in Databases, covering ORMs and data access and Database administration. It works with Rust. The repository describes itself as: yoink is a self-hosted music library manager that supports multiple metadata sources. The licence is Apache-2.0.

When your agent uses it

  • Working with SeaORM entities
  • Any database operations in Rust projects using SeaORM

Example prompts

  • “/sea-orm-2”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Do Not Specify column_type on Custom Wrapper Types
  2. Use Text for Long Strings on MySQL/MSSQL
  3. Missing ExprTrait Import
  4. Do Not Use Removed or Renamed APIs
  5. Do Not Manually impl Traits That DeriveValueType Generates
  6. PostgreSQL: serial is No Longer Default
  7. SQLite: Integer Type Mapping Changed

What it can do on your machine

Read from SKILL.md and the folder at commit 576068a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • sea-ql.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sea Orm 2 loads about 2.9k tokens when it runs, and up to ~8.8k if it reads all its reference files. Until then it costs about 91 tokens; SKILL.md has 500 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~91
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from FlyinPancake/yoink at commit 576068a, republished under its Apache-2.0 licence (© FlyinPancake). 500 words, ~2,940 tokens.

Download SKILL.mdSave it as .claude/skills/sea-orm-2/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
sea-orm-2
description
Expert guidance for SeaORM 2.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow. Use when working with SeaORM entities, queries, migrations, relations, or any database operations in Rust projects using SeaORM. Covers the new 2.0 API patterns, anti-patterns to avoid, and migration from 1.0.

SeaORM 2.0

This skill provides expert guidance for using SeaORM 2.0 properly, focusing on the new patterns and avoiding common pitfalls that stem from SeaORM 1.0 knowledge.

Quick Reference

Entity Definition (2.0 Format)

SeaORM 2.0 uses #[sea_orm::model] with relations defined directly on the Model struct. This replaces the 1.0 pattern of separate Relation enums and Related trait impls.

Basic Entity
rust
mod user {
    use sea_orm::entity::prelude::*;

    #[sea_orm::model]
    #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
    #[sea_orm(table_name = "user")]
    pub struct Model {
        #[sea_orm(primary_key)]
        pub id: i32,
        pub name: String,
        #[sea_orm(unique)]
        pub email: String,
    }

    impl ActiveModelBehavior for ActiveModel {}
}
Entity with Relations
rust
mod user {
    use sea_orm::entity::prelude::*;

    #[sea_orm::model]
    #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
    #[sea_orm(table_name = "user")]
    pub struct Model {
        #[sea_orm(primary_key)]
        pub id: i32,
        pub name: String,
        #[sea_orm(unique)]
        pub email: String,
        #[sea_orm(has_one)]
        pub profile: HasOne<super::profile::Entity>,
        #[sea_orm(has_many)]
        pub posts: HasMany<super::post::Entity>,
    }
}
Relation Types
rust
// Has-One
#[sea_orm(has_one)]
pub profile: HasOne<super::profile::Entity>,

// Has-Many
#[sea_orm(has_many)]
pub posts: HasMany<super::post::Entity>,

// Belongs-To (explicit foreign key mapping)
#[sea_orm(belongs_to, from = "user_id", to = "id")]
pub user: HasOne<super::user::Entity>,

// Many-to-Many via junction table
#[sea_orm(has_many, via = "post_tag")]
pub tags: HasMany<super::tag::Entity>,

// Self-referential
#[sea_orm(self_ref, via = "user_follower", from = "User", to = "Follower")]
pub followers: HasMany<Entity>,
Junction Table (Composite Primary Key)
rust
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "post_tag")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub post_id: i32,
    #[sea_orm(primary_key, auto_increment = false)]
    pub tag_id: i32,
    #[sea_orm(belongs_to, from = "post_id", to = "id")]
    pub post: Option<super::post::Entity>,
    #[sea_orm(belongs_to, from = "tag_id", to = "id")]
    pub tag: Option<super::tag::Entity>,
}

For detailed entity patterns, see references/entity-patterns.md.

Strongly-Typed Columns (2.0)

Use COLUMN constant with typed fields instead of the untyped Column enum:

rust
// 2.0 (preferred) -- compile-time type safety
user::Entity::find().filter(user::COLUMN.name.contains("Bob"))

// 1.0 (outdated) -- still works but prefer COLUMN
user::Entity::find().filter(user::Column::Name.contains("Bob"))

The COLUMN constant provides:

  • Compile-time type checking
  • Better IDE autocomplete
  • Refactoring safety

ActiveModel Builder Pattern (2.0)

Creating with Nested Relations
rust
// Create with nested relations
let bob = user::ActiveModel::builder()
    .set_name("Bob")
    .set_email("bob@sea-ql.org")
    .set_profile(profile::ActiveModel::builder().set_picture("Tennis"))
    .insert(db)
    .await?;
Adding Has-Many Children
rust
let mut bob = bob.into_active_model();
bob.posts.push(
    post::ActiveModel::builder().set_title("My first post")
);
bob.save(db).await?;
Many-to-Many Relations
rust
let post = post::ActiveModel::builder()
    .set_title("A sunny day")
    .set_user_id(bob.id)
    .add_tag(existing_tag)
    .add_tag(tag::ActiveModel::builder().set_tag("outdoor"))
    .save(db)
    .await?;

For complete ActiveModel patterns, see references/activemodel-patterns.md.

Entity Loader API (2.0)

The Entity Loader eliminates N+1 queries by intelligently using JOIN for 1-1 relations and data loader for 1-N relations.

Basic Loading
rust
// Load with relations in a single query
let bob = user::Entity::load()
    .filter_by_email("bob@sea-ql.org")
    .with(profile::Entity)
    .with(post::Entity)
    .one(db)
    .await?
    .expect("Not found");
Nested Relations
rust
// Nested relations (post -> comments)
let user = user::Entity::load()
    .filter_by_id(12)
    .with(profile::Entity)
    .with((post::Entity, comment::Entity))
    .one(db)
    .await?;
How It Works
rust
// join paths:
// user -> profile
// user -> post
//         post -> post_tag -> tag
let smart_user = user::Entity::load()
    .filter_by_id(42)
    .with(profile::Entity) // 1-1 uses join
    .with((post::Entity, tag::Entity)) // 1-N uses data loader
    .one(db)
    .await?
    .unwrap();

// 3 queries are executed under the hood:
// 1. SELECT FROM user JOIN profile WHERE id = $
// 2. SELECT FROM post WHERE user_id IN (..)
// 3. SELECT FROM tag JOIN post_tag WHERE post_id IN (..)

For advanced querying patterns, see references/query-patterns.md.

Schema Registry (Entity-First Workflow)

SeaORM 2.0 supports entity-first development where you define entities and SeaORM creates the schema.

rust
// Auto-create tables from entity definitions (dev/testing)
db.get_schema_registry("my_crate::*")
    .sync(db)
    .await?;

This:

  • Creates tables in topological order based on foreign key dependencies
  • Adds new columns to existing tables
  • Creates unique keys and foreign keys automatically

Requires feature flags: entity-registry and schema-sync.

Anti-Patterns to Avoid

1. Do Not Specify column_type on Custom Wrapper Types
rust
// WRONG -- do not annotate column_type on custom types
#[sea_orm(column_type = "Decimal(Some((10, 4)))")]
pub speed: Speed,

// CORRECT -- SeaORM infers the column type from DeriveValueType
pub speed: Speed,

#[derive(Clone, Debug, PartialEq, DeriveValueType)]
pub struct Speed(Decimal);
2. Use Text for Long Strings on MySQL/MSSQL
rust
// WRONG on MySQL/MSSQL -- silently truncates at 255 chars
pub description: String,

// CORRECT -- use column_type for longer strings
#[sea_orm(column_type = "Text")]
pub description: String,

// Also correct -- explicit max length
#[sea_orm(column_type = "String(StringLen::Max)")]
pub event_type: String,
3. Missing ExprTrait Import

Methods like .eq(), .like(), .contains() on Expr require the trait import in 2.0:

rust
use sea_orm::ExprTrait; // required in 2.0

Expr::col((self.entity_name(), *self)).like(s)
4. Do Not Use Removed or Renamed APIs
1.0 (removed/renamed)2.0 (correct)
.into_condition().into()
db.execute(Statement::from_sql_and_values(..))db.execute_raw(Statement::from_sql_and_values(..))
db.query_all(backend.build(&query))db.query_all(&query)
Alias::new("col") for static stringsExpr::col("col") directly
insert_many(..).on_empty_do_nothing()insert_many([]) returns None safely
5. Do Not Manually impl Traits That DeriveValueType Generates

In 2.0, DeriveValueType auto-generates NotU8, IntoActiveValue, and TryFromU64. Remove manual implementations to avoid conflicts.

Show full SKILL.md (189 more words)Show less
6. PostgreSQL: serial is No Longer Default

Auto-increment columns now use GENERATED BY DEFAULT AS IDENTITY. Use feature flag postgres-use-serial-pk for legacy behavior.

7. SQLite: Integer Type Mapping Changed

Both Integer and BigInteger map to integer in 2.0. Use sea-orm-cli --big-integer-type=i32 if needed.

For complete migration guide, see references/migration-guide.md.

Common Operations Quick Reference

Select
rust
// Find all
let cakes: Vec<cake::Model> = Cake::find().all(db).await?;

// Filter
let chocolate: Vec<cake::Model> = Cake::find()
    .filter(Cake::COLUMN.name.contains("chocolate"))
    .all(db)
    .await?;

// Find by ID
let cheese: Option<cake::Model> = Cake::find_by_id(1).one(db).await?;

// Eager load related (1-1)
let cake_with_fruit: Vec<(cake::Model, Option<fruit::Model>)> =
    Cake::find().find_also_related(Fruit).all(db).await?;

// Eager load related (1-N and M-N)
let cake_with_fillings: Vec<(cake::Model, Vec<filling::Model>)> = Cake::find()
    .find_with_related(Filling)
    .all(db)
    .await?;
Insert
rust
let apple = fruit::ActiveModel {
    name: Set("Apple".to_owned()),
    ..Default::default()
};

// Insert one
let apple = apple.insert(db).await?;

// Insert many
let result = Fruit::insert_many([apple, pear]).exec(db).await?;
Update
rust
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());
let pear: fruit::Model = pear.update(db).await?;

// Bulk update
Fruit::update_many()
    .col_expr(fruit::COLUMN.cake_id, fruit::COLUMN.cake_id.add(2))
    .filter(fruit::COLUMN.name.contains("Apple"))
    .exec(db)
    .await?;
Delete
rust
// Delete one
orange.delete(db).await?;

// Delete many
fruit::Entity::delete_many()
    .filter(fruit::COLUMN.name.contains("Orange"))
    .exec(db)
    .await?;

Feature Flags

Key feature flags to know:

  • sqlx-mysql, sqlx-postgres, sqlx-sqlite - Database drivers
  • runtime-tokio-native-tls, runtime-tokio-rustls - Async runtime
  • with-chrono, with-time - Date/time libraries
  • with-rust_decimal, with-bigdecimal - Decimal libraries
  • with-json - JSON support
  • entity-registry, schema-sync - Entity-first workflow
  • postgres-use-serial-pk - Legacy PostgreSQL serial types

references/entity-patterns.md
  • Basic entity structure
  • All relation types (Has-One, Has-Many, Many-to-Many, Self-referential)
  • Composite primary keys
  • Custom types with DeriveValueType
  • Column attributes reference
references/activemodel-patterns.md
  • Creating ActiveModels (3 methods)
  • Builder pattern usage
  • Nested persistence examples
  • Update patterns
  • Insert vs Save semantics
  • ActiveValue states
references/query-patterns.md
  • Basic CRUD queries
  • Filtering with strongly-typed columns
  • Entity Loader API patterns
  • Join operations
  • Pagination
  • Aggregation
  • Raw SQL with parameter binding
references/migration-guide.md
  • Complete 1.0 to 2.0 migration guide
  • Breaking changes table
  • API renames reference
  • Step-by-step migration instructions

This skill provides comprehensive coverage of SeaORM 2.0 with focus on the new patterns and critical anti-patterns to avoid.

© FlyinPancake, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in .agents/skills/sea-orm-2 of FlyinPancake/yoink.

  • SKILL.md
  • references/activemodel-patterns.md
  • references/entity-patterns.md
  • references/migration-guide.md
  • references/query-patterns.md

Open the folder on GitHubat commit 576068a

Compare with similar skills

Sea Orm 2 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sea Orm 2 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sea Orm 2 this skillFlyinPancake/yoink112—~2.9kAutomated safety check: PassApache-2.0
Prismablencorp/claude-code-kit106—~2.7kAutomated safety check: PassMIT
Prisma Expertdavila7/claude-code-templates32k7 repos~2.6kAutomated safety check: PassMIT
Frappe Core DatabaseImpertio-Studio/Frappe_Claude_Skill_Package187—~3.8kAutomated safety check: PassMIT
Rls Patternsbybren-llc/safe-agentic-workflow421—~1.6kAutomated safety check: PassMIT
Veloxdb Scalable Performanceveloxbase/veloxdb646—~1.7kAutomated safety check: PassMIT

Similar skills

  • Prisma

    blencorp/claude-code-kit

    Prisma ORM patterns including Prisma Client usage, queries, mutations, relations, transactions, and schema management.

    106 GitHub stars~2.7k tokensUpdated 10 mo ago
    DatabasesAuto-check passed
  • Prisma Expert

    davila7/claude-code-templates

    Prisma ORM expert for schema design, migrations, query optimization, relations modeling, and database operations.

    32k GitHub starsUsed in 7 repos~2.6k tokens
    DatabasesAuto-check passed
  • Frappe Core Database

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when performing database operations in ERPNext/Frappe v14-v16.

    187 GitHub stars~3.8k tokensUpdated 20 days ago
    DatabasesAuto-check passed
  • Rls Patterns

    bybren-llc/safe-agentic-workflow

    Row Level Security patterns for database operations. An agent skill from bybren-llc/safe-agentic-workflow.

    421 GitHub stars~1.6k tokensUpdated 2 mo ago
    DatabasesAuto-check passed
  • Guides scalability and performance work for VeloxDB's Tauri + Rust PostgreSQL backend and React + TanStack frontend.

    646 GitHub stars~1.7k tokensUpdated 7 days ago
    DatabasesAuto-check passed
  • Database Expert

    cin12211/orca-q

    Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.

    224 GitHub stars~2.8k tokensUpdated 16 days ago
    DatabasesAuto-check passed

Works with

Categories

Questions about Sea Orm 2

What does Sea Orm 2 do?

Expert guidance for SeaORM 2.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow. Sea Orm 2 is an agent skill from FlyinPancake/yoink.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow.

When should I use Sea Orm 2?

Sea Orm 2 fits situations like: working with SeaORM entities; any database operations in Rust projects using SeaORM.

How do I install Sea Orm 2 in Claude Code?

Run `npx skills add FlyinPancake/yoink --skill sea-orm-2 -a claude-code`. Or copy the skill folder (.agents/skills/sea-orm-2 in FlyinPancake/yoink) into .claude/skills/sea-orm-2 in your project. Claude Code loads it when a task matches its description.

How do I install Sea Orm 2 in Codex?

Run `npx skills add FlyinPancake/yoink --skill sea-orm-2 -a codex`. Or copy the skill folder (.agents/skills/sea-orm-2 in FlyinPancake/yoink) into .agents/skills/sea-orm-2 in your project. Codex loads it when a task matches its description.

Can I use Sea Orm 2 in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add FlyinPancake/yoink --skill sea-orm-2 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sea-orm-2, .gemini/skills/sea-orm-2, .github/skills/sea-orm-2 and .opencode/skills/sea-orm-2 in your project.

What does Sea Orm 2 need to run?

SKILL.md names no scripts, command-line tools or credentials: Sea Orm 2 is instructions for the agent only.

Does Sea Orm 2 access the network?

SKILL.md names 1 domain. As links in the text: sea-ql.org. This is read from the text; nothing was executed.

Is Sea Orm 2 safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sea Orm 2 use?

Sea Orm 2 is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sea Orm 2 use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.9k tokens, read only when the agent opens those files.

What are the alternatives to Sea Orm 2?

Skills that share tags, products or a category with Sea Orm 2: Prisma (blencorp/claude-code-kit, 106 stars), Prisma Expert (davila7/claude-code-templates, 32k stars), Frappe Core Database (Impertio-Studio/Frappe_Claude_Skill_Package, 187 stars) and Rls Patterns (bybren-llc/safe-agentic-workflow, 421 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sea Orm 2?

FlyinPancake (a GitHub user) maintains it in FlyinPancake/yoink, which has 112 GitHub stars. The repository was last updated on October 4, 2026.

Source: FlyinPancake/yoink on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.