sqlx/cargo-sqlx
Austin Bonander 21041ff55e implement cargo sqlx prepare
also organize code more clearly in `cargo-sqlx`
2020-05-30 16:02:37 -07:00
..
2020-05-30 16:02:37 -07:00
2020-05-27 13:03:51 -07:00
2020-05-30 16:02:37 -07:00
2020-05-22 13:17:53 -07:00

cargo-sqlx

Sqlx migrator runs all *.sql files under migrations folder and remembers which ones has been run.

Database url is supplied through either env variable or .env file containing DATABASE_URL="postgres://postgres:postgres@localhost/realworld".

Commands
  • add <name> - add new migration to your migrations folder named <timestamp>_<name>.sql
  • database - create or drop database based on connection string
  • run - Runs all migrations in your migrations folder
Limitations
  • No down migrations! If you need down migrations, there are other more feature complete migrators to use.