sqlx/examples/mysql/todos
Yuri Astrakhan a824e8468c
Cleanup format arguments (#2650)
Inlined format args make code more readable, and code more compact.

I ran this clippy command to fix most cases, and then cleaned up a few trailing commas and uncaught edge cases.

```
cargo clippy --bins --examples  --benches --tests --lib --workspace --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2023-07-31 13:27:04 -07:00
..
migrations update todo examples to 0.4 and use migrations 2020-07-18 05:43:16 -07:00
src Cleanup format arguments (#2650) 2023-07-31 13:27:04 -07:00
Cargo.toml 0.7.0 release (#2575) 2023-07-03 14:37:37 -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