mirror of
https://github.com/launchbadge/sqlx
synced 2024-09-20 14:21:57 +00:00
dcb58b0e2c
* WIP preparing 0.7.0 release * fix: re-enable examples * fix doctests in `sqlx-core` * cherry-pick CHANGELOG entry for 0.6.3 * add actions workflow for examples * fix(cli): close connection after running migrations * fix examples * fix(sqlite): fix parsing of URLs via `Any` * fix(example): don't let Postgres `listen` example run forever * fix Postgres `transaction` example |
||
---|---|---|
.. | ||
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