mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-09-30 06:22:01 +00:00

Co-authored-by: Josh Toft <joshtoft@gmail.com> Co-authored-by: Philip A Reimer <antreimer@gmail.com>
TODOs Example
Setup
-
Declare the database URL
export DATABASE_URL="sqlite:todos.db"
-
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