mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-14 00:07:05 +00:00
96b76dc737
* update tests/x.py * add examples/x.py
420 B
420 B
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