An environment variable with the database url is required for sqlx to connect.
echo DATABASE_URL=postgres://admin:password@localhost:5432/spaced > .envNote: the DATABASE_URL must be present in the environment for the database tests.
Running all tests
cargo testRunning tests for a specific workspace member
cargo test -p item_producerNote: the DATABASE_URL must be present in the environment for the sqlx-cli.
The docker images during build-time do not have access to a database with migrations applied. To ensure the docker image can be built, the json files under the .sqlx directory must be up-to-date and committed.
cargo sqlx prepare --workspace -- --all-targets --all-features