m3db

package
v0.0.0-...-e2be02a Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = m3util.NewLogger("m3db", m3util.INFO)

Functions

func AddTableDef

func AddTableDef(tDef *TableDefinition)

Types

type DbConnDetails

type DbConnDetails struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	DbName   string `json:"dbName"`
}

type QsmDbEnvironment

type QsmDbEnvironment struct {
	m3util.BaseQsmEnvironment
	// contains filtered or unexported fields
}

func GetEnvironment

func GetEnvironment(envId m3util.QsmEnvID) *QsmDbEnvironment

func NewQsmDbEnvironment

func NewQsmDbEnvironment(config config.Config) *QsmDbEnvironment

func (*QsmDbEnvironment) CheckSchema

func (env *QsmDbEnvironment) CheckSchema() error

func (*QsmDbEnvironment) Close

func (env *QsmDbEnvironment) Close()

func (*QsmDbEnvironment) CloseDb

func (env *QsmDbEnvironment) CloseDb()

func (*QsmDbEnvironment) DataChecked

func (env *QsmDbEnvironment) DataChecked(dataIdx int) bool

func (*QsmDbEnvironment) Destroy

func (env *QsmDbEnvironment) Destroy()

func (*QsmDbEnvironment) ExecOnce

func (env *QsmDbEnvironment) ExecOnce(dataIdx int, doInit func() error) error

func (*QsmDbEnvironment) GetConnection

func (env *QsmDbEnvironment) GetConnection() *sql.DB

func (*QsmDbEnvironment) GetDbConf

func (env *QsmDbEnvironment) GetDbConf() DbConnDetails

func (*QsmDbEnvironment) GetOrCreateTableExec

func (env *QsmDbEnvironment) GetOrCreateTableExec(tableName string) (*TableExec, error)

func (*QsmDbEnvironment) GetSchemaName

func (env *QsmDbEnvironment) GetSchemaName() string

func (*QsmDbEnvironment) OpenDb

func (env *QsmDbEnvironment) OpenDb() error

func (*QsmDbEnvironment) Ping

func (env *QsmDbEnvironment) Ping() bool

type QsmWrongCount

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

func (*QsmWrongCount) Actual

func (err *QsmWrongCount) Actual() int

func (*QsmWrongCount) Error

func (err *QsmWrongCount) Error() string

type TableDefinition

type TableDefinition struct {
	Name           string
	DdlColumns     string
	DdlColumnsRefs []string
	Indexes        []string
	Insert         string
	SelectAll      string
	Queries        []string
	QueryTableRefs map[int][]string
	ExpectedCount  int

	ErrorFilter func(err error) bool
}

type TableExec

type TableExec struct {
	TableDef    *TableDefinition
	InsertStmt  *sql.Stmt
	QueriesStmt []*sql.Stmt
	// contains filtered or unexported fields
}

func (*TableExec) Close

func (te *TableExec) Close() error

func (*TableExec) CloseRows

func (te *TableExec) CloseRows(rows *sql.Rows)

func (*TableExec) GetConnection

func (te *TableExec) GetConnection() *sql.DB

func (*TableExec) GetForSaveAll

func (te *TableExec) GetForSaveAll() (int, bool, error)

Return the number of rows in the table, than a bool if the table should be filled and an error if something is wrong

func (*TableExec) GetFullTableName

func (te *TableExec) GetFullTableName() string

func (*TableExec) Insert

func (te *TableExec) Insert(args ...interface{}) error

func (*TableExec) InsertReturnId

func (te *TableExec) InsertReturnId(args ...interface{}) (int64, error)

func (*TableExec) IsFiltered

func (te *TableExec) IsFiltered(err error) bool

func (*TableExec) PrepareQueries

func (te *TableExec) PrepareQueries() error

func (*TableExec) Query

func (te *TableExec) Query(queryId int, args ...interface{}) (*sql.Rows, error)

func (*TableExec) QueryRow

func (te *TableExec) QueryRow(queryId int, args ...interface{}) *sql.Row

func (*TableExec) SelectAllForLoad

func (te *TableExec) SelectAllForLoad() (*sql.Rows, error)

func (*TableExec) SetFilled

func (te *TableExec) SetFilled()

func (*TableExec) Update

func (te *TableExec) Update(queryId int, args ...interface{}) (int, error)

func (*TableExec) WasChecked

func (te *TableExec) WasChecked() bool

func (*TableExec) WasCreated

func (te *TableExec) WasCreated() bool

Jump to

Keyboard shortcuts

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