package clickhouse
import "github.com/ClickHouse/clickhouse-go/v2"
Index ¶
- Constants
- Variables
- func Connector(opt *Options) driver.Connector
- func Context(parent context.Context, options ...QueryOption) context.Context
- func DateNamed(name string, value time.Time, scale TimeUnit) driver.NamedDateValue
- func Named(name string, value interface{}) driver.NamedValue
- func Open(opt *Options) (driver.Conn, error)
- func OpenDB(opt *Options) *sql.DB
- type ArraySet
- type Auth
- type Compression
- type CompressionMethod
- type Conn
- type ConnOpenStrategy
- type Exception
- type GroupSet
- type HTTPReaderWriter
- type Log
- type OpError
- type Options
- type Pool
- type ProfileEvent
- type ProfileInfo
- type Progress
- type Protocol
- type QueryOption
- func WithBlockBufferSize(size uint8) QueryOption
- func WithExternalTable(t ...*ext.Table) QueryOption
- func WithLogs(fn func(*Log)) QueryOption
- func WithProfileEvents(fn func([]ProfileEvent)) QueryOption
- func WithProfileInfo(fn func(*ProfileInfo)) QueryOption
- func WithProgress(fn func(*Progress)) QueryOption
- func WithQueryID(queryID string) QueryOption
- func WithQuotaKey(quotaKey string) QueryOption
- func WithSettings(settings Settings) QueryOption
- func WithSpan(span trace.SpanContext) QueryOption
- func WithStdAsync(wait bool) QueryOption
- type QueryOptions
- type ServerVersion
- type Settings
- type TimeUnit
Constants ¶
const ( CompressionNone = CompressionMethod(compress.None) CompressionLZ4 = CompressionMethod(compress.LZ4) CompressionZSTD = CompressionMethod(compress.ZSTD) CompressionGZIP = CompressionMethod(0x95) CompressionDeflate = CompressionMethod(0x96) CompressionBrotli = CompressionMethod(0x97) )
Variables ¶
var ( ErrBatchInvalid = errors.New("clickhouse: batch is invalid. check appended data is correct") ErrBatchAlreadySent = errors.New("clickhouse: batch has already been sent") ErrAcquireConnTimeout = errors.New("clickhouse: acquire conn timeout. you can increase the number of max open conn or the dial timeout") ErrUnsupportedServerRevision = errors.New("clickhouse: unsupported server revision") ErrBindMixedParamsFormats = errors.New("clickhouse [bind]: mixed named, numeric or positional parameters") ErrAcquireConnNoAddress = errors.New("clickhouse: no valid address supplied") )
Functions ¶
func Connector ¶
func Context ¶
func Context(parent context.Context, options ...QueryOption) context.Context
func DateNamed ¶
func Named ¶
func Named(name string, value interface{}) driver.NamedValue
func Open ¶
func OpenDB ¶
Types ¶
type ArraySet ¶
type ArraySet []interface{}
type Auth ¶
type Compression ¶
type Compression struct { Method CompressionMethod // this only applies to zlib and brotli compression algorithms Level int }
type CompressionMethod ¶
type CompressionMethod byte
func (CompressionMethod) String ¶
func (c CompressionMethod) String() string
type Conn ¶
type ConnOpenStrategy ¶
type ConnOpenStrategy uint8
const ( ConnOpenInOrder ConnOpenStrategy = iota ConnOpenRoundRobin )
type Exception ¶
type GroupSet ¶
type GroupSet struct {
Value []interface{}
}
type HTTPReaderWriter ¶
type HTTPReaderWriter struct {
// contains filtered or unexported fields
}
type Log ¶
type Log struct { Time time.Time TimeMicro uint32 Hostname string QueryID string ThreadID uint64 Priority int8 Source string Text string }
type OpError ¶
func (*OpError) Error ¶
type Options ¶
type Options struct { Protocol Protocol TLS *tls.Config Addr []string Auth Auth DialContext func(ctx context.Context, addr string) (net.Conn, error) Debug bool Debugf func(format string, v ...interface{}) // only works when Debug is true Settings Settings Compression *Compression DialTimeout time.Duration // default 1 second MaxOpenConns int // default MaxIdleConns + 5 MaxIdleConns int // default 5 ConnMaxLifetime time.Duration // default 1 hour ConnOpenStrategy ConnOpenStrategy HttpHeaders map[string]string // set additional headers on HTTP requests BlockBufferSize uint8 // default 2 - can be overwritten on query ReadTimeout time.Duration // contains filtered or unexported fields }
func ParseDSN ¶
type Pool ¶
type Pool[T any] struct { // contains filtered or unexported fields }
func NewPool ¶
func (*Pool[T]) Get ¶
func (p *Pool[T]) Get() T
func (*Pool[T]) Put ¶
func (p *Pool[T]) Put(x T)
type ProfileEvent ¶
type ProfileEvent struct { Hostname string CurrentTime time.Time ThreadID uint64 Type string Name string Value int64 }
type ProfileInfo ¶
type ProfileInfo = proto.ProfileInfo
type Progress ¶
type Protocol ¶
type Protocol int
func (Protocol) String ¶
type QueryOption ¶
type QueryOption func(*QueryOptions) error
func WithBlockBufferSize ¶
func WithBlockBufferSize(size uint8) QueryOption
func WithExternalTable ¶
func WithExternalTable(t ...*ext.Table) QueryOption
func WithLogs ¶
func WithLogs(fn func(*Log)) QueryOption
func WithProfileEvents ¶
func WithProfileEvents(fn func([]ProfileEvent)) QueryOption
func WithProfileInfo ¶
func WithProfileInfo(fn func(*ProfileInfo)) 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
func WithStdAsync ¶
func WithStdAsync(wait bool) QueryOption
type QueryOptions ¶
type QueryOptions struct {
// contains filtered or unexported fields
}
type ServerVersion ¶
type ServerVersion = proto.ServerHandshake
type Settings ¶
type Settings map[string]interface{}
type TimeUnit ¶
type TimeUnit uint8
Source Files ¶
bind.go clickhouse.go clickhouse_options.go clickhouse_rows.go clickhouse_rows_column_type.go clickhouse_std.go conn.go conn_async_insert.go conn_batch.go conn_check.go conn_exec.go conn_handshake.go conn_http.go conn_http_async_insert.go conn_http_batch.go conn_http_exec.go conn_http_query.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 struct_map.go
Directories ¶
- Version
- v2.4.3
- Published
- Nov 29, 2022
- Platform
- darwin/amd64
- Imports
- 38 packages
- Last checked
- now –
Tools for package owners.