db

package
v0.0.0-...-f5e5802 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMysqlTableColumns

func GetMysqlTableColumns(schema string, table string) (columns []string, metaFromMaster bool, err error)

func InitBinLogCenter

func InitBinLogCenter(binlogCenter *BinLogCenterInfo) error

func InitManageDb

func InitManageDb(dbHost string, dbPort int, dbUser, dbPass string, dbDatabase string, srcHost, srcUser, srcPass string, srcPort int, metaStoreType string, srcGTID string) (err error)

func SaveReplicationPos

func SaveReplicationPos(ctx context.Context, instanceName string, binlogPos uint32, binlogGtid, binlogFile string) (err error)

func UpdateMysqlTableColumns

func UpdateMysqlTableColumns(schema, table string) error

Types

type BinLogCenterInfo

type BinLogCenterInfo struct {
	Id           int64                          `json:"id"`
	InstanceName string                         `json:"instance_name"`
	BinlogPos    uint32                         `json:"binlog_pos"`
	BinlogGtid   string                         `json:"binlog_gtid"`
	BinlogFile   string                         `json:"binlog_file"`
	MetaData     map[string]map[string][]string `json:"meta_data"`
}

func GetReplicationPos

func GetReplicationPos(ctx context.Context, instanceName string) (*BinLogCenterInfo, error)

type DDLEvent

type DDLEvent struct {
	Schema string `json:"schema"`
	Table  string `json:"table"`
	Type   string `json:"type"`
}

func ParseDDLStmt

func ParseDDLStmt(stmt ast.StmtNode) (es []*DDLEvent)

type MysqlTableMeta

type MysqlTableMeta struct {
	TableSchema string `db:"table_schema" json:"table_schema"`
	TableName   string `db:"table_name" json:"table_name"`
	Column_name string `db:"column_name" json:"column_name"`
}

func GetMysqlMeta

func GetMysqlMeta(schema string, table string) ([]MysqlTableMeta, error)

type TableBinlogInfo

type TableBinlogInfo struct {
	Id           int64  `db:"id" json:"id"`
	InstanceName string `db:"instance_name" json:"instance_name"`
	BinlogPos    uint32 `db:"binlog_pos" json:"binlog_pos"`
	BinlogGtid   string `db:"binlog_gtid" json:"binlog_gtid"`
	BinlogFile   string `db:"binlog_file" json:"binlog_file"`
	MetaData     string `db:"meta_data" json:"meta_data"`
}

Jump to

Keyboard shortcuts

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