1
0
Fork
You've already forked rtask
0
📝 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%
2024年06月16日 13:56:26 +02:00
migrations feat: add categories and category_id to todos 2024年06月16日 12:45:33 +02:00
src feat: add ability to list todos by category 2024年06月16日 13:22:35 +02:00
.gitignore chore: update .gitignore to exclude todos.db files 2024年06月11日 19:43:44 +02:00
Cargo.toml feat: add ability to list todos by category 2024年06月16日 13:22:35 +02:00
justfile feat: add ability to list todos by category 2024年06月16日 13:22:35 +02:00
LICENSE Initial commit 2024年03月11日 19:49:27 +00:00
README.md docs: update instructions so they describe windows behavior too 2024年06月16日 13:56:26 +02:00

TODOs Example

Setup

  1. 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"
  1. Create the database.
sqlx db create
  1. 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