tidbsql

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNCHANGE   columnAction = iota // 0
	ADD_COLUMN                     // 1
	DROP_COLUMN
	MODIFY_COLUMN
	RENAME_COLUMN
)

Variables

This section is empty.

Functions

func CompareColumn

func CompareColumn(lhs, rhs *cloudstorage.TableCol) (columnAction, error)

func GetCurrentTSO

func GetCurrentTSO(config *TiDBConfig) (uint64, error)

func GetTiDBTableColumn

func GetTiDBTableColumn(db *sql.DB, sourceDatabase, sourceTable string) ([]cloudstorage.TableCol, error)

func GetTiDBTablePKColumns added in v0.0.3

func GetTiDBTablePKColumns(db *sql.DB, sourceDatabase, sourceTable string) ([]string, error)

Types

type ColumnDiff

type ColumnDiff struct {
	Action columnAction
	Before *cloudstorage.TableCol
	After  *cloudstorage.TableCol
}

func GetColumnDiff

func GetColumnDiff(prev []cloudstorage.TableCol, curr []cloudstorage.TableCol) ([]ColumnDiff, error)

type TiDBConfig

type TiDBConfig struct {
	Host  string
	Port  int
	User  string
	Pass  string
	SSLCA string
}

func (*TiDBConfig) OpenDB

func (config *TiDBConfig) OpenDB() (*sql.DB, error)

func Open opens a connection to TiDB

Jump to

Keyboard shortcuts

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