Currently, the database (the app only supports one database) is abstracted behind a simple interface supporting get and save operations, and nothing else. The database interaction is handled by the nano library. An instance of nano is instantiated in the db module and shared by all modules that depend on it.
Possible improvements:
[x] Add support for multiple databases
[x] Convert database to a class
[x] Add classes for models (Info and User should suffice)
Model will be a generic class for handling documents
Info and User will extend Model and add methods as well as instantiate the appropriate database for each one using the Database class
[ ] Add static methods to Model for performing operations on multiple models at once.
Closing with the fourth list item incomplete because there is no current use for this functionality, so there is no motivation to add it until it becomes a need.
Currently, the database (the app only supports one database) is abstracted behind a simple interface supporting
get
andsave
operations, and nothing else. The database interaction is handled by thenano
library. An instance ofnano
is instantiated in thedb
module and shared by all modules that depend on it.Possible improvements:
Info
andUser
should suffice)Model
will be a generic class for handling documentsInfo
andUser
will extendModel
and add methods as well as instantiate the appropriate database for each one using theDatabase
classModel
for performing operations on multiple models at once.