grafana/pkg/services/folder/registry.go
Sofia Papagiannaki 89d3b55bec
Folders: Reduce DB queries when counting and deleting resources under folders (#81153)
* Add folder store method for fetching all folder descendants

* Modify GetDescendantCounts() to fetch folder descendants at once

* Reduce DB calls when counting library panels under dashboard

* Reduce DB calls when counting dashboards under folder

* Reduce DB calls during folder delete

* Modify folder registry to count/delete entities under multiple folders

* Reduce DB calls when counting

* Reduce DB calls when deleting
2024-01-30 18:26:34 +02:00

14 lines
361 B
Go

package folder
import (
"context"
"github.com/grafana/grafana/pkg/services/auth/identity"
)
type RegistryService interface {
DeleteInFolders(ctx context.Context, orgID int64, folderUIDs []string, user identity.Requester) error
CountInFolders(ctx context.Context, orgID int64, folderUIDs []string, user identity.Requester) (int64, error)
Kind() string
}