Files
grafana/pkg/services/sqlstore/store.go
Serge Zaitsev 9cdb6b07c7 Chore: Move stats service into a standalone packge from sqlstore (#59574)
* move original stats service into a separate package

* add stats service to wire

* move GetAdminStats

* switch to using stats.Service

* add missing package

* fix api tests
2022-11-30 18:11:07 +01:00

29 lines
927 B
Go

package sqlstore
import (
"context"
"xorm.io/core"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/services/sqlstore/session"
"github.com/grafana/grafana/pkg/services/user"
)
type Store interface {
GetDialect() migrator.Dialect
GetDBType() core.DbType
CreateUser(ctx context.Context, cmd user.CreateUserCommand) (*user.User, error)
WithDbSession(ctx context.Context, callback DBTransactionFunc) error
WithNewDbSession(ctx context.Context, callback DBTransactionFunc) error
WithTransactionalDbSession(ctx context.Context, callback DBTransactionFunc) error
InTransaction(ctx context.Context, fn func(ctx context.Context) error) error
Migrate(bool) error
Sync() error
Reset() error
Quote(value string) string
GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error
GetSqlxSession() *session.SessionDB
}