chore: replace sqlstore.Store with db.DB (#57010)

* chore: replace sqlstore.SQLStore with db.DB

* more post-sqlstore.SQLStore cleanup
This commit is contained in:
Kristin Laemmert
2022-10-14 15:33:06 -04:00
committed by GitHub
parent 2b4d57fe60
commit c61b5e85b4
59 changed files with 275 additions and 244 deletions

View File

@@ -5,7 +5,7 @@ import (
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/db"
"github.com/grafana/grafana/pkg/services/team"
"github.com/grafana/grafana/pkg/services/user"
)
@@ -13,7 +13,7 @@ import (
type Provider struct{}
func ProvideService(
store *sqlstore.SQLStore, ac accesscontrol.AccessControl,
store db.DB, ac accesscontrol.AccessControl,
folderPermissionsService accesscontrol.FolderPermissionsService, dashboardPermissionsService accesscontrol.DashboardPermissionsService,
dashboardService dashboards.DashboardService, teamService team.Service,
) *Provider {
@@ -26,14 +26,14 @@ func ProvideService(
return &Provider{}
}
func InitLegacyGuardian(store sqlstore.Store, dashSvc dashboards.DashboardService, teamSvc team.Service) {
func InitLegacyGuardian(store db.DB, dashSvc dashboards.DashboardService, teamSvc team.Service) {
New = func(ctx context.Context, dashId int64, orgId int64, user *user.SignedInUser) DashboardGuardian {
return newDashboardGuardian(ctx, dashId, orgId, user, store, dashSvc, teamSvc)
}
}
func InitAccessControlGuardian(
store sqlstore.Store, ac accesscontrol.AccessControl, folderPermissionsService accesscontrol.FolderPermissionsService,
store db.DB, ac accesscontrol.AccessControl, folderPermissionsService accesscontrol.FolderPermissionsService,
dashboardPermissionsService accesscontrol.DashboardPermissionsService, dashboardService dashboards.DashboardService,
) {
New = func(ctx context.Context, dashId int64, orgId int64, user *user.SignedInUser) DashboardGuardian {