clickhouse

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 23 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClickHouseResponse = errors.New("Malformed response from clickhouse")
View Source
var ErrUvarintOverflow = errors.New("ReadUvarint: varint overflows a 64-bit integer")
View Source
var ErrUvarintRead = errors.New("ReadUvarint: Malformed array")

Functions

func HandleError added in v0.11.6

func HandleError(w http.ResponseWriter, err error)

func NewErrDataParse added in v0.11.6

func NewErrDataParse(err string, data string) error

func NewErrorWithCode added in v0.12.0

func NewErrorWithCode(err string, code int) error

func Post added in v0.3.0

func Post(ctx context.Context, dsn string, query string, postBody io.Reader, opts Options, extData *ExternalData) ([]byte, error)

func PostGzip added in v0.3.0

func PostGzip(ctx context.Context, dsn string, query string, postBody io.Reader, opts Options, extData *ExternalData) ([]byte, error)

func Query

func Query(ctx context.Context, dsn string, query string, opts Options, extData *ExternalData) ([]byte, error)

func ReadUvarint added in v0.3.0

func ReadUvarint(array []byte) (uint64, int, error)

func Reader added in v0.6.2

func Reader(ctx context.Context, dsn string, query string, opts Options, extData *ExternalData) (io.ReadCloser, error)

Types

type Column added in v0.13.0

type Column struct {
	Name string
	// ClickHouse data type
	Type string
}

Column is a pair of Name and Type for temporary table structure

func (*Column) String added in v0.13.0

func (c *Column) String() string

type ErrDataParse added in v0.11.6

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

func (*ErrDataParse) Error added in v0.11.6

func (e *ErrDataParse) Error() string

func (*ErrDataParse) PrependDescription added in v0.11.6

func (e *ErrDataParse) PrependDescription(test string)

type ErrorWithCode added in v0.12.0

type ErrorWithCode struct {
	Code int // error code
	// contains filtered or unexported fields
}

func (*ErrorWithCode) Error added in v0.12.0

func (e *ErrorWithCode) Error() string

type ExternalData added in v0.13.0

type ExternalData struct {
	Tables []ExternalTable
	// contains filtered or unexported fields
}

ExternalData is a type to use ClickHouse external data feature. You could use it to pass multiple temporary tables for a query.

func NewExternalData added in v0.13.0

func NewExternalData(tables ...ExternalTable) *ExternalData

NewExternalData returns the `*ExternalData` object for `tables`

func (*ExternalData) SetDebug added in v0.13.0

func (e *ExternalData) SetDebug(debugDir string, perm os.FileMode)

SetDebug sets the directory and file permission for an external table data dump. Works only if both `debugDir` and `perm` are set

type ExternalTable added in v0.13.0

type ExternalTable struct {
	// Table name
	Name    string
	Columns []Column
	// ClickHouse input/output format
	Format string
	Data   []byte
}

ExternalTable is a structure to use ClickHouse feature that creates a temporary table for a query

type Options added in v0.7.0

type Options struct {
	Timeout        time.Duration
	ConnectTimeout time.Duration
}

type TestHandler added in v0.3.0

type TestHandler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*TestHandler) ServeHTTP added in v0.3.0

func (h *TestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TestRequest added in v0.3.0

type TestRequest struct {
	Query []byte
}

type TestServer added in v0.3.0

type TestServer struct {
	*httptest.Server
	// contains filtered or unexported fields
}

func NewTestServer added in v0.3.0

func NewTestServer() *TestServer

func (*TestServer) Requests added in v0.3.0

func (srv *TestServer) Requests() []TestRequest

Jump to

Keyboard shortcuts

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