2022-03-22 09:43:53 -05:00
|
|
|
package db
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/services/sqlstore"
|
2022-06-02 08:59:05 -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-03-22 09:43:53 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type DB interface {
|
|
|
|
WithTransactionalDbSession(ctx context.Context, callback sqlstore.DBTransactionFunc) error
|
|
|
|
WithDbSession(ctx context.Context, callback sqlstore.DBTransactionFunc) error
|
2022-08-03 10:17:26 -05:00
|
|
|
NewSession(ctx context.Context) *sqlstore.DBSession
|
2022-06-02 08:59:05 -05:00
|
|
|
GetDialect() migrator.Dialect
|
2022-08-16 13:17:14 -05:00
|
|
|
GetSqlxSession() *session.SessionDB
|
2022-08-26 10:03:38 -05:00
|
|
|
InTransaction(ctx context.Context, fn func(ctx context.Context) error) error
|
2022-03-22 09:43:53 -05:00
|
|
|
}
|