63 releases (16 stable)

Uses new Rust 2024

1.2.0-rc.1 May 29, 2025
1.1.12 May 27, 2025
1.1.8 Mar 30, 2025
1.1.3 Dec 24, 2024
0.9.1 Jul 21, 2022

#453 in Database interfaces

Download history 71412/week @ 2025-03-11 66714/week @ 2025-03-18 62326/week @ 2025-03-25 51779/week @ 2025-04-01 61253/week @ 2025-04-08 73923/week @ 2025-04-15 82446/week @ 2025-04-22 58781/week @ 2025-04-29 48165/week @ 2025-05-06 47083/week @ 2025-05-13 55805/week @ 2025-05-20 67794/week @ 2025-05-27 67540/week @ 2025-06-03 70103/week @ 2025-06-10 63803/week @ 2025-06-17 86726/week @ 2025-06-24

301,628 downloads per month
Used in 107 crates (54 directly)

MIT/Apache

3.5MB
21K SLoC

SeaORM CLI

Install and Usage:

> cargo install sea-orm-cli 
> sea-orm-cli help

Or:

> cargo install --bin sea
> sea help

Getting Help:

cargo run -- -h

Running Entity Generator:

# MySQL (`--database-schema` option is ignored)
cargo run -- generate entity -u mysql://sea:sea@localhost/bakery -o out

# SQLite (`--database-schema` option is ignored)
cargo run -- generate entity -u sqlite://bakery.db -o out

# PostgreSQL
cargo run -- generate entity -u postgres://sea:sea@localhost/bakery -s public -o out

Running Migration:

  • Initialize migration directory
    cargo run -- migrate init
    
  • Apply all pending migrations
    cargo run -- migrate
    
    cargo run -- migrate up
    
  • Apply first 10 pending migrations
    cargo run -- migrate up -n 10
    
  • Rollback last applied migrations
    cargo run -- migrate down
    
  • Rollback last 10 applied migrations
    cargo run -- migrate down -n 10
    
  • Drop all tables from the database, then reapply all migrations
    cargo run -- migrate fresh
    
  • Rollback all applied migrations, then reapply all migrations
    cargo run -- migrate refresh
    
  • Rollback all applied migrations
    cargo run -- migrate reset
    
  • Check the status of all migrations
    cargo run -- migrate status
    

Dependencies

~13–36MB
~451K SLoC