package clickhouse
import "github.com/ClickHouse/clickhouse-go/v2"
Index ¶
- Variables
- func Context(parent context.Context, options ...QueryOption) context.Context
- func Named(name string, value interface{}) driver.NamedValue
- func Open(opt *Options) (driver.Conn, error)
- func OpenDB(opt *Options) *sql.DB
- type Auth
- type Compression
- type Conn
- type ConnOpenStrategy
- type Exception
- type Log
- type OpError
- type Options
- type ProfileEvent
- type ProfileInfo
- type Progress
- type QueryOption
- func WithExternalTable(t ...*external.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
- type QueryOptions
- type ServerVersion
- type Settings
Variables ¶
var ( 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") ErrBindMixedNamedAndNumericParams = errors.New("clickhouse [bind]: mixed named and numeric parameters") )
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 OpenDB ¶
Types ¶
type Auth ¶
type Compression ¶
type Conn ¶
type ConnOpenStrategy ¶
type ConnOpenStrategy uint8
const ( ConnOpenInOrder ConnOpenStrategy = iota ConnOpenRoundRobin )
type 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 ¶
func (*OpError) Error ¶
type Options ¶
type Options struct { TLS *tls.Config Addr []string Auth Auth Debug bool 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 }
func ParseDSN ¶
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 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 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
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_check_dummy.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 struct_map.go
Directories ¶
- Version
- v2.0.0-beta.13
- Published
- Jan 30, 2022
- Platform
- js/wasm
- Imports
- 26 packages
- Last checked
- now –
Tools for package owners.