aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: fefc0fd7aa3347bea7c59a806c7fd3a4b5f1e204 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Debt
A debt recorder, which helps to remember who owns you money

## Usage

```
Usage: debt [OPTIONS] <COMMAND>

Commands:
  init      Initialize Database
  register  Register a transaction
  view      View Registered data
  add       Add a new agent to lend or pay
  help      Print this message or the help of the given subcommand(s)

Options:
  -d, --database-path <DATABASE_PATH>  file path where data is stored [default: $XDG_DATA_HOME/debt/debt.db [env: DEBT_DB=]
  -h, --help                           Print help
  -V, --version                        Print version
```

## Database

```sql
CREATE TABLE Agents (
    id INTEGER PRIMARY KEY,
    name TEXT NOT NULL UNIQUE
    )
```

```sql
CREATE TABLE Registers (
    id INTEGER PRIMARY KEY,
    agent_id INTEGER,
    register_date INTEGER NOT NULL,
    amount INTEGER NOT NULL,
    note TEXT,
    FOREIGN KEY(agent_id) REFERENCES Agents(id)
    )
```
Feel free to download, copy and edit any repo