sqlx/examples/mysql/todos
Paolo Barbolini fc9c9be5e8
Update to edition 2021 (#1808)
* Update to edition 2021

* Fix running tests
2022-04-15 12:52:00 -07:00
..
migrations update todo examples to 0.4 and use migrations 2020-07-18 05:43:16 -07:00
src Remove the Done trait 2021-01-12 14:37:44 +01:00
Cargo.toml Update to edition 2021 (#1808) 2022-04-15 12:52:00 -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