package clickhouse
import "github.com/ClickHouse/clickhouse-go"
Index ¶
- Constants
- Variables
- func Array(v interface{}) interface{}
- func ArrayDate(v []time.Time) interface{}
- func ArrayDateTime(v []time.Time) interface{}
- func ArrayFixedString(len int, v interface{}) interface{}
- func DeregisterDial()
- func DeregisterTLSConfig(key string)
- func Open(dsn string) (driver.Conn, error)
- func RegisterDial(dial DialFunc)
- func RegisterTLSConfig(key string, config *tls.Config) error
- func SetLogOutput(output io.Writer)
- func WithQueryID(ctx context.Context, queryID string) context.Context
- type Clickhouse
- type ColumnWriter
- type Date
- type DateTime
- type DialFunc
- type Exception
- type ExternalTable
- type UUID
Constants ¶
const ( // DefaultDatabase when connecting to ClickHouse DefaultDatabase = "default" // DefaultUsername when connecting to ClickHouse DefaultUsername = "default" // DefaultConnTimeout when connecting to ClickHouse DefaultConnTimeout = 5 * time.Second // DefaultReadTimeout when reading query results DefaultReadTimeout = time.Minute // DefaultWriteTimeout when sending queries DefaultWriteTimeout = time.Minute )
Variables ¶
var ( ErrInsertInNotBatchMode = errors.New("insert statement supported only in the batch mode (use begin/commit)") ErrLimitDataRequestInTx = errors.New("data request has already been prepared in transaction") )
Functions ¶
func Array ¶
func Array(v interface{}) interface{}
func ArrayDate ¶
func ArrayDateTime ¶
func ArrayFixedString ¶
func ArrayFixedString(len int, v interface{}) interface{}
func DeregisterDial ¶
func DeregisterDial()
DeregisterDial deregisters the custom dial function.
func DeregisterTLSConfig ¶
func DeregisterTLSConfig(key string)
DeregisterTLSConfig removes the tls.Config associated with key.
func Open ¶
Open the connection
func RegisterDial ¶
func RegisterDial(dial DialFunc)
RegisterDial registers a custom dial function.
func RegisterTLSConfig ¶
RegisterTLSConfig registers a custom tls.Config to be used with sql.Open.
func SetLogOutput ¶
SetLogOutput allows to change output of the default logger
func WithQueryID ¶
Put query ID into context and use it in ExecContext or QueryContext
Types ¶
type Clickhouse ¶
type Clickhouse interface {
Block() (*data.Block, error)
Prepare(query string) (driver.Stmt, error)
Begin() (driver.Tx, error)
Commit() error
Rollback() error
Close() error
WriteBlock(block *data.Block) error
}
Interface for Clickhouse driver
func OpenDirect ¶
func OpenDirect(dsn string) (Clickhouse, error)
type ColumnWriter ¶
type ColumnWriter interface {
WriteDate(c int, v time.Time) error
WriteDateNullable(c int, v *time.Time) error
WriteDateTime(c int, v time.Time) error
WriteDateTimeNullable(c int, v *time.Time) error
WriteUInt8(c int, v uint8) error
WriteUInt8Nullable(c int, v *uint8) error
WriteUInt16(c int, v uint16) error
WriteUInt16Nullable(c int, v *uint16) error
WriteUInt32(c int, v uint32) error
WriteUInt32Nullable(c int, v *uint32) error
WriteUInt64(c int, v uint64) error
WriteUInt64Nullable(c int, v *uint64) error
WriteFloat32(c int, v float32) error
WriteFloat32Nullable(c int, v *float32) error
WriteFloat64(c int, v float64) error
WriteFloat64Nullable(c int, v *float64) error
WriteBytes(c int, v []byte) error
WriteArray(c int, v interface{}) error
WriteBytesNullable(c int, v *[]byte) error
WriteArrayNullable(c int, v *interface{}) error
WriteString(c int, v string) error
WriteStringNullable(c int, v *string) error
WriteFixedString(c int, v []byte) error
WriteFixedStringNullable(c int, v *[]byte) error
}
Interface for Block allowing writes to individual columns
type Date ¶
type DateTime ¶
type DialFunc ¶
type DialFunc func(network, address string, timeout time.Duration, config *tls.Config) (net.Conn, error)
DialFunc is a function which can be used to establish the network connection. Custom dial functions must be registered with RegisterDial
type Exception ¶
type Exception struct {
Code int32
Name string
Message string
StackTrace string
// contains filtered or unexported fields
}
func (*Exception) Error ¶
type ExternalTable ¶
type UUID ¶
Source Files ¶
array.go bootstrap.go clickhouse.go clickhouse_exception.go clickhouse_ping.go clickhouse_profile_info.go clickhouse_progress.go clickhouse_read_block.go clickhouse_read_meta.go clickhouse_send_external_data.go clickhouse_send_query.go clickhouse_write_block.go connect.go connect_check.go helpers.go query_settings.go result.go rows.go stmt.go tls_config.go word_matcher.go write_column.go
Directories ¶
| Path | Synopsis |
|---|---|
| examples | |
| lib | |
| lib/binary | |
| lib/cityhash102 | * COPY from https://github.com/zentures/cityhash/ |
| lib/codegen | |
| lib/codegen/nullable_appender | |
| lib/column | |
| lib/data | |
| lib/lz4 | |
| lib/protocol | |
| lib/types |
- Version
- v1.5.4 (latest)
- Published
- Feb 8, 2022
- Platform
- linux/amd64
- Imports
- 27 packages
- Last checked
- 11 months ago –
Tools for package owners.