# Postgres credentials are static defaults baked into docker-compose.yml
# and src/config.rs's PostgresConfig::default() — no secrets involved.

# Start postgres (creates the container on first run).
start:
	docker compose up -d

# Stop postgres without removing the container.
stop:
	docker compose stop

# Fully tear down and recreate the postgres container.
restart:
	docker compose down
	docker compose up -d

# Run the database-backed integration tests, starting postgres if needed.
# DATABASE_URL is required by #[sqlx::test], which creates an isolated
# database per test and drops it afterwards.
test-db: start
	DATABASE_URL=postgres://peachmem:peachmem@localhost:55433/peachmem \
		cargo test --features db-tests
