sea-orm-2

Migrate SeaORM 1.0 entities and queries to SeaORM 2.0 patterns.

108|1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/FlyinPancake/yoink --skill sea-orm-2-flyinpancake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sea-orm-2
Source: https://github.com/FlyinPancake/yoink/tree/main/.agents/skills/sea-orm-2
Command: npx skills add https://github.com/FlyinPancake/yoink --skill sea-orm-2-flyinpancake

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SeaORM 2.0 introduces breaking API and workflow changes compared to SeaORM 1.0, and the most common mistakes come from carrying old assumptions (entity structure, column typing, query composition, and eager-loading patterns) into new code.

Core Features & Use Cases

  • Entity-first 2.0 models: Define relations directly on the Model using #[sea_orm::model] and relation attributes like has_one, has_many, belongs_to, self_ref.
  • Strongly-typed columns: Use Entity::COLUMN for compile-time type safety and safer filters/expressions instead of the older untyped Column API.
  • Correct ActiveModel workflow: Build nested inserts/updates via the 2.0 builder pattern and understand insert vs save semantics to avoid unexpected writes.
  • Efficient eager loading: Use the Entity::load() API and .with(...) to avoid N+1 queries through joins/data-loader behavior.
  • Migration guidance & anti-patterns: Learn the 1.0 -> 2.0 renames, removed APIs, required imports (e.g., ExprTrait), and platform-specific gotchas (PostgreSQL identity/serial, SQLite integer mapping).

Quick Start

Ask the skill to explain how to migrate one of your existing SeaORM 1.0 entities and queries to SeaORM 2.0, including the updated entity definition, strongly-typed column usage, and the correct eager-loading approach for your relations.

Frequently Asked Questions about sea-orm-2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate SeaORM 1.0 entities to the 2.0 model format?

SeaORM 2.0 introduces breaking API changes, requiring updates to entity structure, column typing, query composition, and relational eager-loading patterns to resolve compilation issues from outdated 1.0 assumptions.

How does eager loading work in SeaORM 2.0 to prevent N+1 queries?

SeaORM 2.0 eager loading uses the Entity::load() API with .with(...) to fetch relations efficiently, preventing N+1 queries through underlying join and data-loader behavior instead of older untyped patterns.

What is the correct way to use typed columns in SeaORM 2.0?

SeaORM 2.0 typed columns use Entity::COLUMN for compile-time type safety when building filters and expressions, replacing the older untyped Column API to ensure safer query composition.

How do I handle nested inserts and updates with SeaORM 2.0 ActiveModel?

SeaORM 2.0 ActiveModel handles nested inserts and updates via a builder pattern, requiring careful attention to insert versus save semantics to prevent unexpected database writes during persistence.

What are common SeaORM 2.0 migration anti-patterns for PostgreSQL and SQLite?

Common SeaORM 2.0 migration anti-patterns include missing required imports like ExprTrait and ignoring platform-specific gotchas like PostgreSQL identity/serial mapping and SQLite integer mapping differences.

Does SeaORM 2.0 require updating query composition for Rust CRUD operations?

Yes, SeaORM 2.0 requires updating query composition for Rust CRUD operations, as typed expressions and Entity::load patterns replace older untyped APIs to enforce compile-time safety.