Chore: Use db.DB interface instead of sqlstore (#54358)

* use db.DB interface instead of sqlstore

* make store service depends on db.DB instead of sqlstore
This commit is contained in:
ying-jeanne
2022-08-26 19:07:58 -05:00
committed by GitHub
parent 216185b7f0
commit fe062f2eaa
3 changed files with 10 additions and 9 deletions
+4 -4
View File
@@ -16,7 +16,7 @@ import (
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/quota"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/db"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
)
@@ -83,7 +83,7 @@ type StorageService interface {
}
type standardStorageService struct {
sql *sqlstore.SQLStore
sql db.DB
tree *nestedTree
cfg *GlobalStorageConfig
authService storageAuthService
@@ -91,7 +91,7 @@ type standardStorageService struct {
}
func ProvideService(
sql *sqlstore.SQLStore,
sql db.DB,
features featuremgmt.FeatureToggles,
cfg *setting.Cfg,
quotaService quota.Service,
@@ -242,7 +242,7 @@ func createSystemBrandingPathFilter() filestorage.PathFilter {
}
func newStandardStorageService(
sql *sqlstore.SQLStore,
sql db.DB,
globalRoots []storageRuntime,
initializeOrgStorages func(orgId int64) []storageRuntime,
authService storageAuthService,
+2 -2
View File
@@ -6,7 +6,7 @@ import (
"strings"
"github.com/grafana/grafana/pkg/infra/filestorage"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/db"
"github.com/grafana/grafana-plugin-sdk-go/data"
)
@@ -30,7 +30,7 @@ func getDbStoragePathPrefix(orgId int64, storageName string) string {
return filestorage.Join(fmt.Sprintf("%d", orgId), storageName+filestorage.Delimiter)
}
func newSQLStorage(meta RootStorageMeta, prefix string, name string, descr string, cfg *StorageSQLConfig, sql *sqlstore.SQLStore, orgId int64) *rootStorageSQL {
func newSQLStorage(meta RootStorageMeta, prefix string, name string, descr string, cfg *StorageSQLConfig, sql db.DB, orgId int64) *rootStorageSQL {
if cfg == nil {
cfg = &StorageSQLConfig{}
}