starttls-backend icon indicating copy to clipboard operation
starttls-backend copied to clipboard

Move store interfaces to models

Open vbrown608 opened this issue 6 years ago • 0 comments

We store a database interface on the API, which includes all the methods of the SQL database. That interface is only ever satisfied in our code the the SQL database in db/sqldb.go

  • We could mock small pieces of the database in the model layer by passing the DB to model functions as a param and casting it to a smaller interface (eg ScanStore).
  • We don't necessarily need to represent the DB as an interface on the API, since we write end-to-end tests that access the actual SQL implementation.

vbrown608 avatar Feb 06 '19 23:02 vbrown608