Skip to content

insights: make database handles type safe

Created by: coury-clark

Code Insights has two databases it interacts with, both pgsql and codeinsights-db. In some environments (at the moment dev) these are actually the same database. When we pass handles into stores we don't currently have any safety that the handle provided to the store actually represents the correct database. This can result in bugs that are only visible once on a deployed instance.

https://sourcegraph.sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:insights+%28dbutil.DB+or+database.DB%29&patternType=literal