https://github.com/psyhackological/rtask
📝 Manage your tasks effortlessly with this Rust & SQLx-based to-do app, enabling you to add, complete, and list tasks with simple commands!
https://github.com/psyhackological/rtask
rust sqlx task todo
Last synced: about 1 year ago
JSON representation
📝 Manage your tasks effortlessly with this Rust & SQLx-based to-do app, enabling you to add, complete, and list tasks with simple commands!
- Host: GitHub
- URL: https://github.com/psyhackological/rtask
- Owner: Psyhackological
- License: gpl-3.0
- Created: 2024-03-11T19:49:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-16T11:56:35.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T18:57:12.069Z (about 1 year ago)
- Topics: rust, sqlx, task, todo
- Language: Rust
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TODOs Example
## Setup
1. Declare the database URL
- GNU/Linux /w Bash
```bash
export DATABASE_URL="sqlite:todos.db"
```
- For Command Prompt (`cmd.exe`)
```cmd
set DATABASE_URL=sqlite:todos.db
```
- PowerShell
```powershell
$env:DATABASE_URL="sqlite:todos.db"
```
2. Create the database.
```sh
sqlx db create
```
3. Run SQL migrations
```sh
sqlx migrate run
```
## Usage
### Using Cargo Commands
Add a todo:
```sh
cargo run -- add "todo description"
```
Add a todo with a category:
```sh
cargo run -- add "todo description" "category name"
```
Complete a todo:
```sh
cargo run -- done
```
List all todos:
```sh
cargo run
```
Delete all completed todos:
```sh
cargo run -- delete-done
```
### Using Justfile Aliases
Initialize the database and run migrations:
```sh
just init
just i
```
Add a todo:
```sh
just add "todo description"
just a "todo description"
```
Add a todo with a category:
```sh
just add "todo description" "category name"
just a "todo description" "category name"
```
Complete a todo:
```sh
just done
just d
```
List all todos:
```sh
just list
just ls
```
List all todos filtered by category:
```sh
just list "category name"
just ls "category name"
```
Delete all completed todos:
```sh
just delete-done
just dd
```
Run Clippy to check for common mistakes:
```sh
just clippy
just c
```
Format the code using Rustfmt:
```sh
just format
just f
```