db

package
v0.0.0-testrgm3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitTestDB = sqlstore.InitTestDB
View Source
var InitTestDBwithCfg = sqlstore.InitTestDBWithCfg
View Source
var ProvideService = sqlstore.ProvideService

Functions

func IsTestDBMSSQL

func IsTestDBMSSQL() bool

func IsTestDbMySQL

func IsTestDbMySQL() bool

func IsTestDbPostgres

func IsTestDbPostgres() bool

func IsTestDbSQLite

func IsTestDbSQLite() bool

Types

type DB

type DB interface {
	WithTransactionalDbSession(ctx context.Context, callback sqlstore.DBTransactionFunc) error
	WithDbSession(ctx context.Context, callback sqlstore.DBTransactionFunc) error
	WithNewDbSession(ctx context.Context, callback sqlstore.DBTransactionFunc) error
	GetDialect() migrator.Dialect
	GetDBType() core.DbType
	GetSqlxSession() *session.SessionDB
	InTransaction(ctx context.Context, fn func(ctx context.Context) error) error
	Quote(value string) string
	// RecursiveQueriesAreSupported runs a dummy recursive query and it returns true
	// if the query runs successfully or false if it fails with mysqlerr.ER_PARSE_ERROR error or any other error
	RecursiveQueriesAreSupported() (bool, error)
}

type InitTestDBOpt

type InitTestDBOpt = sqlstore.InitTestDBOpt

type SQLBuilder

type SQLBuilder struct {
	// contains filtered or unexported fields
}

func NewSqlBuilder

func NewSqlBuilder(cfg *setting.Cfg, features featuremgmt.FeatureToggles, dialect migrator.Dialect, recursiveQueriesAreSupported bool) SQLBuilder

func (*SQLBuilder) AddParams

func (sb *SQLBuilder) AddParams(params ...interface{})

func (*SQLBuilder) GetParams

func (sb *SQLBuilder) GetParams() []interface{}

func (*SQLBuilder) GetSQLString

func (sb *SQLBuilder) GetSQLString() string

func (*SQLBuilder) Write

func (sb *SQLBuilder) Write(sql string, params ...interface{})

func (*SQLBuilder) WriteDashboardPermissionFilter

func (sb *SQLBuilder) WriteDashboardPermissionFilter(user *user.SignedInUser, permission dashboards.PermissionType, queryType string)

type Session

type Session = sqlstore.DBSession

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL