chutils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertColumn

func ConvertColumn(w utils.Writer, column *config.PgColumn, tupleData *message.Tuple, colProp *config.ColumnProperty) error

func ToClickHouseType

func ToClickHouseType(pgColumn *config.PgColumn) (string, error)

ToClickHouseType converts pg type into ClickHouse type

Types

type CHConn

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

ClickHouse connection

func MakeChConnection

func MakeChConnection(c *config.CHConnConfig, useGzip bool) *CHConn

Make new ClickHouse connection. For HTTP it just makes URL

func (*CHConn) Exec

func (c *CHConn) Exec(query string) error

Make command without results, sends SQL command as body

func (*CHConn) PerformInsert

func (c *CHConn) PerformInsert(tableName config.ChTableName, columns []string, reqBody io.Reader) error

Make INSERT command, sends SQL command as query parameter

func (*CHConn) Query

func (c *CHConn) Query(query string) ([][]string, error)

type CHConnector

type CHConnector interface {
	Exec(string) error
	PerformInsert(config.ChTableName, []string, io.Reader) error
	Query(string) ([][]string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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