databaseDriver

package
v0.0.0-...-05e86ca Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDestinationTable

func ParseDestinationTable(sql string) (string, error)

func ParseInsertFields

func ParseInsertFields(sql string) (string, error)

func ValidateIPPortFormat

func ValidateIPPortFormat(address string) error

Types

type DriverLib

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

func LoadDriver

func LoadDriver(libPath string) (*DriverLib, error)

func LoadDriverLib

func LoadDriverLib(libPath string) (*DriverLib, error)

func (*DriverLib) CheckSQLValid

func (l *DriverLib) CheckSQLValid(handle C.driver_handle, strSQL, filterVal string) *HandleResult

func (*DriverLib) Close

func (l *DriverLib) Close()

func (*DriverLib) ConvertTableDDL

func (l *DriverLib) ConvertTableDDL(handle C.driver_handle, tableName string) *HandleResult

func (*DriverLib) CreateDriver

func (l *DriverLib) CreateDriver() C.driver_handle

func (*DriverLib) DestroyDriver

func (l *DriverLib) DestroyDriver(handle C.driver_handle)

func (*DriverLib) GetColumns

func (l *DriverLib) GetColumns(handle C.driver_handle, tableName string) *HandleResult

func (*DriverLib) GetQuoteFlag

func (l *DriverLib) GetQuoteFlag(handle C.driver_handle) *HandleResult

func (*DriverLib) GetTableDDL

func (l *DriverLib) GetTableDDL(handle C.driver_handle, tableName string) *HandleResult

func (*DriverLib) GetTables

func (l *DriverLib) GetTables(handle C.driver_handle) *HandleResult

func (*DriverLib) IsConnected

func (l *DriverLib) IsConnected(handle C.driver_handle) *HandleResult

func (*DriverLib) OpenConnect

func (l *DriverLib) OpenConnect(handle C.driver_handle, connectJson string,
	maxIdleTime, maxOpenConnections, connMaxLifetime, maxIdleConnections int) *HandleResult

func (*DriverLib) PullData

func (l *DriverLib) PullData(handle C.driver_handle, strSQL, filterVal, destTable string, batch int, iTimestamp int64, clickClient *clickHouseLocal.TClickHouseDriver) *HandleResult

func (*DriverLib) PushData

func (l *DriverLib) PushData(handle C.driver_handle, strSQL string, batch int, rows *sql.Rows) *HandleResult

type DriverOperation

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

func NewDriverOperation

func NewDriverOperation(dbDriverDir string, ds *module.TDataSource) (*DriverOperation, error)

NewDriverOperation creates a new driver operation instance.dbDriverDir is the full path to the directory where the driver library is located.

func (*DriverOperation) CheckSQLValid

func (op *DriverOperation) CheckSQLValid(strSQL, filterVal string) *HandleResult

func (*DriverOperation) ConvertTableDDL

func (op *DriverOperation) ConvertTableDDL(tableName string) *HandleResult

func (*DriverOperation) FreeDriver

func (op *DriverOperation) FreeDriver()

func (*DriverOperation) GetColumns

func (op *DriverOperation) GetColumns(tableName string) *HandleResult

func (*DriverOperation) GetQuoteFlag

func (op *DriverOperation) GetQuoteFlag() *HandleResult

func (*DriverOperation) GetTableDDL

func (op *DriverOperation) GetTableDDL(tableName string) *HandleResult

func (*DriverOperation) GetTables

func (op *DriverOperation) GetTables() *HandleResult

func (*DriverOperation) IsConnected

func (op *DriverOperation) IsConnected() *HandleResult

func (*DriverOperation) PullData

func (op *DriverOperation) PullData(strSQL, filterVal, destTable string, batch int, iTimestamp int64, clickClient *clickHouseLocal.TClickHouseDriver) *HandleResult

func (*DriverOperation) PushData

func (op *DriverOperation) PushData(strSQL string, batch int, rows *sql.Rows) *HandleResult

PushData strSQL : insert into table_name (col1, col2,...)

type HandleResult

type HandleResult struct {
	HandleCode int32
	HandleMsg  string
}

func (*HandleResult) HandleFailed

func (handle *HandleResult) HandleFailed(msg string)

func (*HandleResult) HandleSuccess

func (handle *HandleResult) HandleSuccess(code int32, msg string)

type IDbDriver

type IDbDriver interface {
	OpenConnect(connectJson string, maxIdleTime, maxOpenConnections, connMaxLifetime, maxIdleConnections int) error
	CloseConnect() error
	CheckSQLValid(strSQL, strFilterVal string) ([]tableInfo.ColumnInfo, error)
	GetColumns(tableName string) ([]tableInfo.ColumnInfo, error)
	GetTables() ([]tableInfo.TableInfo, error)
	PullData(strSQL, filterVal, destTable string, batch int, iTimestamp int64, clickClient *clickHouseLocal.TClickHouseDriver) (int64, error)
	PushData(insertSQL string, batch int, rows *sql.Rows) (int64, error) //作为函数参数
	ConvertTableDDL(tableName string) (*string, error)
	GetQuoteFlag() string
	GetSourceTableDDL(tableName string) (*string, error)
	GetSchema() string
	IsConnected() bool
	NewConnect(connectJson string, maxIdleTime, maxOpenConnections, connMaxLifetime, maxIdleConnections int) (IDbDriver, error)
}

type TDBDriver

type TDBDriver struct {
	DriverName string
	Schema     string
	Db         *sqlx.DB
	Connected  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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