An anonymous messaging backend service written in Rust
- Rust Programming Language
- SQLx
- Postgres
- Axum
- Tokio
- Tower
- Serde
- Thiserror
sqlx database create
sqlx database drop
If you would like to create reversible migrations with corresponding "up" and "down" scripts, you use the -r flag when creating the first migration:
$ sqlx migrate add -r <name>
Creating migrations/20211001154420_<name>.up.sql
Creating migrations/20211001154420_<name>.down.sql
After that, you can edit the migration files and run:
$ sqlx migrate run
Applied migrations/20211001154420 <name> (32.517835ms)
And reverts work as well:
$ sqlx migrate revert
Applied 20211001154420/revert <name>
Note: All the subsequent migrations will be reversible as well.
cargo watch -x run
cargo add <package_name>
cargo rm <package_name>