📝 Manage your tasks effortlessly with this Rust & SQLx-based to-do app, enabling you to add, complete, and list tasks with simple commands!
- Rust 92.4%
- Just 7.6%
| migrations | feat: add categories and category_id to todos | |
| src | feat: add ability to list todos by category | |
| .gitignore | chore: update .gitignore to exclude todos.db files | |
| Cargo.toml | feat: add ability to list todos by category | |
| justfile | feat: add ability to list todos by category | |
| LICENSE | Initial commit | |
| README.md | docs: update instructions so they describe windows behavior too | |
TODOs Example
Setup
- 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
Usage
Using Cargo Commands
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
Using Justfile Aliases
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