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.