chore: sqlstore cleanup (#60415)

* chore: remove unused test helper from sqlstore

TimeNow() is no longer used in any tests in this package.

* chore: move sqlstore.SQLBuilder to the infra/db package

This required some minor refactoring; we need to be a little more explicit about passing around the dialect and engine. On the other hand, that's a few fewer uses of the `dialect` global constant!

* chore: move UserDeletions into the only package using it

* cleanup around moving sqlbuilder

* remove dialect and sqlog global vars

* rename userDeletions to serviceAccountDeletions
This commit is contained in:
Kristin Laemmert
2022-12-16 11:09:06 -05:00
committed by GitHub
parent d332dab3ec
commit cc007e9727
12 changed files with 67 additions and 88 deletions
-2
View File
@@ -23,13 +23,11 @@ type DB interface {
}
type Session = sqlstore.DBSession
type SQLBuilder = sqlstore.SQLBuilder
type InitTestDBOpt = sqlstore.InitTestDBOpt
var InitTestDB = sqlstore.InitTestDB
var InitTestDBwithCfg = sqlstore.InitTestDBWithCfg
var ProvideService = sqlstore.ProvideService
var NewSqlBuilder = sqlstore.NewSqlBuilder
func IsTestDbSQLite() bool {
if db, present := os.LookupEnv("GRAFANA_TEST_DB"); !present || db == "sqlite" {