mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
a824e8468c
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 ``` |
||
---|---|---|
.. | ||
migrations | ||
src | ||
Cargo.toml | ||
README.md |
TODOs Example
Setup
-
Declare the database URL
export DATABASE_URL="mysql://root:password@localhost/todos"
-
Create the database.
$ sqlx db create
-
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