hack4impact-calpoly/general-vms

[Backend] Create Database Abstraction

Closed this issue · 0 comments

This task will hopefully help with expediting not needing a given database to do a task. Instead, the part of the backend that gets the requests that will eventually call the database functions to retrieve/input/delete data will not need to know the inner details of that.

Abstract database class attributes:

  • whether it's connected to source
  • some function like this that can be a wrapper for other functions (perhaps a decorator for this!) so that we are checking that we are connected before making DB calls.
  • abstract connect function
  • some abstruct dummy function, like getUser()

Eventually, we can use this to plug in like a Mongo DB or a SQL DB or whatever as we need.

  • Create abstract Database class that contains basic info
  • Create a "dummy" database instance (just as file) that for now just returns dummy data and implements necessary functions to extend Database class.