Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDMLTestCases ¶
func NewDMLTestCases(t testing.TB) [][]*model.RowChangedEvent
NewDMLTestCases returns a bunch of DML test cases.
func TestBatchCodec ¶
func TestBatchCodec( t *testing.T, encoderBuilder codec.RowEventEncoderBuilder, newDecoder func(key []byte, value []byte) (codec.RowEventDecoder, error), )
TestBatchCodec tests bunch of cases for RowEventDecoder.
Types ¶
type Column ¶
type Column struct { Type byte `json:"t"` // Deprecated: please use Flag instead. WhereHandle bool `json:"h,omitempty"` Flag model.ColumnFlagType `json:"f"` Value any `json:"v"` }
Column is a type only used in codec internally.
func (*Column) FromRowChangeColumn ¶
func (c *Column) FromRowChangeColumn(col model.ColumnDataX)
FromRowChangeColumn converts from a row changed column to a codec column.
type JavaSQLType ¶
type JavaSQLType int32
JavaSQLType is the sql type defined in class java.sql.Types in java sdk
const ( JavaSQLTypeBIT JavaSQLType = -7 JavaSQLTypeTINYINT JavaSQLType = -6 JavaSQLTypeSMALLINT JavaSQLType = 5 JavaSQLTypeINTEGER JavaSQLType = 4 JavaSQLTypeBIGINT JavaSQLType = -5 JavaSQLTypeREAL JavaSQLType = 7 JavaSQLTypeDOUBLE JavaSQLType = 8 JavaSQLTypeDECIMAL JavaSQLType = 3 JavaSQLTypeCHAR JavaSQLType = 1 JavaSQLTypeVARCHAR JavaSQLType = 12 JavaSQLTypeDATE JavaSQLType = 91 JavaSQLTypeTIME JavaSQLType = 92 JavaSQLTypeTIMESTAMP JavaSQLType = 93 JavaSQLTypeBINARY JavaSQLType = -2 JavaSQLTypeVARBINARY JavaSQLType = -3 JavaSQLTypeLONGVARBINARY JavaSQLType = -4 JavaSQLTypeNULL JavaSQLType = 0 JavaSQLTypeBLOB JavaSQLType = 2004 JavaSQLTypeCLOB JavaSQLType = 2005 )
jdk 1.8
func MySQLType2JavaType ¶
func MySQLType2JavaType(mysqlType byte, isBinary bool) JavaSQLType
MySQLType2JavaType converts the mysql protocol types to java sql types see https://github.com/alibaba/canal/blob/b54bea5e3337c9597c427a53071d214ff04628d1/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java#L132-L269
type MessageKey ¶
type MessageKey struct { Ts uint64 `json:"ts"` Schema string `json:"scm,omitempty"` Table string `json:"tbl,omitempty"` RowID int64 `json:"rid,omitempty"` Partition *int64 `json:"ptn,omitempty"` Type model.MessageType `json:"t"` // Only Handle Key Columns encoded in the message's value part. OnlyHandleKey bool `json:"ohk,omitempty"` // Claim check location for the message ClaimCheckLocation string `json:"ccl,omitempty"` }
MessageKey defines the key for a message.
func (*MessageKey) Decode ¶
func (m *MessageKey) Decode(data []byte) error
Decode codes a message key from a byte slice.
func (*MessageKey) Encode ¶
func (m *MessageKey) Encode() ([]byte, error)
Encode encodes the message key to a byte slice.