preslavrachev/go-service-template

Abstract gorm.DB into an interface

Opened this issue · 0 comments

The direct reference of the persistence package to the gorm.DB ORM instance makes it difficult to test without setting up a temporary DB. This can be made easier by referring to the ORM instance as an interface (e.g. IGormDB) and mocking the interface.