Skip to content

DB Backend: remove remaining uses of `database.NewUntypedDB()`

Warren Gifford requested to merge cc/remove-new-untyped-db into main

Created by: camdencheek

This removes the remaining uses of database.NewUntypedDB(), which allows me to remove basestore.NewHandleWithUntypedDB(), which allows me to remove oldTransactableHandle.

This is a very exciting step because it means it is now impossible to construct a handle with a dbutil.DB. A handle must be constructed with either a *sql.Tx or a *sql.DB directly. No more interface assertions.

The general pattern now is to construct a handle at startup, then pass that handle around within stores. And, since it's now impossible to get the *sql.DB or *sql.Tx wrapped by basestore.TransactableHandle, this is now enforced by the type system.

Stacked on https://github.com/sourcegraph/sourcegraph/pull/37165

Test plan

Depending on existing tests.

Merge request reports

Loading