2022-02-01 07:51:22 -06:00
|
|
|
package sqlstore
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
2022-06-22 07:16:28 -05:00
|
|
|
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
2022-08-16 13:17:14 -05:00
|
|
|
"github.com/grafana/grafana/pkg/services/sqlstore/session"
|
2022-06-28 07:32:25 -05:00
|
|
|
"github.com/grafana/grafana/pkg/services/user"
|
2022-02-01 07:51:22 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
type Store interface {
|
2022-02-04 10:53:58 -06:00
|
|
|
GetAdminStats(ctx context.Context, query *models.GetAdminStatsQuery) error
|
2022-02-11 07:04:15 -06:00
|
|
|
GetAlertNotifiersUsageStats(ctx context.Context, query *models.GetAlertNotifierUsageStatsQuery) error
|
|
|
|
GetDataSourceStats(ctx context.Context, query *models.GetDataSourceStatsQuery) error
|
|
|
|
GetDataSourceAccessStats(ctx context.Context, query *models.GetDataSourceAccessStatsQuery) error
|
2022-06-22 07:16:28 -05:00
|
|
|
GetDialect() migrator.Dialect
|
2022-02-11 07:04:15 -06:00
|
|
|
GetSystemStats(ctx context.Context, query *models.GetSystemStatsQuery) error
|
2022-02-01 07:51:22 -06:00
|
|
|
GetOrgByName(name string) (*models.Org, error)
|
2022-04-25 12:07:11 -05:00
|
|
|
CreateOrg(ctx context.Context, cmd *models.CreateOrgCommand) error
|
2022-02-01 07:51:22 -06:00
|
|
|
CreateOrgWithMember(name string, userID int64) (models.Org, error)
|
2022-02-23 04:12:37 -06:00
|
|
|
GetOrgById(context.Context, *models.GetOrgByIdQuery) error
|
|
|
|
GetOrgByNameHandler(ctx context.Context, query *models.GetOrgByNameQuery) error
|
2022-06-28 07:32:25 -05:00
|
|
|
CreateUser(ctx context.Context, cmd user.CreateUserCommand) (*user.User, error)
|
2022-02-01 07:51:22 -06:00
|
|
|
SetUsingOrg(ctx context.Context, cmd *models.SetUsingOrgCommand) error
|
|
|
|
GetUserProfile(ctx context.Context, query *models.GetUserProfileQuery) error
|
|
|
|
GetUserOrgList(ctx context.Context, query *models.GetUserOrgListQuery) error
|
|
|
|
GetSignedInUser(ctx context.Context, query *models.GetSignedInUserQuery) error
|
|
|
|
UpdateUserPermissions(userID int64, isAdmin bool) error
|
|
|
|
SetUserHelpFlag(ctx context.Context, cmd *models.SetUserHelpFlagCommand) error
|
|
|
|
NewSession(ctx context.Context) *DBSession
|
|
|
|
WithDbSession(ctx context.Context, callback DBTransactionFunc) error
|
|
|
|
GetOrgQuotaByTarget(ctx context.Context, query *models.GetOrgQuotaByTargetQuery) error
|
|
|
|
GetOrgQuotas(ctx context.Context, query *models.GetOrgQuotasQuery) error
|
|
|
|
UpdateOrgQuota(ctx context.Context, cmd *models.UpdateOrgQuotaCmd) error
|
|
|
|
GetUserQuotaByTarget(ctx context.Context, query *models.GetUserQuotaByTargetQuery) error
|
|
|
|
GetUserQuotas(ctx context.Context, query *models.GetUserQuotasQuery) error
|
|
|
|
UpdateUserQuota(ctx context.Context, cmd *models.UpdateUserQuotaCmd) error
|
|
|
|
GetGlobalQuotaByTarget(ctx context.Context, query *models.GetGlobalQuotaByTargetQuery) error
|
|
|
|
WithTransactionalDbSession(ctx context.Context, callback DBTransactionFunc) error
|
|
|
|
InTransaction(ctx context.Context, fn func(ctx context.Context) error) error
|
2022-02-15 10:54:27 -06:00
|
|
|
Migrate(bool) error
|
2022-02-01 07:51:22 -06:00
|
|
|
Sync() error
|
|
|
|
Reset() error
|
|
|
|
Quote(value string) string
|
2022-02-04 07:33:35 -06:00
|
|
|
GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error
|
2022-09-20 05:18:39 -05:00
|
|
|
SearchOrgs(ctx context.Context, query *models.SearchOrgsQuery) error
|
2022-08-16 13:17:14 -05:00
|
|
|
GetSqlxSession() *session.SessionDB
|
2022-02-01 07:51:22 -06:00
|
|
|
}
|