sqlx/examples/mysql/todos
2024-08-26 14:03:45 -07:00
..
migrations update todo examples to 0.4 and use migrations 2020-07-18 05:43:16 -07:00
src chore: replace structopt with clap in examples (#3380) 2024-07-27 02:51:20 -07:00
Cargo.toml Remove deprecated feature-names from Cargo.toml files in examples (#3424) 2024-08-26 14:03:45 -07:00
README.md update todo examples to 0.4 and use migrations 2020-07-18 05:43:16 -07:00

TODOs Example

Setup

  1. Declare the database URL

    export DATABASE_URL="mysql://root:password@localhost/todos"
    
  2. Create the database.

    $ sqlx db create
    
  3. Run sql migrations

    $ sqlx migrate run
    

Usage

Add a todo

cargo run -- add "todo description"

Complete a todo.

cargo run -- done <todo id>

List all todos

cargo run