35 releases

1.0.0-rc.1 Feb 6, 2024
0.12.14 Feb 5, 2024
0.12.12 Jan 22, 2024
0.12.10 Dec 14, 2023
0.9.1 Jul 21, 2022

#66 in Database interfaces

Download history 22420/week @ 2023-11-04 28323/week @ 2023-11-11 26132/week @ 2023-11-18 38278/week @ 2023-11-25 23972/week @ 2023-12-02 24246/week @ 2023-12-09 34630/week @ 2023-12-16 15758/week @ 2023-12-23 19179/week @ 2023-12-30 24093/week @ 2024-01-06 25290/week @ 2024-01-13 29845/week @ 2024-01-20 28351/week @ 2024-01-27 28133/week @ 2024-02-03 26576/week @ 2024-02-10 17322/week @ 2024-02-17

103,831 downloads per month
Used in 59 crates (22 directly)

MIT/Apache

1MB
20K 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–31MB
~438K SLoC