Documentation
¶
Overview ¶
普通模式同步 update 转成 insert on update insert 转成 replace into delete 转成 delete 只要是同一条数据,只要有遍历过,后面遍历出来的数据,则不再进行操作
Index ¶
- Constants
- func AllTypeToInt64(s interface{}) (int64, error)
- func AllTypeToUInt64(s interface{}) (uint64, error)
- func CkDataTypeTransfer(data interface{}, fieldName string, toDataType string, ...) (v interface{}, e error)
- func NewConn() pluginDriver.Driver
- type ClickhouseDB
- func (This *ClickhouseDB) Close() bool
- func (This *ClickhouseDB) Exec(sql string, value []driver.Value) error
- func (This *ClickhouseDB) GetConn() clickhouse.Clickhouse
- func (This *ClickhouseDB) GetSchemaList() (data []string)
- func (This *ClickhouseDB) GetSchemaTableList(schema string) (data []string)
- func (This *ClickhouseDB) GetTableDataList(schema string, table string, where string) (data []map[string]driver.Value)
- func (This *ClickhouseDB) GetTableFields(SchemaName, TableName string) (data []ckFieldStruct)
- func (This *ClickhouseDB) GetVersion() (Version string)
- func (This *ClickhouseDB) Open() bool
- type Conn
- func (This *Conn) AutoCommit() (LastSuccessCommitData *pluginDriver.PluginDataType, ...)
- func (This *Conn) AutoCreateTableCommit(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)
- func (This *Conn) CheckDataSkip(data *pluginDriver.PluginDataType) bool
- func (This *Conn) CheckUri() error
- func (This *Conn) Close() bool
- func (This *Conn) Commit(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
- func (This *Conn) CommitLogMod_Append(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)
- func (This *Conn) CommitNormal(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)
- func (This *Conn) Connect() bool
- func (This *Conn) CreateCkDatabase(SchemaName string) (err error)
- func (This *Conn) CreateCkTable(data *pluginDriver.PluginDataType) (ckField []fieldStruct, err error)
- func (This *Conn) Del(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
- func (This *Conn) GetFieldName(Name string) string
- func (This *Conn) GetParam(p interface{}) (*PluginParam, error)
- func (This *Conn) GetSchemaName(Name string) (SchemaName string)
- func (This *Conn) GetUriExample() string
- func (This *Conn) InitVersion()
- func (This *Conn) InitVersion0(versionStr string) int
- func (This *Conn) Insert(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
- func (This *Conn) NotCreateTableCommit(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)
- func (This *Conn) Open() error
- func (This *Conn) Query(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
- func (This *Conn) ReConnect() bool
- func (This *Conn) SetOption(uri *string, param map[string]interface{})
- func (This *Conn) SetParam(p interface{}) (interface{}, error)
- func (This *Conn) Skip(SkipData *pluginDriver.PluginDataType) error
- func (This *Conn) TimeOutCommit() (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
- func (This *Conn) TransferToCreateDatabaseSql(SchemaName string) (sql string)
- func (This *Conn) TransferToCreateTableSql(data *pluginDriver.PluginDataType) (sql string, ckField []fieldStruct)
- func (This *Conn) Update(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
- type PluginClickHouseController
- type PluginParam
- type PluginParam0
- type SyncType
- type TableDataStruct
Constants ¶
View Source
const BIFROST_VERION = "v1.6.3"
View Source
const VERSION = "v1.6.3"
Variables ¶
This section is empty.
Functions ¶
func AllTypeToInt64 ¶
func AllTypeToUInt64 ¶
func CkDataTypeTransfer ¶
func NewConn ¶
func NewConn() pluginDriver.Driver
Types ¶
type ClickhouseDB ¶
type ClickhouseDB struct {
// contains filtered or unexported fields
}
func NewClickHouseDBConn ¶
func NewClickHouseDBConn(uri string) *ClickhouseDB
func (*ClickhouseDB) Close ¶
func (This *ClickhouseDB) Close() bool
func (*ClickhouseDB) GetConn ¶
func (This *ClickhouseDB) GetConn() clickhouse.Clickhouse
func (*ClickhouseDB) GetSchemaList ¶
func (This *ClickhouseDB) GetSchemaList() (data []string)
func (*ClickhouseDB) GetSchemaTableList ¶
func (This *ClickhouseDB) GetSchemaTableList(schema string) (data []string)
func (*ClickhouseDB) GetTableDataList ¶
func (*ClickhouseDB) GetTableFields ¶
func (This *ClickhouseDB) GetTableFields(SchemaName, TableName string) (data []ckFieldStruct)
func (*ClickhouseDB) GetVersion ¶
func (This *ClickhouseDB) GetVersion() (Version string)
func (*ClickhouseDB) Open ¶
func (This *ClickhouseDB) Open() bool
type Conn ¶
type Conn struct { pluginDriver.PluginDriverInterface // contains filtered or unexported fields }
func (*Conn) AutoCommit ¶
func (This *Conn) AutoCommit() (LastSuccessCommitData *pluginDriver.PluginDataType, ErrData *pluginDriver.PluginDataType, e error)
合并数据,提交到 ck里
func (*Conn) AutoCreateTableCommit ¶
func (This *Conn) AutoCreateTableCommit(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)
自动创建表的提交
func (*Conn) CheckDataSkip ¶
func (This *Conn) CheckDataSkip(data *pluginDriver.PluginDataType) bool
func (*Conn) Commit ¶
func (This *Conn) Commit(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
func (*Conn) CommitLogMod_Append ¶ added in v1.2.2
func (This *Conn) CommitLogMod_Append(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)
func (*Conn) CommitNormal ¶ added in v1.2.2
func (This *Conn) CommitNormal(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)
func (*Conn) CreateCkDatabase ¶
通过数据自动创建 ck 库
func (*Conn) CreateCkTable ¶
func (This *Conn) CreateCkTable(data *pluginDriver.PluginDataType) (ckField []fieldStruct, err error)
通过数据自动创建 ck 表
func (*Conn) Del ¶
func (This *Conn) Del(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
func (*Conn) GetFieldName ¶
func (*Conn) GetParam ¶
func (This *Conn) GetParam(p interface{}) (*PluginParam, error)
func (*Conn) GetSchemaName ¶
func (*Conn) GetUriExample ¶
func (*Conn) InitVersion ¶
func (This *Conn) InitVersion()
func (*Conn) InitVersion0 ¶
func (*Conn) Insert ¶
func (This *Conn) Insert(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
func (*Conn) NotCreateTableCommit ¶
func (This *Conn) NotCreateTableCommit(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)
非自动创建表的提交
func (*Conn) Query ¶
func (This *Conn) Query(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
func (*Conn) TimeOutCommit ¶
func (This *Conn) TimeOutCommit() (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
func (*Conn) TransferToCreateDatabaseSql ¶
func (*Conn) TransferToCreateTableSql ¶
func (This *Conn) TransferToCreateTableSql(data *pluginDriver.PluginDataType) (sql string, ckField []fieldStruct)
func (*Conn) Update ¶
func (This *Conn) Update(data *pluginDriver.PluginDataType, retry bool) (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)
type PluginClickHouseController ¶
type PluginClickHouseController struct {
controller.CommonController
}
func (*PluginClickHouseController) GetClickHouseSchemaList ¶
func (c *PluginClickHouseController) GetClickHouseSchemaList()
func (*PluginClickHouseController) GetClickHouseSchemaTableList ¶
func (c *PluginClickHouseController) GetClickHouseSchemaTableList()
func (*PluginClickHouseController) GetClickHouseTableFields ¶
func (c *PluginClickHouseController) GetClickHouseTableFields()
type PluginParam ¶
type PluginParam struct { Field []fieldStruct BatchSize int CkSchema string CkTable string PriKey []fieldStruct SyncType SyncType AutoCreateTable bool NullNotTransferDefault bool //是否将null值强制转成相对应类型的默认值 , false 将 null 转成相对就的 0 或者 "" , true 不进行转换,为了兼容老版本,才反过来的 BifrostMustBeSuccess bool // bifrost server 保留,数据是否能丢 LowerCaseTableNames int8 // 0 源字段怎么样,就怎么样,1 转成小写,2 全部转成大写; 只对自动建表的功能有效 Data *TableDataStruct SkipBinlogData *pluginDriver.PluginDataType // 在执行 skip 的时候 ,进行传入进来的时候需要要过滤的 位点,在每次commit之后,这个数据会被清空 // contains filtered or unexported fields }
type PluginParam0 ¶
type TableDataStruct ¶
type TableDataStruct struct { Data []*pluginDriver.PluginDataType CommitData []*pluginDriver.PluginDataType // commit 提交的数据列表,Data 每 BatchSize 数据量划分为一个最后提交的commit }
func NewTableData ¶
func NewTableData() *TableDataStruct
Click to show internal directories.
Click to hide internal directories.