DB Backend: embed `dbutil.DB` in `TransactableHandle`
Created by: camdencheek
Ths embeds dbutil.DB
in TransactableHandle
so it doesn't need to be unwrapped to a dbutil.DB
before use. This enables two things:
- It can be mocked. There are a couple of places where we override the behavior of
Transact
for the purpose of tests, so this makes it possible to keep this pattern with the new well-typedTransactableHandles
. - The
TransactableHandle
now has full control over all database calls, so it can now report when transactions are used concurrently.
Stacked on https://github.com/sourcegraph/sourcegraph/pull/37163
Test plan
This just moves things to an embedding rather than a method and should be completely safe. Depending on gopls, but if tests pass I'm happy