sqlx/examples/todos-postgres
2020-01-28 15:10:09 +00:00
..
2020-01-28 08:30:30 +00:00
2020-01-27 10:17:58 +00:00
2020-01-27 10:17:58 +00:00
2020-01-28 15:10:09 +00:00

TODOs Example

Usage

Declare the database URL:

export DATABASE_URL="postgres://postgres@localhost/todos"

Create the database:

createdb -U postgres todos

Load the database schema:

psql -d "$DATABASE_URL" -f ./schema.sql

Run:

  • Add a todo: cargo run -- add "todo description"
  • Complete a todo: cargo run -- done <todo id>
  • List all todos: cargo run