The database is defined as a class which has an in-memory store data and a persist method that allows for persisting the database to a file as well as content when an instance is created from an existing JSON file
The code for the database can be seen below:
Usage
The database can be used by creating an instance and modifying the data in it by using the update method, and can be written to a file using the commit method:
Functional Example
The above code is found in the below REPL as a runnable example: