We should abstract out the DB access to an interface.
Easier to test
Easier to switch out the DB implementation (maybe we want to move away from GORM?)
Easier to add middlewares such as a in-memory or Redis based cache
Easier to extract some parts of the DB to separate data stores, such as storing artifacts in an S3 instead of inside Postgres or logs inside elasticsearch
We should abstract out the DB access to an interface.
The database should be a plugin.