Skip to content

Commit

Permalink
Add ideas about persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
suhlig committed Aug 19, 2021
1 parent 386ae03 commit 6ad32cf
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,30 @@ rustomato break [start] # Starts a break. Auto-finishes the currently activ
* Install and update rust with `rustup`
* Run: `cargo run -- pomodoro`
* Build a release: `cargo build --release` (binary found in `target/release/`)

# WIP Persistence

```command
$ sqlite3 ~/.rustomato.sqlite3
```

```sql
CREATE TABLE schedulables (
uuid TEXT NOT NULL,
started_at INTEGER,
finished_at INTEGER,
cancelled_at INTEGER
);
-- TODO Can we set up a constraint to have either finished_at or cancelled_at as zero?
INSERT INTO schedulables (uuid, started_at) VALUES ("3de9cc4b-f731-4c3d-9c93-1700c932f218", 1629318386);
SELECT
*,
datetime(started_at, 'unixepoch', 'localtime') as started_at_datetime,
datetime(finished_at, 'unixepoch', 'localtime') as finished_at_datetime,
datetime(cancelled_at, 'unixepoch', 'localtime') as cancelled_at_datetime
FROM
schedulables
;

0 comments on commit 6ad32cf

Please sign in to comment.