schema

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindMetaFileNotCreate

func FindMetaFileNotCreate(filePath string, initData string)

func GetMetaFilePath

func GetMetaFilePath(conf *config.BaseConfig) string

Types

type ColumnType

type ColumnType = int
const (
	TypeNumber    ColumnType = iota + 1 // tinyint, smallint, int, bigint, year
	TypeMediumInt                       // medium int
	TypeFloat                           // float, double
	TypeEnum                            // enum
	TypeSet                             // set
	TypeString                          // other
	TypeDatetime                        // datetime
	TypeTimestamp                       // timestamp
	TypeDate                            // date
	TypeTime                            // time
	TypeBit                             // bit
	TypeJson                            // json
	TypeDecimal                         // decimal
)

type DorisTables

type DorisTables struct {
	*config.DorisConfig
	// contains filtered or unexported fields
}

func (*DorisTables) AddTable

func (dts *DorisTables) AddTable(db string, table string) (*Table, error)

func (*DorisTables) AddTableForMsg

func (dts *DorisTables) AddTableForMsg(msg *msg.Msg) error

func (*DorisTables) Close

func (dts *DorisTables) Close()

func (*DorisTables) ExecuteSQL

func (dts *DorisTables) ExecuteSQL(cmd string, args ...interface{}) (rr *mysql.Result, err error)

func (*DorisTables) GetTable

func (dts *DorisTables) GetTable(db string, table string) (*Table, error)

func (*DorisTables) NewSchemaTables

func (dts *DorisTables) NewSchemaTables(conf *config.BaseConfig, pluginConfig interface{})

func (*DorisTables) RefreshTable

func (dts *DorisTables) RefreshTable(db string, table string)

func (*DorisTables) UpdateTable

func (dts *DorisTables) UpdateTable(db string, table string, args interface{}) (err error)

type MongoTables

type MongoTables struct {
	*config.MongoConfig
	// contains filtered or unexported fields
}

func (*MongoTables) AddTable

func (mts *MongoTables) AddTable(db string, table string) (*Table, error)

func (*MongoTables) AddTableForMsg

func (mts *MongoTables) AddTableForMsg(msg *msg.Msg) error

func (*MongoTables) Close

func (mts *MongoTables) Close()

func (*MongoTables) GetTable

func (mts *MongoTables) GetTable(db string, table string) (*Table, error)

func (*MongoTables) NewSchemaTables

func (mts *MongoTables) NewSchemaTables(conf *config.BaseConfig, pluginConfig interface{})

func (*MongoTables) RefreshTable

func (mts *MongoTables) RefreshTable(db string, table string)

func (*MongoTables) UpdateTable

func (mts *MongoTables) UpdateTable(db string, table string, args interface{}) (err error)

type MysqlTables

type MysqlTables struct {
	sync.RWMutex
	*config.MysqlConfig

	*MysqlTablesMeta

	FilePath string
	// contains filtered or unexported fields
}

func (*MysqlTables) AddTable

func (mts *MysqlTables) AddTable(db string, table string) (*Table, error)

func (*MysqlTables) AddTableForMsg

func (mts *MysqlTables) AddTableForMsg(msg *msg.Msg) error

func (*MysqlTables) ClearTableCache

func (mts *MysqlTables) ClearTableCache(db []byte, table []byte)

ClearTableCache clear table cache

func (*MysqlTables) Close

func (mts *MysqlTables) Close()

func (*MysqlTables) ExecuteSQL

func (mts *MysqlTables) ExecuteSQL(cmd string, args ...interface{}) (rr *mysql.Result, err error)

func (*MysqlTables) GetColumnTypeFromRawType

func (mts *MysqlTables) GetColumnTypeFromRawType(rawType string) int

func (*MysqlTables) GetTable

func (mts *MysqlTables) GetTable(db string, table string) (*Table, error)

func (*MysqlTables) LoadMetaFromDB

func (mts *MysqlTables) LoadMetaFromDB()

func (*MysqlTables) LoadMetaFromLocal

func (mts *MysqlTables) LoadMetaFromLocal(conf *config.BaseConfig)

func (*MysqlTables) NewSchemaTables

func (mts *MysqlTables) NewSchemaTables(conf *config.BaseConfig, pluginConfig interface{})

func (*MysqlTables) RefreshTable

func (mts *MysqlTables) RefreshTable(db string, table string)

func (*MysqlTables) SaveMeta

func (mts *MysqlTables) SaveMeta() error

func (*MysqlTables) UpdateTable

func (mts *MysqlTables) UpdateTable(db string, table string, spec interface{}) (err error)

type MysqlTablesMeta

type MysqlTablesMeta struct {
	// contains filtered or unexported fields
}

type Schema

type Schema interface {
	NewSchemaTables(config *config.BaseConfig, pluginConfig interface{})
	AddTableForMsg(msg *msg.Msg) error
	AddTable(db string, table string) (*Table, error)
	UpdateTable(db string, table string, args interface{}) error
	GetTable(db string, table string) (*Table, error)
	RefreshTable(db string, table string)
	Close()
}

type StarrocksTables

type StarrocksTables struct {
	*config.StarrocksConfig
	// contains filtered or unexported fields
}

func (*StarrocksTables) AddTable

func (sts *StarrocksTables) AddTable(db string, table string) (*Table, error)

func (*StarrocksTables) AddTableForMsg

func (sts *StarrocksTables) AddTableForMsg(msg *msg.Msg) error

func (*StarrocksTables) Close

func (sts *StarrocksTables) Close()

func (*StarrocksTables) ExecuteSQL

func (sts *StarrocksTables) ExecuteSQL(cmd string, args ...interface{}) (rr *mysql.Result, err error)

func (*StarrocksTables) GetTable

func (sts *StarrocksTables) GetTable(db string, table string) (*Table, error)

func (*StarrocksTables) NewSchemaTables

func (sts *StarrocksTables) NewSchemaTables(conf *config.BaseConfig, pluginConfig interface{})

func (*StarrocksTables) RefreshTable

func (sts *StarrocksTables) RefreshTable(db string, table string)

func (*StarrocksTables) UpdateTable

func (sts *StarrocksTables) UpdateTable(db string, table string, args interface{}) (err error)

type Table

type Table struct {
	Schema  string        `toml:"schema" json:"schema"`
	Name    string        `toml:"name" json:"name"`
	Columns []TableColumn `toml:"columns" json:"columns"`
}

func (*Table) FindColumn

func (t *Table) FindColumn(name string) int

func (*Table) GetTableColumnsName

func (t *Table) GetTableColumnsName() []string

type TableColumn

type TableColumn struct {
	Name    string     `toml:"name" json:"name"`
	Type    ColumnType `toml:"type" json:"type"`
	RawType string     `toml:"raw_type" json:"raw_type"`
}

Jump to

Keyboard shortcuts

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