v2 – github.com/ClickHouse/clickhouse-go/v2 Index | Files | Directories

package clickhouse

import "github.com/ClickHouse/clickhouse-go/v2"

Index

Variables

var (
	ErrBatchAlreadySent               = errors.New("clickhouse: batch has already been sent")
	ErrAcquireConnTimeout             = errors.New("clickhouse: acquire conn timeout")
	ErrUnsupportedServerRevision      = errors.New("clickhouse: unsupported server revision")
	ErrBindMixedNamedAndNumericParams = errors.New("clickhouse [bind]: mixed named and numeric parameters")
)
var (
	CompressionLZ4 compress.Method = compress.LZ4
)

Functions

func Context

func Context(parent context.Context, options ...QueryOption) context.Context

func Named

func Named(name string, value interface{}) driver.NamedValue

func Open

func Open(opt *Options) (driver.Conn, error)

Types

type Auth

type Auth struct {
	Database string
	Username string
	Password string
}

type Compression

type Compression struct {
	Method compress.Method
}

type Conn

type Conn = driver.Conn

type ConnOpenStrategy

type ConnOpenStrategy uint8
const (
	ConnOpenInOrder ConnOpenStrategy = iota
	ConnOpenRoundRobin
)

type Date

type Date time.Time

type DateTime

type DateTime time.Time

type Exception

type Exception = proto.Exception

type Log

type Log struct {
	Time      time.Time
	TimeMicro uint32
	Hostname  string
	QueryID   string
	ThreadID  uint64
	Priority  int8
	Source    string
	Text      string
}

type OpError

type OpError struct {
	Op  string
	Err error
}

func (*OpError) Error

func (e *OpError) Error() string

type Options

type Options struct {
	TLS              *tls.Config
	Addr             []string
	Auth             Auth
	Debug            bool
	Settings         Settings
	DialTimeout      time.Duration
	Compression      *Compression
	MaxOpenConns     int
	MaxIdleConns     int
	ConnMaxLifetime  time.Duration
	ConnOpenStrategy ConnOpenStrategy
}

type ProfileEvent

type ProfileEvent struct {
	Hostname    string
	CurrentTime time.Time
	ThreadID    uint64
	Type        string
	Name        string
	Value       int64
}

type Progress

type Progress = proto.Progress

type QueryOption

type QueryOption func(*QueryOptions) error

func WithExternalTable

func WithExternalTable(t ...*external.Table) QueryOption

func WithLogs

func WithLogs(fn func(*Log)) QueryOption

func WithProfileEvents

func WithProfileEvents(fn func([]ProfileEvent)) QueryOption

func WithProgress

func WithProgress(fn func(*Progress)) QueryOption

func WithQueryID

func WithQueryID(queryID string) QueryOption

func WithQuotaKey

func WithQuotaKey(quotaKey string) QueryOption

func WithSettings

func WithSettings(settings Settings) QueryOption

func WithSpan

func WithSpan(span trace.SpanContext) QueryOption

type QueryOptions

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

type ServerVersion

type ServerVersion = proto.ServerHandshake

type Settings

type Settings map[string]interface{}

Source Files

bind.go clickhouse.go clickhouse_options.go clickhouse_rows.go clickhouse_std.go conn.go conn_batch.go conn_exec.go conn_handshake.go conn_logs.go conn_ping.go conn_process.go conn_profile_events.go conn_query.go conn_send_query.go context.go scan.go

Directories

PathSynopsis
benchmark
benchmark/v1
benchmark/v1/read
benchmark/v1/write
benchmark/v2
benchmark/v2/read
benchmark/v2/read-native
benchmark/v2/write
benchmark/v2/write-native
benchmark/v2/write-native-columnar
examples
examples/native
examples/std
external
lib
lib/binary
lib/cityhash102* COPY from https://github.com/zentures/cityhash/
lib/column
lib/column/codegen
lib/compress
lib/driver
lib/io
lib/proto
lib/timezone
tests
tests/issues
tests/std
tests/stress
Version
v2.0.0-alpha.5
Published
Jan 19, 2022
Platform
darwin/amd64
Imports
26 packages
Last checked
now

Tools for package owners.