- Declare the database URL
- GNU/Linux /w Bash
export DATABASE_URL="sqlite:todos.db"
- For Command Prompt (
cmd.exe
)
set DATABASE_URL=sqlite:todos.db
- PowerShell
$env:DATABASE_URL="sqlite:todos.db"
- Create the database.
sqlx db create
- Run SQL migrations
sqlx migrate run
Add a todo:
cargo run -- add "todo description"
Add a todo with a category:
cargo run -- add "todo description" "category name"
Complete a todo:
cargo run -- done <todo_id>
List all todos:
cargo run
Delete all completed todos:
cargo run -- delete-done
Initialize the database and run migrations:
just init
just i
Add a todo:
just add "todo description"
just a "todo description"
Add a todo with a category:
just add "todo description" "category name"
just a "todo description" "category name"
Complete a todo:
just done <todo_id>
just d <todo_id>
List all todos:
just list
just ls
List all todos filtered by category:
just list "category name"
just ls "category name"
Delete all completed todos:
just delete-done
just dd
Run Clippy to check for common mistakes:
just clippy
just c
Format the code using Rustfmt:
just format
just f