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
+1 -1
View File
@@ -105,7 +105,7 @@ func deleteAlertByIdInternal(alertId int64, reason string, sess *db.Session, log
func (ss *sqlStore) HandleAlertsQuery(ctx context.Context, query *models.GetAlertsQuery) error {
return ss.db.WithDbSession(ctx, func(sess *db.Session) error {
builder := db.NewSqlBuilder(ss.cfg)
builder := db.NewSqlBuilder(ss.cfg, ss.db.GetDialect())
builder.Write(`SELECT
alert.id,