base

package
v0.2.1-0...-d023f04 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyColumnTypes

func ApplyColumnTypes(db usql.QueryAble, databaseName, tableName string, columnsLists ...*common.ColumnList) error

func BuildCreateTableColsFromMap

func BuildCreateTableColsFromMap(cols []*ast.ColumnDef, columnMap []string) (r []*ast.ColumnDef)

func GenerateSetSystemVariables

func GenerateSetSystemVariables(systemVariables [][2]string) string

func GetCandidateUniqueKeys

func GetCandidateUniqueKeys(logger g.LoggerType, db usql.QueryAble, databaseName, tableName string,
	columns *common.ColumnList) (uniqueKeys []*common.UniqueKey, err error)

func GetIntervals

func GetIntervals(set *gomysql.MysqlGTIDSet, uuidStr string) gomysql.IntervalSlice

func GetSelfBinlogCoordinates

func GetSelfBinlogCoordinates(db usql.QueryAble) (selfBinlogCoordinates *common.MySQLCoordinates, err error)

func GetSomeSysVars

func GetSomeSysVars(db usql.QueryAble, logger g.LoggerType) (r struct {
	Err                 error
	Version             string
	TimeZome            string
	LowerCaseTableNames umconf.LowerCaseTableNamesValue
	NetWriteTimeout     int
})

func GetTableColumns

func GetTableColumns(db usql.QueryAble, databaseName, tableName string) (*common.ColumnList, error)

func GetTableColumnsSqle

func GetTableColumnsSqle(sqleContext *sqle.Context, schema string,
	table string) (r *common.ColumnList, fkParents []*ast.TableName, err error)

func GtidSetContains

func GtidSetContains(lock *sync.RWMutex, set *gomysql.MysqlGTIDSet, uuidStr string, gno int64) bool

func GtidSetDiff

func GtidSetDiff(set1 string, set2 string) (string, error)

func MySQL57CollationMapping

func MySQL57CollationMapping(name string) string

func MySQL57CollationReplaceWorkaround

func MySQL57CollationReplaceWorkaround(sql string) string

func ParseBinlogCoordinatesFromRow

func ParseBinlogCoordinatesFromRow(row *sql.Row) (r *common.MySQLCoordinates, err error)

func ParserRestore

func ParserRestore(stmt ast.Node) (string, error)

func PrettifyDurationOutput

func PrettifyDurationOutput(d time.Duration) string

func RenameCreateSchemaAddINE

func RenameCreateSchemaAddINE(createSchema string, newSchema string) (string, error)

rename schema and add `if not exists`

func RenameCreateTable

func RenameCreateTable(createTable string, newSchema string, newTable string, columnMap []string) (string, error)

func ShowCreateTable

func ShowCreateTable(db usql.QueryAble, databaseName, tableName string) (statement string, err error)

func ShowCreateView

func ShowCreateView(db *gosql.DB, databaseName, tableName string, dropTableIfExists bool) (createTableStatement string, err error)

func StringContainsAll

func StringContainsAll(s string, substrings ...string) bool

StringContainsAll returns true if `s` contains all non empty given `substrings` The function returns `false` if no non-empty arguments are given.

func StringInterval

func StringInterval(intervals gomysql.IntervalSlice) string

Types

type BinlogEvent

type BinlogEvent struct {
	BinlogFile string
	RealPos    uint32
	Header     *replication.EventHeader
	Evt        replication.Event
	RawBs      []byte
	Query      []string //[]StreamEvent

	Err error
}

type GtidItem

type GtidItem struct {
	NRow int
}

type GtidItemMap

type GtidItemMap map[uuid.UUID]*GtidItem

func (*GtidItemMap) GetItem

func (m *GtidItemMap) GetItem(u uuid.UUID) (item *GtidItem)

Jump to

Keyboard shortcuts

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