Back to Sea Orm

Actix 4 with SeaORM example app

examples/actix_example/README.md

2.0.0726 B
Original Source

Actix 4 with SeaORM example app

  1. Modify the DATABASE_URL var in .env to point to your chosen database

  2. Turn on the appropriate database feature for your chosen db in api/Cargo.toml (the "sqlx-mysql", line)

  3. Execute cargo run to start the server

  4. Visit localhost:8000 in browser

Run server with auto-reloading:

bash
cargo install systemfd cargo-watch
systemfd --no-pid -s http::8000 -- cargo watch -x run

Run tests:

bash
cd api
cargo test

Run migration:

bash
cargo run -p migration -- up

Regenerate entity:

bash
sea-orm-cli generate entity --output-dir ./entity/src --lib --entity-format dense --with-serde both