To add the functionality of being able to retrieve the backups metadata and to expose it through the API, we need to develop functionality/code to connect to the database.
We plan to do this using SQLAlchemy, an ORM (object-relation mapper). As this is really abstracted, we should try and understand what exactly is happening in the background (whether it keeping an open connection, whether it is sending queries in an optimised manner, I need to do some reading on this from my side)
We also need a way to pass this database configs through the environment variable as a config (eg, db host, name, password, etc) -- as part of this ticket this needs implementing as well
We will build on top of work done in T284399
Tasks
- Create Data models for the backups table
- Develop code to connect our api_db program to a MariaDB database using SQLAlchemy or other suitable tool
- Create API endpoint to show recent backups for all sections (s1-s8)
Acceptance
- Successfully able to connect to MariaDB database
- Successfully able to display "some" database data through API
- Successfully able to see recent data for sections through API call