utils

package
v0.0.0-...-be15534 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LargeTableColumns = map[string]interface{}{
	"t":           []uint8("127"),
	"tu1":         []uint8("127"),
	"tu2":         []uint8("128"),
	"tu3":         []uint8("0"),
	"tu4":         nil,
	"s":           []uint8("32767"),
	"su1":         []uint8("32767"),
	"su2":         []uint8("32768"),
	"su3":         []uint8("0"),
	"su4":         nil,
	"m":           []uint8("8388607"),
	"mu1":         []uint8("8388607"),
	"mu2":         []uint8("8388608"),
	"mu3":         []uint8("0"),
	"mu4":         nil,
	"i":           []uint8("2147483647"),
	"iu1":         []uint8("2147483647"),
	"iu2":         []uint8("2147483648"),
	"iu3":         []uint8("0"),
	"iu4":         nil,
	"bi":          []uint8("9223372036854775807"),
	"biu1":        []uint8("9223372036854775807"),
	"biu2":        []uint8("9223372036854775808"),
	"biu3":        []uint8("0"),
	"biu4":        nil,
	"floatT":      []uint8("3.14"),
	"doubleT":     []uint8("2.71"),
	"decimalT":    []uint8("2333.654321"),
	"floatTu":     []uint8("3.14"),
	"doubleTu":    []uint8("2.71"),
	"decimalTu":   []uint8("2333.123456"),
	"decimalTu2":  []uint8("1.7371"),
	"varcharT":    []uint8("测试Varchar"),
	"charT":       []uint8("测试String"),
	"binaryT":     []uint8("测试Binary"),
	"varbinaryT":  []uint8("测试varbinary"),
	"tinytextT":   []uint8("测试Tinytext"),
	"textT":       []uint8("测试text"),
	"mediumtextT": []uint8("测试mediumtext"),
	"longtextT":   []uint8("测试longtext"),
	"tinyblobT":   []uint8("测试tinyblob"),
	"blobT":       []uint8("测试blob"),
	"mediumblobT": []uint8("测试mediumblob"),
	"longblobT":   []uint8("测试longblob"),
	"dateT":       []uint8("2020-02-20"),
	"datetimeT":   []uint8("2020-02-20 02:20:20"),
	"timestampT":  []uint8("2020-02-20 10:20:20"),
	"timestampT2": []uint8("2024-03-11 08:51:01.461270"),
	"timeT":       []uint8("02:20:20"),
	"yearT":       []uint8("2020"),
	"enumT":       []uint8("a"),
	"setT":        []uint8("b"),
	"bitT":        []uint8{65},
	"jsonT":       []uint8("{\"key1\": \"value1\"}"),
}

LargeTableColumns is the columns of large table

Functions

func ExtractBasicMySQLType

func ExtractBasicMySQLType(mysqlType string) byte

ExtractBasicMySQLType return the mysql type

func GetMySQLType

func GetMySQLType(columnInfo *timodel.ColumnInfo, fullType bool) string

GetMySQLType get the mysql type from column info

func IsBinaryMySQLType

func IsBinaryMySQLType(mysqlType string) bool

IsBinaryMySQLType return true if the given mysqlType string is a binary type

func LargeColumnKeyValues

func LargeColumnKeyValues() ([]string, []driver.Value)

LargeColumnKeyValues returns the key values of large columns

func NewLargeEvent4Test

NewLargeEvent4Test creates large events for test

func SetBinChsClnFlag

func SetBinChsClnFlag(ft *types.FieldType) *types.FieldType

SetBinChsClnFlag set the binary charset flag.

func SetElems

func SetElems(ft *types.FieldType, elems []string) *types.FieldType

SetElems set the elems to the ft

func SetUnsigned

func SetUnsigned(ft *types.FieldType) *types.FieldType

SetUnsigned set the unsigned flag.

func WithUnsigned4MySQLType

func WithUnsigned4MySQLType(mysqlType string, unsigned bool) string

WithUnsigned4MySQLType add `unsigned` keyword. it should have the form `t unsigned`, such as `int unsigned`

func WithZerofill4MySQLType

func WithZerofill4MySQLType(mysqlType string, zerofill bool) string

WithZerofill4MySQLType add `zerofill` keyword.

Types

This section is empty.

Jump to

Keyboard shortcuts

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