The Milestone Recorder app is designed to store and recall events/milestones which occured on a particular day.
It was written as an exercise to learn Haskell and uses SQLite as a backend database.
The app is build using the Haskell Tool Stack.
To build the app, run stack build
.
The app can be run through stack by executing stack run
.
Commands are specified after run
, and are case-insensitive.
To add a milestone:
~ : stack run add 2021-01-02 "Test entry"
Added 2021-01-02 Test entry
To list milestones:
~ : stack run list
1: 2021-1-2 - Test entry
2: 2021-2-23 - Another entry
list
can take optional parameters to return dates in a range:
stack run list after YYYY-MM-DD
stack run list before YYYY-MM-DD
Combining both allows milestones in a set period to be listed.
To delete a milestone, run delete
and specify its ID (the number given with it in the list):
~ : stack run delete 1
Deleted row with id 1
To run unit tests, execute: stack test
Functional tests are written in python. To run them, execute: python3 functional_tests.py
- Allow db file name to be specified (allow testing without deleting the main db)
- Add date format validation
after
andbefore
arguments aren't case insensitive.