20 unstable releases (3 breaking)

new 0.12.0 Mar 25, 2023
0.11.0 Feb 7, 2023
0.10.6 Dec 23, 2022
0.10.4 Nov 24, 2022
0.9.1 Jul 21, 2022

#643 in Database interfaces

Download history 2853/week @ 2022-12-04 2647/week @ 2022-12-11 3125/week @ 2022-12-18 1991/week @ 2022-12-25 3307/week @ 2023-01-01 3610/week @ 2023-01-08 3510/week @ 2023-01-15 4036/week @ 2023-01-22 4550/week @ 2023-01-29 4595/week @ 2023-02-05 5285/week @ 2023-02-12 5467/week @ 2023-02-19 6575/week @ 2023-02-26 6374/week @ 2023-03-05 6048/week @ 2023-03-12 5526/week @ 2023-03-19

25,115 downloads per month
Used in 34 crates (11 directly)

MIT/Apache

665KB
15K 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

~11–49MB
~838K SLoC