Documentation
¶
Index ¶
- Variables
- func Context(parent context.Context, options ...QueryOption) context.Context
- func ExtractJSONPath(o *JSON, path string) (value interface{}, ok bool)
- 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 Dynamic
- type Exception
- type JSON
- type JSONDeserializer
- type JSONSerializer
- 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
- func WithStdAsync(wait bool) QueryOption
- type QueryOptions
- type ServerVersion
- type Settings
- type Variant
Constants ¶
This section is empty.
Variables ¶
var ( ErrBatchAlreadySent = errors.New("proton: batch has already been sent") ErrAcquireConnTimeout = errors.New("proton: acquire conn timeout. you can increase the number of max open conn or the dial timeout") ErrUnsupportedServerRevision = errors.New("proton: unsupported server revision") ErrBindMixedNamedAndNumericParams = errors.New("proton [bind]: mixed named and numeric parameters") )
var CompressionLZ4 compress.Method = compress.LZ4
Functions ¶
func ExtractJSONPath ¶ added in v2.1.0
ExtractJSONPath is a convenience function for asserting a path to a specific type. The underlying value is also extracted from its Dynamic wrapper if present.
func Named ¶
func Named(name string, value interface{}) driver.NamedValue
Types ¶
type Compression ¶
type ConnOpenStrategy ¶
type ConnOpenStrategy uint8
const ( ConnOpenInOrder ConnOpenStrategy = iota ConnOpenRoundRobin )
type Dynamic ¶ added in v2.1.0
Dynamic is an alias for the Variant type
func NewDynamic ¶ added in v2.1.0
func NewDynamic(v interface{}) Dynamic
NewDynamic creates a new Dynamic with the given value
func NewDynamicWithType ¶ added in v2.1.0
NewDynamicWithType creates a new Dynamic with the given value and ClickHouse type
type JSON ¶ added in v2.1.0
JSON represents a ClickHouse JSON type that can hold multiple possible types
type JSONDeserializer ¶ added in v2.1.0
type JSONDeserializer = chcol.JSONDeserializer
JSONDeserializer interface allows a struct to load its data from an optimized JSON structure instead of relying on recursive reflection to set its fields.
type JSONSerializer ¶ added in v2.1.0
type JSONSerializer = chcol.JSONSerializer
JSONSerializer interface allows a struct to be manually converted to an optimized JSON structure instead of relying on recursive reflection. Note that the struct must be a pointer in order for the interface to be matched, reflection will be used otherwise.
type Options ¶
type Options struct { TLS *tls.Config Addr []string Auth Auth DialContext func(ctx context.Context, addr string) (net.Conn, error) 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 }
type ProfileEvent ¶
type ProfileInfo ¶
type ProfileInfo = proto.ProfileInfo
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
func WithStdAsync ¶
func WithStdAsync(wait bool) QueryOption
type QueryOptions ¶
type QueryOptions struct {
// contains filtered or unexported fields
}
type ServerVersion ¶
type ServerVersion = proto.ServerHandshake
type Variant ¶ added in v2.1.0
Variant represents a ClickHouse Variant type that can hold multiple possible types
func NewVariant ¶ added in v2.1.0
func NewVariant(v interface{}) Variant
NewVariant creates a new Variant with the given value
func NewVariantWithType ¶ added in v2.1.0
NewVariantWithType creates a new Variant with the given value and ClickHouse type
Source Files
¶
- bind.go
- chcol.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_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
¶
Path | Synopsis |
---|---|
examples
|
|
lib
|
|
cityhash102
* COPY from https://github.com/zentures/cityhash/
|
* COPY from https://github.com/zentures/cityhash/ |
issues/485
Licensed to ClickHouse, Inc.
|
Licensed to ClickHouse, Inc. |