Versions in this module Expand all Collapse all v1 v1.2.1 May 30, 2024 v1.2.0 May 23, 2024 Changes in this version + func InitUndoConfig(cfg Config) + func RegisterUndoLogBuilder(executorType types.ExecutorType, fun func() UndoLogBuilder) + func RegisterUndoLogManager(m UndoLogManager) error + type BranchUndoLog struct + BranchID uint64 + Logs []SQLUndoLog + Xid string + func (b *BranchUndoLog) Marshal() []byte + func (b *BranchUndoLog) Reverse() + type CompressConfig struct + Enable bool + Threshold string + Type string + func (c *CompressConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) + type Config struct + CompressConfig CompressConfig + DataValidation bool + LogSerialization string + LogTable string + OnlyCareUpdateColumns bool + var UndoConfig Config + func (u *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) + type SQLUndoLog struct + AfterImage *types.RecordImage + BeforeImage *types.RecordImage + SQLType types.SQLType + TableName string + func (s SQLUndoLog) SetTableMeta(tableMeta *types.TableMeta) + type UndoExecutor interface + ExecuteOn func(ctx context.Context, dbType types.DBType, conn *sql.Conn) error + type UndoExecutorHolder interface + GetDeleteExecutor func(sqlUndoLog SQLUndoLog) UndoExecutor + GetInsertExecutor func(sqlUndoLog SQLUndoLog) UndoExecutor + GetUpdateExecutor func(sqlUndoLog SQLUndoLog) UndoExecutor + type UndoLogBuilder interface + AfterImage func(ctx context.Context, execCtx *types.ExecContext, ...) ([]*types.RecordImage, error) + BeforeImage func(ctx context.Context, execCtx *types.ExecContext) ([]*types.RecordImage, error) + GetExecutorType func() types.ExecutorType + func GetUndologBuilder(sqlType types.ExecutorType) UndoLogBuilder + type UndoLogManager interface + BatchDeleteUndoLog func(xid []string, branchID []int64, conn *sql.Conn) error + DBType func() types.DBType + DeleteUndoLog func(ctx context.Context, xid string, branchID int64, conn *sql.Conn) error + FlushUndoLog func(tranCtx *types.TransactionContext, conn driver.Conn) error + HasUndoLogTable func(ctx context.Context, conn *sql.Conn) (bool, error) + Init func() + RunUndo func(ctx context.Context, xid string, branchID int64, conn *sql.DB, dbName string) error + func GetUndoLogManager(d types.DBType) (UndoLogManager, error) + type UndoLogStatue int8 + const UndoLogStatueGlobalFinished + const UndoLogStatueNormnal + type UndologRecord struct + BranchID uint64 + Context []byte + LogCreated []byte + LogModified []byte + LogStatus UndoLogStatue + RollbackInfo []byte + XID string + func (u *UndologRecord) CanUndo() bool