Add better mocking for stores
Created by: camdencheek
This tracks the progress towards implementation of #26129.
Game plan:
-
Convert store structs to interfaces and generate mocks for each store -
Mint database.DBtype that has methods to return specific store types -
Move store doc comments from implementing structs to interface -
Replace global mocks with injected mocks -
Replace uses of dbutil.DBwithdatabase.DB(in progress) -
Replace uses of database constructor functions with database.DBmethods (in progress) -
Figure out how to handle enterprise-only stores in a mockable way -
Change database.NewDB()to take a*sql.DBrather than adbutil.DB -
Update transaction code to avoid casing on the concrete type of a dbutil.DB -
Remove uses of dbconn.Globalsince it can't be mocked: done
See progress in a code insights dashboard here