docker run --name dev-postgres --rm -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=Pa55w0rd -e PGDATA=/var/lib/postgresql/data/pgdata -v /tmp:/var/lib/postgresql/data -P -p 127.0.0.1:5432:5432 -it postgres:alpine
docker run --name dev-postgres --rm -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=Pa55w0rd -e PGDATA=/var/lib/postgresql/data/pgdata -v /tmp:/var/lib/postgresql/data -p 5432:5432 -it postgres:14.1-alpine
docker exec -it dev-postgres psql -U doAdmin
GRANT ALL PRIVILEGES ON DATABASE <<DATABASE_NAME>> TO <>
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA <<SCHEMA_NAME>> TO <>;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA <<SCHEMA_NAME>> TO <>;
cd tutor-db
cargo run --bin iter1
cargo run --bin iter1 -p tutor-db
If you choose to do this make sure the .env file containing the database access credentials is located within the workspace root as opposed to the project root.