From ba6c715708643c1390279c2f671e1dd1a34d4d6a Mon Sep 17 00:00:00 2001 From: Selene Date: Mon, 17 Oct 2022 16:27:56 +0200 Subject: [PATCH] Chore: Delete unused db in orgs and use db in datasources (#57085) * Delete unused db in orgs and use db in datasources * Sort imports --- pkg/services/datasources/service/store.go | 2 +- pkg/services/org/orgimpl/org.go | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pkg/services/datasources/service/store.go b/pkg/services/datasources/service/store.go index e2a55cf12f8..bb951b31dc2 100644 --- a/pkg/services/datasources/service/store.go +++ b/pkg/services/datasources/service/store.go @@ -36,7 +36,7 @@ type SqlStore struct { logger log.Logger } -func CreateStore(db sqlstore.Store, logger log.Logger) *SqlStore { +func CreateStore(db db.DB, logger log.Logger) *SqlStore { return &SqlStore{db: db, logger: logger} } diff --git a/pkg/services/org/orgimpl/org.go b/pkg/services/org/orgimpl/org.go index 85a7e205757..649a6c263bb 100644 --- a/pkg/services/org/orgimpl/org.go +++ b/pkg/services/org/orgimpl/org.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/org" - "github.com/grafana/grafana/pkg/services/sqlstore" + "github.com/grafana/grafana/pkg/services/sqlstore/db" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" ) @@ -16,11 +16,9 @@ type Service struct { store store cfg *setting.Cfg log log.Logger - // TODO remove sqlstore and use db.DB - sqlStore sqlstore.Store } -func ProvideService(db sqlstore.Store, cfg *setting.Cfg) org.Service { +func ProvideService(db db.DB, cfg *setting.Cfg) org.Service { log := log.New("org service") return &Service{ store: &sqlStore{ @@ -29,9 +27,8 @@ func ProvideService(db sqlstore.Store, cfg *setting.Cfg) org.Service { log: log, cfg: cfg, }, - cfg: cfg, - log: log, - sqlStore: db, + cfg: cfg, + log: log, } }