Skip to content

joshchoo/zero2prod

Repository files navigation

Supporting Course Code

https://github.com/LukeMathWalker/zero-to-production

Requirements

  • docker
  • just (optional)
  • psql
  • sqlx (see instructions below)

sqlx-cli

Install the CLI:

cargo install sqlx-cli --version=0.5.7 --no-default-features --features postgres

Creating a migration:

# DATABASE_URL needs to be exported only if direnv hasn't been set up yet.
export DATABASE_URL=postgres://postgres:password@localhost:5432/newsletter
sqlx migrate add create_subscriptions_table

Run migration:

sqlx migrate run