Documentation ¶
Overview ¶
Package proto implements ClickHouse wire protocol.
Index ¶
- Constants
- func CardinalityKeyStrings() []string
- func ClientCodeStrings() []string
- func ClientQueryKindStrings() []string
- func CompressionStrings() []string
- func ErrorStrings() []string
- func FeatureStrings() []string
- func InterfaceStrings() []string
- func ProfileEventTypeStrings() []string
- func ServerCodeStrings() []string
- func StageStrings() []string
- type AwareDecoder
- type AwareEncoder
- type Block
- type BlockInfo
- type Buffer
- func (b *Buffer) Encode(e Encoder)
- func (b *Buffer) EncodeAware(e AwareEncoder, version int)
- func (b *Buffer) Ensure(n int)
- func (b *Buffer) PutBool(v bool)
- func (b *Buffer) PutByte(x byte)
- func (b *Buffer) PutFloat32(v float32)
- func (b *Buffer) PutFloat64(v float64)
- func (b *Buffer) PutInt(x int)
- func (b *Buffer) PutInt128(x Int128)
- func (b *Buffer) PutInt16(v int16)
- func (b *Buffer) PutInt32(x int32)
- func (b *Buffer) PutInt64(x int64)
- func (b *Buffer) PutInt8(v int8)
- func (b *Buffer) PutLen(x int)
- func (b *Buffer) PutRaw(v []byte)
- func (b *Buffer) PutString(s string)
- func (b *Buffer) PutUInt128(x UInt128)
- func (b *Buffer) PutUInt16(x uint16)
- func (b *Buffer) PutUInt32(x uint32)
- func (b *Buffer) PutUInt64(x uint64)
- func (b *Buffer) PutUInt8(x uint8)
- func (b *Buffer) PutUVarInt(x uint64)
- func (b *Buffer) Read(p []byte) (n int, err error)
- func (b *Buffer) Reader() *Reader
- func (b *Buffer) Reset()
- type CardinalityKey
- type ClientCode
- type ClientData
- type ClientHello
- type ClientInfo
- type ClientQueryKind
- type ColArr
- func NewArrDate() *ColArr
- func NewArrDate32() *ColArr
- func NewArrDateTime() *ColArr
- func NewArrDateTime64() *ColArr
- func NewArrDecimal128() *ColArr
- func NewArrDecimal256() *ColArr
- func NewArrDecimal32() *ColArr
- func NewArrDecimal64() *ColArr
- func NewArrEnum16() *ColArr
- func NewArrEnum8() *ColArr
- func NewArrFloat32() *ColArr
- func NewArrFloat64() *ColArr
- func NewArrIPv4() *ColArr
- func NewArrIPv6() *ColArr
- func NewArrInt128() *ColArr
- func NewArrInt16() *ColArr
- func NewArrInt256() *ColArr
- func NewArrInt32() *ColArr
- func NewArrInt64() *ColArr
- func NewArrInt8() *ColArr
- func NewArrUInt128() *ColArr
- func NewArrUInt16() *ColArr
- func NewArrUInt256() *ColArr
- func NewArrUInt32() *ColArr
- func NewArrUInt64() *ColArr
- func NewArrUInt8() *ColArr
- func (c *ColArr) AppendDate(data []Date)
- func (c *ColArr) AppendDate32(data []Date32)
- func (c *ColArr) AppendDateTime(data []DateTime)
- func (c *ColArr) AppendDateTime64(data []DateTime64)
- func (c *ColArr) AppendDecimal128(data []Decimal128)
- func (c *ColArr) AppendDecimal256(data []Decimal256)
- func (c *ColArr) AppendDecimal32(data []Decimal32)
- func (c *ColArr) AppendDecimal64(data []Decimal64)
- func (c *ColArr) AppendEnum16(data []Enum16)
- func (c *ColArr) AppendEnum8(data []Enum8)
- func (c *ColArr) AppendFloat32(data []float32)
- func (c *ColArr) AppendFloat64(data []float64)
- func (c *ColArr) AppendIPv4(data []IPv4)
- func (c *ColArr) AppendIPv6(data []IPv6)
- func (c *ColArr) AppendInt128(data []Int128)
- func (c *ColArr) AppendInt16(data []int16)
- func (c *ColArr) AppendInt256(data []Int256)
- func (c *ColArr) AppendInt32(data []int32)
- func (c *ColArr) AppendInt64(data []int64)
- func (c *ColArr) AppendInt8(data []int8)
- func (c *ColArr) AppendUInt128(data []UInt128)
- func (c *ColArr) AppendUInt16(data []uint16)
- func (c *ColArr) AppendUInt256(data []UInt256)
- func (c *ColArr) AppendUInt32(data []uint32)
- func (c *ColArr) AppendUInt64(data []uint64)
- func (c *ColArr) AppendUInt8(data []uint8)
- func (c *ColArr) DecodeColumn(r *Reader, rows int) error
- func (c ColArr) EncodeColumn(b *Buffer)
- func (c *ColArr) Reset()
- func (c ColArr) Rows() int
- func (c ColArr) Type() ColumnType
- type ColAuto
- type ColBool
- type ColDate
- type ColDate32
- type ColDateTime
- type ColDateTime64
- func (c *ColDateTime64) Append(v DateTime64)
- func (c *ColDateTime64) DecodeColumn(r *Reader, rows int) error
- func (c ColDateTime64) EncodeColumn(b *Buffer)
- func (c *ColDateTime64) Reset()
- func (c ColDateTime64) Row(i int) DateTime64
- func (c ColDateTime64) Rows() int
- func (ColDateTime64) Type() ColumnType
- func (c *ColDateTime64) Wrap(p Precision) Column
- type ColDecimal128
- func (c *ColDecimal128) Append(v Decimal128)
- func (c *ColDecimal128) DecodeColumn(r *Reader, rows int) error
- func (c ColDecimal128) EncodeColumn(b *Buffer)
- func (c *ColDecimal128) Reset()
- func (c ColDecimal128) Row(i int) Decimal128
- func (c ColDecimal128) Rows() int
- func (ColDecimal128) Type() ColumnType
- type ColDecimal256
- func (c *ColDecimal256) Append(v Decimal256)
- func (c *ColDecimal256) DecodeColumn(r *Reader, rows int) error
- func (c ColDecimal256) EncodeColumn(b *Buffer)
- func (c *ColDecimal256) Reset()
- func (c ColDecimal256) Row(i int) Decimal256
- func (c ColDecimal256) Rows() int
- func (ColDecimal256) Type() ColumnType
- type ColDecimal32
- type ColDecimal64
- type ColEnum16
- type ColEnum8
- type ColEnum8Auto
- func (e *ColEnum8Auto) Append(v string)
- func (e *ColEnum8Auto) DecodeColumn(r *Reader, rows int) error
- func (e *ColEnum8Auto) EncodeColumn(b *Buffer)
- func (e *ColEnum8Auto) Infer(t ColumnType) error
- func (e *ColEnum8Auto) Prepare() error
- func (e *ColEnum8Auto) Reset()
- func (e *ColEnum8Auto) Rows() int
- func (e *ColEnum8Auto) Type() ColumnType
- type ColFixedStr
- func (c *ColFixedStr) Append(b []byte)
- func (c *ColFixedStr) DecodeColumn(r *Reader, rows int) error
- func (c ColFixedStr) EncodeColumn(b *Buffer)
- func (c *ColFixedStr) Reset()
- func (c ColFixedStr) Row(i int) []byte
- func (c ColFixedStr) Rows() int
- func (c *ColFixedStr) SetSize(n int)
- func (c ColFixedStr) Type() ColumnType
- type ColFloat32
- type ColFloat64
- type ColIPv4
- type ColIPv6
- type ColInfo
- type ColInfoInput
- type ColInput
- type ColInt128
- type ColInt16
- type ColInt256
- type ColInt32
- type ColInt64
- type ColInt8
- type ColLowCardinality
- func (c *ColLowCardinality) AppendKey(i int)
- func (c *ColLowCardinality) DecodeColumn(r *Reader, rows int) error
- func (c ColLowCardinality) EncodeColumn(b *Buffer)
- func (c *ColLowCardinality) Keys() Column
- func (c *ColLowCardinality) Reset()
- func (c ColLowCardinality) Rows() int
- func (c ColLowCardinality) Type() ColumnType
- type ColMap
- type ColNullable
- type ColRaw
- type ColResult
- type ColStr
- func (c *ColStr) Append(v string)
- func (c *ColStr) AppendArr(v []string)
- func (c *ColStr) AppendBytes(v []byte)
- func (ColStr) ArrAppend(arr *ColArr, data []string)
- func (c *ColStr) DecodeColumn(r *Reader, rows int) error
- func (c ColStr) EncodeColumn(b *Buffer)
- func (c ColStr) First() string
- func (c ColStr) ForEach(f func(i int, s string) error) error
- func (c ColStr) ForEachBytes(f func(i int, b []byte) error) error
- func (c *ColStr) Reset()
- func (c ColStr) Row(i int) string
- func (c ColStr) Rows() int
- func (ColStr) Type() ColumnType
- type ColTuple
- type ColUInt128
- type ColUInt16
- type ColUInt256
- type ColUInt32
- type ColUInt64
- type ColUInt8
- type ColUUID
- type Column
- type ColumnType
- func (c ColumnType) Array() ColumnType
- func (c ColumnType) Base() ColumnType
- func (c ColumnType) Conflicts(b ColumnType) bool
- func (c ColumnType) Elem() ColumnType
- func (c ColumnType) IsArray() bool
- func (c ColumnType) String() string
- func (c ColumnType) Sub(subtypes ...ColumnType) ColumnType
- func (c ColumnType) With(params ...string) ColumnType
- type Compression
- type Date
- type Date32
- type DateTime
- type DateTime64
- type Decimal128
- type Decimal256
- type Decimal32
- type Decimal64
- type Decoder
- type Encoder
- type Enum16
- type Enum8
- type Error
- type Exception
- type Feature
- type IPv4
- type IPv6
- type InferColumn
- type Input
- type InputColumn
- type Int128
- type Int256
- type Interface
- type Log
- type Logs
- type Position
- type Precision
- type Preparable
- type Profile
- type ProfileEvent
- type ProfileEventType
- type ProfileEvents
- type Progress
- type Query
- type Reader
- func (r *Reader) Bool() (bool, error)
- func (r *Reader) Byte() (byte, error)
- func (r *Reader) Decode(v Decoder) error
- func (r *Reader) DisableCompression()
- func (r *Reader) EnableCompression()
- func (r *Reader) Float32() (float32, error)
- func (r *Reader) Float64() (float64, error)
- func (r *Reader) Int() (int, error)
- func (r *Reader) Int128() (Int128, error)
- func (r *Reader) Int16() (int16, error)
- func (r *Reader) Int32() (int32, error)
- func (r *Reader) Int64() (int64, error)
- func (r *Reader) Int8() (int8, error)
- func (r *Reader) Read(p []byte) (n int, err error)
- func (r *Reader) ReadByte() (byte, error)
- func (r *Reader) ReadFull(buf []byte) error
- func (r *Reader) ReadRaw(n int) ([]byte, error)
- func (r *Reader) Str() (string, error)
- func (r *Reader) StrAppend(buf []byte) ([]byte, error)
- func (r *Reader) StrBytes() ([]byte, error)
- func (r *Reader) StrLen() (int, error)
- func (r *Reader) StrRaw() ([]byte, error)
- func (r *Reader) UInt128() (UInt128, error)
- func (r *Reader) UInt16() (uint16, error)
- func (r *Reader) UInt32() (uint32, error)
- func (r *Reader) UInt64() (uint64, error)
- func (r *Reader) UInt8() (uint8, error)
- func (r *Reader) UVarInt() (uint64, error)
- type Result
- type ResultColumn
- type Results
- type ServerCode
- type ServerHello
- type Setting
- type Stage
- type TableColumns
- type UInt128
- type UInt256
Constants ¶
const ( Version = 54451 Name = "go-faster/ch" )
Defaults for ClientHello.
const DateLayout = "2006-01-02"
DateLayout is default time format for Date.
Variables ¶
This section is empty.
Functions ¶
func CardinalityKeyStrings ¶
func CardinalityKeyStrings() []string
CardinalityKeyStrings returns a slice of all String values of the enum
func ClientCodeStrings ¶
func ClientCodeStrings() []string
ClientCodeStrings returns a slice of all String values of the enum
func ClientQueryKindStrings ¶
func ClientQueryKindStrings() []string
ClientQueryKindStrings returns a slice of all String values of the enum
func CompressionStrings ¶
func CompressionStrings() []string
CompressionStrings returns a slice of all String values of the enum
func ErrorStrings ¶
func ErrorStrings() []string
ErrorStrings returns a slice of all String values of the enum
func FeatureStrings ¶
func FeatureStrings() []string
FeatureStrings returns a slice of all String values of the enum
func InterfaceStrings ¶
func InterfaceStrings() []string
InterfaceStrings returns a slice of all String values of the enum
func ProfileEventTypeStrings ¶ added in v0.16.0
func ProfileEventTypeStrings() []string
ProfileEventTypeStrings returns a slice of all String values of the enum
func ServerCodeStrings ¶
func ServerCodeStrings() []string
ServerCodeStrings returns a slice of all String values of the enum
func StageStrings ¶
func StageStrings() []string
StageStrings returns a slice of all String values of the enum
Types ¶
type AwareDecoder ¶
AwareDecoder implements encoding to Buffer that depends on version.
type AwareEncoder ¶
AwareEncoder implements encoding to Buffer that depends on version.
type Block ¶
func (*Block) DecodeBlock ¶
func (*Block) DecodeRawBlock ¶ added in v0.4.0
func (Block) EncodeAware ¶
func (Block) EncodeBlock ¶ added in v0.4.0
func (b Block) EncodeBlock(buf *Buffer, version int, input []InputColumn) error
type Buffer ¶
type Buffer struct {
Buf []byte
}
Buffer implements ClickHouse binary protocol encoding.
func (*Buffer) EncodeAware ¶ added in v0.14.0
func (b *Buffer) EncodeAware(e AwareEncoder, version int)
EncodeAware value that implements AwareEncoder.
func (*Buffer) PutFloat32 ¶
func (*Buffer) PutFloat64 ¶
func (*Buffer) PutUInt128 ¶
type CardinalityKey ¶
type CardinalityKey byte
CardinalityKey is integer type of ColLowCardinality.Keys column.
const ( KeyUInt8 CardinalityKey = 0 KeyUInt16 CardinalityKey = 1 KeyUInt32 CardinalityKey = 2 KeyUInt64 CardinalityKey = 3 )
Possible integer types for ColLowCardinality.Keys.
func CardinalityKeyString ¶
func CardinalityKeyString(s string) (CardinalityKey, error)
CardinalityKeyString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func CardinalityKeyValues ¶
func CardinalityKeyValues() []CardinalityKey
CardinalityKeyValues returns all values of the enum
func (CardinalityKey) IsACardinalityKey ¶
func (i CardinalityKey) IsACardinalityKey() bool
IsACardinalityKey returns "true" if the value is listed in the enum definition. "false" otherwise
func (CardinalityKey) String ¶
func (i CardinalityKey) String() string
type ClientCode ¶
type ClientCode byte
ClientCode is sent from client to server.
const ( ClientCodeHello ClientCode = 0 // client part of "handshake" ClientCodeQuery ClientCode = 1 // query start ClientCodeData ClientCode = 2 // data block (can be compressed) ClientCodeCancel ClientCode = 3 // query cancel ClientCodePing ClientCode = 4 // ping request to server ClientTablesStatusRequest ClientCode = 5 // tables status request )
Possible client codes.
func ClientCodeString ¶
func ClientCodeString(s string) (ClientCode, error)
ClientCodeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ClientCodeValues ¶
func ClientCodeValues() []ClientCode
ClientCodeValues returns all values of the enum
func (ClientCode) IsAClientCode ¶
func (i ClientCode) IsAClientCode() bool
IsAClientCode returns "true" if the value is listed in the enum definition. "false" otherwise
func (ClientCode) String ¶
func (i ClientCode) String() string
type ClientData ¶
type ClientData struct {
TableName string
}
func (*ClientData) DecodeAware ¶
func (c *ClientData) DecodeAware(r *Reader, version int) error
func (ClientData) EncodeAware ¶
func (c ClientData) EncodeAware(b *Buffer, version int)
type ClientHello ¶
type ClientHello struct { Name string Major int // client major version Minor int // client minor version // ProtocolVersion is TCP protocol version of client. // // Usually it is equal to the latest compatible server revision, but // should not be confused with it. ProtocolVersion int Database string User string Password string }
ClientHello represents ClientCodeHello message.
func (*ClientHello) Decode ¶
func (c *ClientHello) Decode(r *Reader) error
type ClientInfo ¶
type ClientInfo struct { ProtocolVersion int Major int Minor int Patch int Interface Interface Query ClientQueryKind InitialUser string InitialQueryID string InitialAddress string InitialTime int64 OSUser string ClientHostname string ClientName string Span trace.SpanContext QuotaKey string DistributedDepth int }
ClientInfo message.
func (*ClientInfo) DecodeAware ¶
func (c *ClientInfo) DecodeAware(r *Reader, version int) error
func (ClientInfo) EncodeAware ¶
func (c ClientInfo) EncodeAware(b *Buffer, version int)
EncodeAware encodes to buffer version-aware.
type ClientQueryKind ¶
type ClientQueryKind byte
ClientQueryKind is kind of query.
const ( ClientQueryNone ClientQueryKind = 0 ClientQueryInitial ClientQueryKind = 1 ClientQuerySecondary ClientQueryKind = 2 )
Possible query kinds.
func ClientQueryKindString ¶
func ClientQueryKindString(s string) (ClientQueryKind, error)
ClientQueryKindString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ClientQueryKindValues ¶
func ClientQueryKindValues() []ClientQueryKind
ClientQueryKindValues returns all values of the enum
func (ClientQueryKind) IsAClientQueryKind ¶
func (i ClientQueryKind) IsAClientQueryKind() bool
IsAClientQueryKind returns "true" if the value is listed in the enum definition. "false" otherwise
func (ClientQueryKind) String ¶
func (i ClientQueryKind) String() string
type ColArr ¶
ColArr represents Array[T].
func NewArrDateTime64 ¶
func NewArrDateTime64() *ColArr
NewArrDateTime64 returns new Array(DateTime64).
func NewArrDecimal128 ¶ added in v0.2.0
func NewArrDecimal128() *ColArr
NewArrDecimal128 returns new Array(Decimal128).
func NewArrDecimal256 ¶ added in v0.2.0
func NewArrDecimal256() *ColArr
NewArrDecimal256 returns new Array(Decimal256).
func NewArrDecimal32 ¶ added in v0.2.0
func NewArrDecimal32() *ColArr
NewArrDecimal32 returns new Array(Decimal32).
func NewArrDecimal64 ¶ added in v0.2.0
func NewArrDecimal64() *ColArr
NewArrDecimal64 returns new Array(Decimal64).
func NewArrInt256 ¶ added in v0.2.0
func NewArrInt256() *ColArr
NewArrInt256 returns new Array(Int256).
func NewArrUInt256 ¶ added in v0.2.0
func NewArrUInt256() *ColArr
NewArrUInt256 returns new Array(UInt256).
func (*ColArr) AppendDate ¶
AppendDate appends slice of Date to Array(Date).
func (*ColArr) AppendDate32 ¶
AppendDate32 appends slice of Date32 to Array(Date32).
func (*ColArr) AppendDateTime ¶
AppendDateTime appends slice of DateTime to Array(DateTime).
func (*ColArr) AppendDateTime64 ¶
func (c *ColArr) AppendDateTime64(data []DateTime64)
AppendDateTime64 appends slice of DateTime64 to Array(DateTime64).
func (*ColArr) AppendDecimal128 ¶ added in v0.2.0
func (c *ColArr) AppendDecimal128(data []Decimal128)
AppendDecimal128 appends slice of Decimal128 to Array(Decimal128).
func (*ColArr) AppendDecimal256 ¶ added in v0.2.0
func (c *ColArr) AppendDecimal256(data []Decimal256)
AppendDecimal256 appends slice of Decimal256 to Array(Decimal256).
func (*ColArr) AppendDecimal32 ¶ added in v0.2.0
AppendDecimal32 appends slice of Decimal32 to Array(Decimal32).
func (*ColArr) AppendDecimal64 ¶ added in v0.2.0
AppendDecimal64 appends slice of Decimal64 to Array(Decimal64).
func (*ColArr) AppendEnum16 ¶
AppendEnum16 appends slice of Enum16 to Array(Enum16).
func (*ColArr) AppendEnum8 ¶
AppendEnum8 appends slice of Enum8 to Array(Enum8).
func (*ColArr) AppendFloat32 ¶
AppendFloat32 appends slice of float32 to Array(Float32).
func (*ColArr) AppendFloat64 ¶
AppendFloat64 appends slice of float64 to Array(Float64).
func (*ColArr) AppendIPv4 ¶
AppendIPv4 appends slice of IPv4 to Array(IPv4).
func (*ColArr) AppendIPv6 ¶
AppendIPv6 appends slice of IPv6 to Array(IPv6).
func (*ColArr) AppendInt128 ¶
AppendInt128 appends slice of Int128 to Array(Int128).
func (*ColArr) AppendInt16 ¶
AppendInt16 appends slice of int16 to Array(Int16).
func (*ColArr) AppendInt256 ¶ added in v0.2.0
AppendInt256 appends slice of Int256 to Array(Int256).
func (*ColArr) AppendInt32 ¶
AppendInt32 appends slice of int32 to Array(Int32).
func (*ColArr) AppendInt64 ¶
AppendInt64 appends slice of int64 to Array(Int64).
func (*ColArr) AppendInt8 ¶
AppendInt8 appends slice of int8 to Array(Int8).
func (*ColArr) AppendUInt128 ¶
AppendUInt128 appends slice of UInt128 to Array(UInt128).
func (*ColArr) AppendUInt16 ¶
AppendUInt16 appends slice of uint16 to Array(UInt16).
func (*ColArr) AppendUInt256 ¶ added in v0.2.0
AppendUInt256 appends slice of UInt256 to Array(UInt256).
func (*ColArr) AppendUInt32 ¶
AppendUInt32 appends slice of uint32 to Array(UInt32).
func (*ColArr) AppendUInt64 ¶
AppendUInt64 appends slice of uint64 to Array(UInt64).
func (*ColArr) AppendUInt8 ¶
AppendUInt8 appends slice of uint8 to Array(UInt8).
func (ColArr) EncodeColumn ¶
func (ColArr) Type ¶
func (c ColArr) Type() ColumnType
type ColAuto ¶ added in v0.4.0
type ColAuto struct {
Data Column
}
ColAuto is column that is initialized during decoding.
func (ColAuto) DecodeColumn ¶ added in v0.4.0
func (ColAuto) EncodeColumn ¶ added in v0.4.0
func (*ColAuto) Infer ¶ added in v0.4.0
func (c *ColAuto) Infer(t ColumnType) error
Infer and initialize Column from ColumnType.
func (ColAuto) Type ¶ added in v0.4.0
func (c ColAuto) Type() ColumnType
type ColBool ¶
type ColBool []bool
ColBool is Bool column.
func (*ColBool) DecodeColumn ¶
DecodeColumn decodes Bool rows from *Reader.
func (ColBool) EncodeColumn ¶
EncodeColumn encodes Bool rows to *Buffer.
type ColDate ¶
type ColDate []Date
ColDate represents Date column.
func (*ColDate) DecodeColumn ¶
DecodeColumn decodes Date rows from *Reader.
func (ColDate) EncodeColumn ¶
EncodeColumn encodes Date rows to *Buffer.
func (*ColDate) Reset ¶
func (c *ColDate) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColDate32 ¶
type ColDate32 []Date32
ColDate32 represents Date32 column.
func (*ColDate32) DecodeColumn ¶
DecodeColumn decodes Date32 rows from *Reader.
func (ColDate32) EncodeColumn ¶
EncodeColumn encodes Date32 rows to *Buffer.
func (*ColDate32) Reset ¶
func (c *ColDate32) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColDateTime ¶
type ColDateTime []DateTime
ColDateTime represents DateTime column.
func (*ColDateTime) Append ¶ added in v0.10.0
func (c *ColDateTime) Append(v DateTime)
Append DateTime to column.
func (*ColDateTime) DecodeColumn ¶
func (c *ColDateTime) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes DateTime rows from *Reader.
func (ColDateTime) EncodeColumn ¶
func (c ColDateTime) EncodeColumn(b *Buffer)
EncodeColumn encodes DateTime rows to *Buffer.
func (*ColDateTime) Reset ¶
func (c *ColDateTime) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColDateTime) Row ¶ added in v0.10.0
func (c ColDateTime) Row(i int) DateTime
Row returns i-th row of column.
type ColDateTime64 ¶
type ColDateTime64 []DateTime64
ColDateTime64 represents DateTime64 column.
func (*ColDateTime64) Append ¶ added in v0.10.0
func (c *ColDateTime64) Append(v DateTime64)
Append DateTime64 to column.
func (*ColDateTime64) DecodeColumn ¶
func (c *ColDateTime64) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes DateTime64 rows from *Reader.
func (ColDateTime64) EncodeColumn ¶
func (c ColDateTime64) EncodeColumn(b *Buffer)
EncodeColumn encodes DateTime64 rows to *Buffer.
func (*ColDateTime64) Reset ¶
func (c *ColDateTime64) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColDateTime64) Row ¶ added in v0.10.0
func (c ColDateTime64) Row(i int) DateTime64
Row returns i-th row of column.
func (ColDateTime64) Type ¶
func (ColDateTime64) Type() ColumnType
Type returns ColumnType of DateTime64.
func (*ColDateTime64) Wrap ¶
func (c *ColDateTime64) Wrap(p Precision) Column
Wrap column with explicit precision.
type ColDecimal128 ¶ added in v0.2.0
type ColDecimal128 []Decimal128
ColDecimal128 represents Decimal128 column.
func (*ColDecimal128) Append ¶ added in v0.10.0
func (c *ColDecimal128) Append(v Decimal128)
Append Decimal128 to column.
func (*ColDecimal128) DecodeColumn ¶ added in v0.2.0
func (c *ColDecimal128) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes Decimal128 rows from *Reader.
func (ColDecimal128) EncodeColumn ¶ added in v0.2.0
func (c ColDecimal128) EncodeColumn(b *Buffer)
EncodeColumn encodes Decimal128 rows to *Buffer.
func (*ColDecimal128) Reset ¶ added in v0.2.0
func (c *ColDecimal128) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColDecimal128) Row ¶ added in v0.10.0
func (c ColDecimal128) Row(i int) Decimal128
Row returns i-th row of column.
func (ColDecimal128) Rows ¶ added in v0.2.0
func (c ColDecimal128) Rows() int
Rows returns count of rows in column.
func (ColDecimal128) Type ¶ added in v0.2.0
func (ColDecimal128) Type() ColumnType
Type returns ColumnType of Decimal128.
type ColDecimal256 ¶ added in v0.2.0
type ColDecimal256 []Decimal256
ColDecimal256 represents Decimal256 column.
func (*ColDecimal256) Append ¶ added in v0.10.0
func (c *ColDecimal256) Append(v Decimal256)
Append Decimal256 to column.
func (*ColDecimal256) DecodeColumn ¶ added in v0.2.0
func (c *ColDecimal256) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes Decimal256 rows from *Reader.
func (ColDecimal256) EncodeColumn ¶ added in v0.2.0
func (c ColDecimal256) EncodeColumn(b *Buffer)
EncodeColumn encodes Decimal256 rows to *Buffer.
func (*ColDecimal256) Reset ¶ added in v0.2.0
func (c *ColDecimal256) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColDecimal256) Row ¶ added in v0.10.0
func (c ColDecimal256) Row(i int) Decimal256
Row returns i-th row of column.
func (ColDecimal256) Rows ¶ added in v0.2.0
func (c ColDecimal256) Rows() int
Rows returns count of rows in column.
func (ColDecimal256) Type ¶ added in v0.2.0
func (ColDecimal256) Type() ColumnType
Type returns ColumnType of Decimal256.
type ColDecimal32 ¶ added in v0.2.0
type ColDecimal32 []Decimal32
ColDecimal32 represents Decimal32 column.
func (*ColDecimal32) Append ¶ added in v0.10.0
func (c *ColDecimal32) Append(v Decimal32)
Append Decimal32 to column.
func (*ColDecimal32) DecodeColumn ¶ added in v0.2.0
func (c *ColDecimal32) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes Decimal32 rows from *Reader.
func (ColDecimal32) EncodeColumn ¶ added in v0.2.0
func (c ColDecimal32) EncodeColumn(b *Buffer)
EncodeColumn encodes Decimal32 rows to *Buffer.
func (*ColDecimal32) Reset ¶ added in v0.2.0
func (c *ColDecimal32) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColDecimal32) Row ¶ added in v0.10.0
func (c ColDecimal32) Row(i int) Decimal32
Row returns i-th row of column.
func (ColDecimal32) Rows ¶ added in v0.2.0
func (c ColDecimal32) Rows() int
Rows returns count of rows in column.
func (ColDecimal32) Type ¶ added in v0.2.0
func (ColDecimal32) Type() ColumnType
Type returns ColumnType of Decimal32.
type ColDecimal64 ¶ added in v0.2.0
type ColDecimal64 []Decimal64
ColDecimal64 represents Decimal64 column.
func (*ColDecimal64) Append ¶ added in v0.10.0
func (c *ColDecimal64) Append(v Decimal64)
Append Decimal64 to column.
func (*ColDecimal64) DecodeColumn ¶ added in v0.2.0
func (c *ColDecimal64) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes Decimal64 rows from *Reader.
func (ColDecimal64) EncodeColumn ¶ added in v0.2.0
func (c ColDecimal64) EncodeColumn(b *Buffer)
EncodeColumn encodes Decimal64 rows to *Buffer.
func (*ColDecimal64) Reset ¶ added in v0.2.0
func (c *ColDecimal64) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColDecimal64) Row ¶ added in v0.10.0
func (c ColDecimal64) Row(i int) Decimal64
Row returns i-th row of column.
func (ColDecimal64) Rows ¶ added in v0.2.0
func (c ColDecimal64) Rows() int
Rows returns count of rows in column.
func (ColDecimal64) Type ¶ added in v0.2.0
func (ColDecimal64) Type() ColumnType
Type returns ColumnType of Decimal64.
type ColEnum16 ¶
type ColEnum16 []Enum16
ColEnum16 represents Enum16 column.
func (*ColEnum16) DecodeColumn ¶
DecodeColumn decodes Enum16 rows from *Reader.
func (ColEnum16) EncodeColumn ¶
EncodeColumn encodes Enum16 rows to *Buffer.
func (*ColEnum16) Reset ¶
func (c *ColEnum16) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColEnum8 ¶
type ColEnum8 []Enum8
ColEnum8 represents Enum8 column.
func (*ColEnum8) DecodeColumn ¶
DecodeColumn decodes Enum8 rows from *Reader.
func (ColEnum8) EncodeColumn ¶
EncodeColumn encodes Enum8 rows to *Buffer.
func (*ColEnum8) Reset ¶
func (c *ColEnum8) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColEnum8Auto ¶ added in v0.5.0
type ColEnum8Auto struct { // Values of Enum8. Values []string // contains filtered or unexported fields }
ColEnum8Auto is inference helper for ColEnum8.
You can set Values and actual enum mapping will be inferred during query execution.
func (*ColEnum8Auto) Append ¶ added in v0.9.0
func (e *ColEnum8Auto) Append(v string)
Append value to Enum8 column.
func (*ColEnum8Auto) DecodeColumn ¶ added in v0.5.0
func (e *ColEnum8Auto) DecodeColumn(r *Reader, rows int) error
func (*ColEnum8Auto) EncodeColumn ¶ added in v0.5.0
func (e *ColEnum8Auto) EncodeColumn(b *Buffer)
func (*ColEnum8Auto) Infer ¶ added in v0.5.0
func (e *ColEnum8Auto) Infer(t ColumnType) error
func (*ColEnum8Auto) Prepare ¶ added in v0.9.0
func (e *ColEnum8Auto) Prepare() error
func (*ColEnum8Auto) Reset ¶ added in v0.5.0
func (e *ColEnum8Auto) Reset()
func (*ColEnum8Auto) Rows ¶ added in v0.5.0
func (e *ColEnum8Auto) Rows() int
func (*ColEnum8Auto) Type ¶ added in v0.5.0
func (e *ColEnum8Auto) Type() ColumnType
type ColFixedStr ¶
ColFixedStr represents FixedString(Size) column. Size is required.
Can be used to store SHA256, MD5 or similar fixed size binary values. See https://clickhouse.com/docs/en/sql-reference/data-types/fixedstring/.
func (*ColFixedStr) Append ¶ added in v0.15.0
func (c *ColFixedStr) Append(b []byte)
Append value to column. Panics if len(b) != Size.
If Size is not set, will set to len of first value.
func (*ColFixedStr) DecodeColumn ¶
func (c *ColFixedStr) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes ColFixedStr rows from *Reader.
func (ColFixedStr) EncodeColumn ¶
func (c ColFixedStr) EncodeColumn(b *Buffer)
EncodeColumn encodes ColFixedStr rows to *Buffer.
func (*ColFixedStr) Reset ¶
func (c *ColFixedStr) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (*ColFixedStr) SetSize ¶
func (c *ColFixedStr) SetSize(n int)
SetSize sets Size of FixedString(Size) to n.
Can be called during decode to infer size from result.
func (ColFixedStr) Type ¶
func (c ColFixedStr) Type() ColumnType
Type returns ColumnType of FixedString.
type ColFloat32 ¶
type ColFloat32 []float32
ColFloat32 represents Float32 column.
func (*ColFloat32) Append ¶ added in v0.10.0
func (c *ColFloat32) Append(v float32)
Append float32 to column.
func (*ColFloat32) DecodeColumn ¶
func (c *ColFloat32) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes Float32 rows from *Reader.
func (ColFloat32) EncodeColumn ¶
func (c ColFloat32) EncodeColumn(b *Buffer)
EncodeColumn encodes Float32 rows to *Buffer.
func (*ColFloat32) Reset ¶
func (c *ColFloat32) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColFloat32) Row ¶ added in v0.10.0
func (c ColFloat32) Row(i int) float32
Row returns i-th row of column.
type ColFloat64 ¶
type ColFloat64 []float64
ColFloat64 represents Float64 column.
func (*ColFloat64) Append ¶ added in v0.10.0
func (c *ColFloat64) Append(v float64)
Append float64 to column.
func (*ColFloat64) DecodeColumn ¶
func (c *ColFloat64) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes Float64 rows from *Reader.
func (ColFloat64) EncodeColumn ¶
func (c ColFloat64) EncodeColumn(b *Buffer)
EncodeColumn encodes Float64 rows to *Buffer.
func (*ColFloat64) Reset ¶
func (c *ColFloat64) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColFloat64) Row ¶ added in v0.10.0
func (c ColFloat64) Row(i int) float64
Row returns i-th row of column.
type ColIPv4 ¶
type ColIPv4 []IPv4
ColIPv4 represents IPv4 column.
func (*ColIPv4) DecodeColumn ¶
DecodeColumn decodes IPv4 rows from *Reader.
func (ColIPv4) EncodeColumn ¶
EncodeColumn encodes IPv4 rows to *Buffer.
func (*ColIPv4) Reset ¶
func (c *ColIPv4) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColIPv6 ¶
type ColIPv6 []IPv6
ColIPv6 represents IPv6 column.
func (*ColIPv6) DecodeColumn ¶
DecodeColumn decodes IPv6 rows from *Reader.
func (ColIPv6) EncodeColumn ¶
EncodeColumn encodes IPv6 rows to *Buffer.
func (*ColIPv6) Reset ¶
func (c *ColIPv6) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColInfo ¶ added in v0.9.0
type ColInfo struct { Name string Type ColumnType }
ColInfo wraps Name and Type of column.
type ColInfoInput ¶ added in v0.9.0
type ColInfoInput []ColInfo
ColInfoInput saves column info on decoding.
func (*ColInfoInput) DecodeResult ¶ added in v0.9.0
func (s *ColInfoInput) DecodeResult(r *Reader, b Block) error
func (*ColInfoInput) Reset ¶ added in v0.16.0
func (s *ColInfoInput) Reset()
type ColInput ¶ added in v0.5.0
type ColInput interface { Type() ColumnType Rows() int EncodeColumn(b *Buffer) }
ColInput column.
type ColInt128 ¶
type ColInt128 []Int128
ColInt128 represents Int128 column.
func (*ColInt128) DecodeColumn ¶
DecodeColumn decodes Int128 rows from *Reader.
func (ColInt128) EncodeColumn ¶
EncodeColumn encodes Int128 rows to *Buffer.
func (*ColInt128) Reset ¶
func (c *ColInt128) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColInt16 ¶
type ColInt16 []int16
ColInt16 represents Int16 column.
func (*ColInt16) DecodeColumn ¶
DecodeColumn decodes Int16 rows from *Reader.
func (ColInt16) EncodeColumn ¶
EncodeColumn encodes Int16 rows to *Buffer.
func (*ColInt16) Reset ¶
func (c *ColInt16) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColInt256 ¶ added in v0.2.0
type ColInt256 []Int256
ColInt256 represents Int256 column.
func (*ColInt256) DecodeColumn ¶ added in v0.2.0
DecodeColumn decodes Int256 rows from *Reader.
func (ColInt256) EncodeColumn ¶ added in v0.2.0
EncodeColumn encodes Int256 rows to *Buffer.
func (*ColInt256) Reset ¶ added in v0.2.0
func (c *ColInt256) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColInt256) Type ¶ added in v0.2.0
func (ColInt256) Type() ColumnType
Type returns ColumnType of Int256.
type ColInt32 ¶
type ColInt32 []int32
ColInt32 represents Int32 column.
func (*ColInt32) DecodeColumn ¶
DecodeColumn decodes Int32 rows from *Reader.
func (ColInt32) EncodeColumn ¶
EncodeColumn encodes Int32 rows to *Buffer.
func (*ColInt32) Reset ¶
func (c *ColInt32) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColInt64 ¶
type ColInt64 []int64
ColInt64 represents Int64 column.
func (*ColInt64) DecodeColumn ¶
DecodeColumn decodes Int64 rows from *Reader.
func (ColInt64) EncodeColumn ¶
EncodeColumn encodes Int64 rows to *Buffer.
func (*ColInt64) Reset ¶
func (c *ColInt64) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColInt8 ¶
type ColInt8 []int8
ColInt8 represents Int8 column.
func (*ColInt8) DecodeColumn ¶
DecodeColumn decodes Int8 rows from *Reader.
func (ColInt8) EncodeColumn ¶
EncodeColumn encodes Int8 rows to *Buffer.
func (*ColInt8) Reset ¶
func (c *ColInt8) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColLowCardinality ¶
type ColLowCardinality struct { Index Column // dictionary Key CardinalityKey Keys8 ColUInt8 Keys16 ColUInt16 Keys32 ColUInt32 Keys64 ColUInt64 }
ColLowCardinality contains index and keys columns.
Index (i.e. dictionary) column contains unique values, Keys column contains sequence of indexes in Index column that represent actual values.
For example, ["Eko", "Eko", "Amadela", "Amadela", "Amadela", "Amadela"] can be encoded as:
Index: ["Eko", "Amadela"] (String) Keys: [0, 0, 1, 1, 1, 1] (UInt8)
The CardinalityKey is chosen depending on Index size, i.e. maximum value of chosen type should be able to represent any index of Index element.
func (*ColLowCardinality) AppendKey ¶
func (c *ColLowCardinality) AppendKey(i int)
func (*ColLowCardinality) DecodeColumn ¶
func (c *ColLowCardinality) DecodeColumn(r *Reader, rows int) error
func (ColLowCardinality) EncodeColumn ¶
func (c ColLowCardinality) EncodeColumn(b *Buffer)
func (*ColLowCardinality) Keys ¶
func (c *ColLowCardinality) Keys() Column
func (*ColLowCardinality) Reset ¶
func (c *ColLowCardinality) Reset()
func (ColLowCardinality) Rows ¶
func (c ColLowCardinality) Rows() int
func (ColLowCardinality) Type ¶
func (c ColLowCardinality) Type() ColumnType
type ColMap ¶
ColMap represents Map column.
func (ColMap) EncodeColumn ¶
func (ColMap) Type ¶
func (c ColMap) Type() ColumnType
type ColNullable ¶ added in v0.2.0
ColNullable represents Nullable(T) column.
Nulls is nullable "mask" on Values column. For example, to encode [null, "", "hello", null, "world"]
Values: ["", "", "hello", "", "world"] (len: 5) Nulls: [ 1, 0, 0, 1, 0] (len: 5)
Values and Nulls row counts are always equal.
func (*ColNullable) DecodeColumn ¶ added in v0.2.0
func (c *ColNullable) DecodeColumn(r *Reader, rows int) error
func (ColNullable) EncodeColumn ¶ added in v0.2.0
func (c ColNullable) EncodeColumn(b *Buffer)
func (ColNullable) IsElemNull ¶ added in v0.2.0
func (c ColNullable) IsElemNull(i int) bool
func (*ColNullable) Reset ¶ added in v0.2.0
func (c *ColNullable) Reset()
func (ColNullable) Rows ¶ added in v0.2.0
func (c ColNullable) Rows() int
func (ColNullable) Type ¶ added in v0.2.0
func (c ColNullable) Type() ColumnType
type ColRaw ¶ added in v0.6.0
type ColRaw struct { T ColumnType // type of column Size int // size of single value Data []byte // raw value of column Count int // count of rows }
ColRaw is Column that performs zero decoding or encoding. T, Size are required.
TODO: support strings and T, Size inference.
Useful for copying from one source to another.
func (*ColRaw) DecodeColumn ¶ added in v0.6.0
func (ColRaw) EncodeColumn ¶ added in v0.6.0
func (ColRaw) Type ¶ added in v0.6.0
func (c ColRaw) Type() ColumnType
type ColResult ¶ added in v0.5.0
type ColResult interface { Type() ColumnType Rows() int DecodeColumn(r *Reader, rows int) error Reset() }
ColResult column.
type ColStr ¶
ColStr represents String column.
func (*ColStr) AppendBytes ¶ added in v0.8.0
AppendBytes append byte slice as string to column.
func (*ColStr) DecodeColumn ¶
DecodeColumn decodes String rows from *Reader.
func (ColStr) EncodeColumn ¶
EncodeColumn encodes String rows to *Buffer.
func (ColStr) ForEachBytes ¶
ForEachBytes calls f on each string from column as byte slice.
type ColTuple ¶ added in v0.2.0
type ColTuple []Column
ColTuple is Tuple column.
Basically it is just a group of columns.
func (ColTuple) DecodeColumn ¶ added in v0.2.0
func (ColTuple) EncodeColumn ¶ added in v0.2.0
func (ColTuple) Type ¶ added in v0.2.0
func (c ColTuple) Type() ColumnType
type ColUInt128 ¶
type ColUInt128 []UInt128
ColUInt128 represents UInt128 column.
func (*ColUInt128) Append ¶ added in v0.10.0
func (c *ColUInt128) Append(v UInt128)
Append UInt128 to column.
func (*ColUInt128) DecodeColumn ¶
func (c *ColUInt128) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes UInt128 rows from *Reader.
func (ColUInt128) EncodeColumn ¶
func (c ColUInt128) EncodeColumn(b *Buffer)
EncodeColumn encodes UInt128 rows to *Buffer.
func (*ColUInt128) Reset ¶
func (c *ColUInt128) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColUInt128) Row ¶ added in v0.10.0
func (c ColUInt128) Row(i int) UInt128
Row returns i-th row of column.
type ColUInt16 ¶
type ColUInt16 []uint16
ColUInt16 represents UInt16 column.
func (*ColUInt16) DecodeColumn ¶
DecodeColumn decodes UInt16 rows from *Reader.
func (ColUInt16) EncodeColumn ¶
EncodeColumn encodes UInt16 rows to *Buffer.
func (*ColUInt16) Reset ¶
func (c *ColUInt16) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColUInt256 ¶ added in v0.2.0
type ColUInt256 []UInt256
ColUInt256 represents UInt256 column.
func (*ColUInt256) Append ¶ added in v0.10.0
func (c *ColUInt256) Append(v UInt256)
Append UInt256 to column.
func (*ColUInt256) DecodeColumn ¶ added in v0.2.0
func (c *ColUInt256) DecodeColumn(r *Reader, rows int) error
DecodeColumn decodes UInt256 rows from *Reader.
func (ColUInt256) EncodeColumn ¶ added in v0.2.0
func (c ColUInt256) EncodeColumn(b *Buffer)
EncodeColumn encodes UInt256 rows to *Buffer.
func (*ColUInt256) Reset ¶ added in v0.2.0
func (c *ColUInt256) Reset()
Reset resets data in row, preserving capacity for efficiency.
func (ColUInt256) Row ¶ added in v0.10.0
func (c ColUInt256) Row(i int) UInt256
Row returns i-th row of column.
func (ColUInt256) Rows ¶ added in v0.2.0
func (c ColUInt256) Rows() int
Rows returns count of rows in column.
func (ColUInt256) Type ¶ added in v0.2.0
func (ColUInt256) Type() ColumnType
Type returns ColumnType of UInt256.
type ColUInt32 ¶
type ColUInt32 []uint32
ColUInt32 represents UInt32 column.
func (*ColUInt32) DecodeColumn ¶
DecodeColumn decodes UInt32 rows from *Reader.
func (ColUInt32) EncodeColumn ¶
EncodeColumn encodes UInt32 rows to *Buffer.
func (*ColUInt32) Reset ¶
func (c *ColUInt32) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColUInt64 ¶
type ColUInt64 []uint64
ColUInt64 represents UInt64 column.
func (*ColUInt64) DecodeColumn ¶
DecodeColumn decodes UInt64 rows from *Reader.
func (ColUInt64) EncodeColumn ¶
EncodeColumn encodes UInt64 rows to *Buffer.
func (*ColUInt64) Reset ¶
func (c *ColUInt64) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColUInt8 ¶
type ColUInt8 []uint8
ColUInt8 represents UInt8 column.
func (*ColUInt8) DecodeColumn ¶
DecodeColumn decodes UInt8 rows from *Reader.
func (ColUInt8) EncodeColumn ¶
EncodeColumn encodes UInt8 rows to *Buffer.
func (*ColUInt8) Reset ¶
func (c *ColUInt8) Reset()
Reset resets data in row, preserving capacity for efficiency.
type ColUUID ¶
ColUUID is UUID column.
func (ColUUID) EncodeColumn ¶
EncodeColumn encodes ColUUID rows to *Buffer.
func (ColUUID) Type ¶
func (c ColUUID) Type() ColumnType
type Column ¶
func Alias ¶ added in v0.2.0
func Alias(c Column, t ColumnType) Column
Alias column as other type.
E.g. Bool is domain of UInt8, so can be aliased from UInt8.
type ColumnType ¶
type ColumnType string
ColumnType is type of column element.
const ( ColumnTypeNone ColumnType = "" ColumnTypeInt8 ColumnType = "Int8" ColumnTypeInt16 ColumnType = "Int16" ColumnTypeInt32 ColumnType = "Int32" ColumnTypeInt64 ColumnType = "Int64" ColumnTypeInt128 ColumnType = "Int128" ColumnTypeInt256 ColumnType = "Int256" ColumnTypeUInt8 ColumnType = "UInt8" ColumnTypeUInt16 ColumnType = "UInt16" ColumnTypeUInt32 ColumnType = "UInt32" ColumnTypeUInt64 ColumnType = "UInt64" ColumnTypeUInt128 ColumnType = "UInt128" ColumnTypeUInt256 ColumnType = "UInt256" ColumnTypeFloat32 ColumnType = "Float32" ColumnTypeFloat64 ColumnType = "Float64" ColumnTypeString ColumnType = "String" ColumnTypeFixedString ColumnType = "FixedString" ColumnTypeArray ColumnType = "Array" ColumnTypeIPv4 ColumnType = "IPv4" ColumnTypeIPv6 ColumnType = "IPv6" ColumnTypeDateTime ColumnType = "DateTime" ColumnTypeDateTime64 ColumnType = "DateTime64" ColumnTypeDate ColumnType = "Date" ColumnTypeDate32 ColumnType = "Date32" ColumnTypeUUID ColumnType = "UUID" ColumnTypeEnum8 ColumnType = "Enum8" ColumnTypeEnum16 ColumnType = "Enum16" ColumnTypeLowCardinality ColumnType = "LowCardinality" ColumnTypeMap ColumnType = "Map" ColumnTypeBool ColumnType = "Bool" ColumnTypeTuple ColumnType = "Tuple" ColumnTypeNullable ColumnType = "Nullable" ColumnTypeDecimal32 ColumnType = "Decimal32" ColumnTypeDecimal64 ColumnType = "Decimal64" ColumnTypeDecimal128 ColumnType = "Decimal128" ColumnTypeDecimal256 ColumnType = "Decimal256" )
Common colum type names. Does not represent full set of supported types, because ColumnTypeArray is composable; actual type is composite.
For example: Array(Int8) or even Array(Array(String)).
func (ColumnType) Base ¶
func (c ColumnType) Base() ColumnType
func (ColumnType) Conflicts ¶
func (c ColumnType) Conflicts(b ColumnType) bool
Conflicts reports whether two types conflict.
func (ColumnType) Elem ¶
func (c ColumnType) Elem() ColumnType
func (ColumnType) IsArray ¶
func (c ColumnType) IsArray() bool
IsArray reports whether ColumnType is composite.
func (ColumnType) String ¶
func (c ColumnType) String() string
func (ColumnType) Sub ¶
func (c ColumnType) Sub(subtypes ...ColumnType) ColumnType
Sub of T returns T(A, B, ...).
func (ColumnType) With ¶
func (c ColumnType) With(params ...string) ColumnType
With returns ColumnType(p1, p2, ...) from ColumnType.
type Compression ¶
type Compression byte
Compression status.
const ( CompressionDisabled Compression = 0 CompressionEnabled Compression = 1 )
Compression statuses.
func CompressionString ¶
func CompressionString(s string) (Compression, error)
CompressionString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func CompressionValues ¶
func CompressionValues() []Compression
CompressionValues returns all values of the enum
func (Compression) IsACompression ¶
func (i Compression) IsACompression() bool
IsACompression returns "true" if the value is listed in the enum definition. "false" otherwise
func (Compression) String ¶
func (i Compression) String() string
type Date ¶
type Date uint16
Date represents Date value.
https://clickhouse.com/docs/en/sql-reference/data-types/date/
type Date32 ¶
type Date32 uint32
Date32 represents Date32 value.
https://clickhouse.com/docs/en/sql-reference/data-types/date32/
type DateTime64 ¶
type DateTime64 int64
DateTime64 represents DateTime64 type.
See https://clickhouse.com/docs/en/sql-reference/data-types/datetime64/.
func ToDateTime64 ¶
func ToDateTime64(t time.Time, p Precision) DateTime64
ToDateTime64 converts time.Time to DateTime64.
type Enum16 ¶
type Enum16 int16
Enum16 represents raw Enum16 value.
Actual values should be taken from DDL.
type Enum8 ¶
type Enum8 int8
Enum8 represents raw Enum8 value.
Actual values should be taken from DDL.
type Error ¶
type Error int
Error on server side.
const ( ErrUnsupportedMethod Error = 1 ErrUnsupportedParameter Error = 2 ErrUnexpectedEndOfFile Error = 3 ErrExpectedEndOfFile Error = 4 ErrCannotParseText Error = 6 ErrIncorrectNumberOfColumns Error = 7 ErrThereIsNoColumn Error = 8 ErrSizesOfColumnsDoesntMatch Error = 9 ErrNotFoundColumnInBlock Error = 10 ErrPositionOutOfBound Error = 11 ErrParameterOutOfBound Error = 12 ErrSizesOfColumnsInTupleDoesntMatch Error = 13 ErrDuplicateColumn Error = 15 ErrNoSuchColumnInTable Error = 16 ErrDelimiterInStringLiteralDoesntMatch Error = 17 ErrCannotInsertElementIntoConstantColumn Error = 18 ErrSizeOfFixedStringDoesntMatch Error = 19 ErrNumberOfColumnsDoesntMatch Error = 20 ErrCannotReadAllDataFromTabSeparatedInput Error = 21 ErrCannotParseAllValueFromTabSeparatedInput Error = 22 ErrCannotReadFromIstream Error = 23 ErrCannotWriteToOstream Error = 24 ErrCannotParseEscapeSequence Error = 25 ErrCannotParseQuotedString Error = 26 ErrCannotParseInputAssertionFailed Error = 27 ErrCannotPrintFloatOrDoubleNumber Error = 28 ErrCannotPrintInteger Error = 29 ErrCannotReadSizeOfCompressedChunk Error = 30 ErrCannotReadCompressedChunk Error = 31 ErrAttemptToReadAfterEOF Error = 32 ErrCannotReadAllData Error = 33 ErrTooManyArgumentsForFunction Error = 34 ErrTooLessArgumentsForFunction Error = 35 ErrBadArguments Error = 36 ErrUnknownElementInAst Error = 37 ErrCannotParseDate Error = 38 ErrTooLargeSizeCompressed Error = 39 ErrChecksumDoesntMatch Error = 40 ErrCannotParseDatetime Error = 41 ErrNumberOfArgumentsDoesntMatch Error = 42 ErrIllegalTypeOfArgument Error = 43 ErrIllegalColumn Error = 44 ErrIllegalNumberOfResultColumns Error = 45 ErrUnknownFunction Error = 46 ErrUnknownIdentifier Error = 47 ErrNotImplemented Error = 48 ErrLogicalError Error = 49 ErrUnknownType Error = 50 ErrEmptyListOfColumnsQueried Error = 51 ErrColumnQueriedMoreThanOnce Error = 52 ErrTypeMismatch Error = 53 ErrStorageDoesntAllowParameters Error = 54 ErrStorageRequiresParameter Error = 55 ErrUnknownStorage Error = 56 ErrTableAlreadyExists Error = 57 ErrTableMetadataAlreadyExists Error = 58 ErrIllegalTypeOfColumnForFilter Error = 59 ErrUnknownTable Error = 60 ErrOnlyFilterColumnInBlock Error = 61 ErrSyntaxError Error = 62 ErrUnknownAggregateFunction Error = 63 ErrCannotReadAggregateFunctionFromText Error = 64 ErrCannotWriteAggregateFunctionAsText Error = 65 ErrNotAColumn Error = 66 ErrIllegalKeyOfAggregation Error = 67 ErrCannotGetSizeOfField Error = 68 ErrArgumentOutOfBound Error = 69 ErrCannotConvertType Error = 70 ErrCannotWriteAfterEndOfBuffer Error = 71 ErrCannotParseNumber Error = 72 ErrUnknownFormat Error = 73 ErrCannotReadFromFileDescriptor Error = 74 ErrCannotWriteToFileDescriptor Error = 75 ErrCannotOpenFile Error = 76 ErrCannotCloseFile Error = 77 ErrUnknownTypeOfQuery Error = 78 ErrIncorrectFileName Error = 79 ErrIncorrectQuery Error = 80 ErrUnknownDatabase Error = 81 ErrDatabaseAlreadyExists Error = 82 ErrDirectoryDoesntExist Error = 83 ErrDirectoryAlreadyExists Error = 84 ErrFormatIsNotSuitableForInput Error = 85 ErrReceivedErrorFromRemoteIoServer Error = 86 ErrCannotSeekThroughFile Error = 87 ErrCannotTruncateFile Error = 88 ErrUnknownCompressionMethod Error = 89 ErrEmptyListOfColumnsPassed Error = 90 ErrSizesOfMarksFilesAreInconsistent Error = 91 ErrEmptyDataPassed Error = 92 ErrUnknownAggregatedDataVariant Error = 93 ErrCannotMergeDifferentAggregatedDataVariants Error = 94 ErrCannotReadFromSocket Error = 95 ErrCannotWriteToSocket Error = 96 ErrCannotReadAllDataFromChunkedInput Error = 97 ErrCannotWriteToEmptyBlockOutputStream Error = 98 ErrUnknownPacketFromClient Error = 99 ErrUnknownPacketFromServer Error = 100 ErrUnexpectedPacketFromClient Error = 101 ErrUnexpectedPacketFromServer Error = 102 ErrReceivedDataForWrongQueryID Error = 103 ErrTooSmallBufferSize Error = 104 ErrCannotReadHistory Error = 105 ErrCannotAppendHistory Error = 106 ErrFileDoesntExist Error = 107 ErrNoDataToInsert Error = 108 ErrCannotBlockSignal Error = 109 ErrCannotUnblockSignal Error = 110 ErrCannotManipulateSigset Error = 111 ErrCannotWaitForSignal Error = 112 ErrThereIsNoSession Error = 113 ErrCannotClockGettime Error = 114 ErrUnknownSetting Error = 115 ErrThereIsNoDefaultValue Error = 116 ErrIncorrectData Error = 117 ErrEngineRequired Error = 119 ErrCannotInsertValueOfDifferentSizeIntoTuple Error = 120 ErrUnknownSetDataVariant Error = 121 ErrIncompatibleColumns Error = 122 ErrUnknownTypeOfAstNode Error = 123 ErrIncorrectElementOfSet Error = 124 ErrIncorrectResultOfScalarSubquery Error = 125 ErrCannotGetReturnType Error = 126 ErrIllegalIndex Error = 127 ErrTooLargeArraySize Error = 128 ErrFunctionIsSpecial Error = 129 ErrCannotReadArrayFromText Error = 130 ErrTooLargeStringSize Error = 131 ErrCannotCreateTableFromMetadata Error = 132 ErrAggregateFunctionDoesntAllowParameters Error = 133 ErrParametersToAggregateFunctionsMustBeLiterals Error = 134 ErrZeroArrayOrTupleIndex Error = 135 ErrUnknownElementInConfig Error = 137 ErrExcessiveElementInConfig Error = 138 ErrNoElementsInConfig Error = 139 ErrAllRequestedColumnsAreMissing Error = 140 ErrSamplingNotSupported Error = 141 ErrNotFoundNode Error = 142 ErrFoundMoreThanOneNode Error = 143 ErrFirstDateIsBiggerThanLastDate Error = 144 ErrUnknownOverflowMode Error = 145 ErrQuerySectionDoesntMakeSense Error = 146 ErrNotFoundFunctionElementForAggregate Error = 147 ErrNotFoundRelationElementForCondition Error = 148 ErrNotFoundRHSElementForCondition Error = 149 ErrNoAttributesListed Error = 150 ErrIndexOfColumnInSortClauseIsOutOfRange Error = 151 ErrUnknownDirectionOfSorting Error = 152 ErrIllegalDivision Error = 153 ErrAggregateFunctionNotApplicable Error = 154 ErrUnknownRelation Error = 155 ErrDictionariesWasNotLoaded Error = 156 ErrIllegalOverflowMode Error = 157 ErrTooManyRows Error = 158 ErrTimeoutExceeded Error = 159 ErrTooSlow Error = 160 ErrTooManyColumns Error = 161 ErrTooDeepSubqueries Error = 162 ErrTooDeepPipeline Error = 163 ErrReadonly Error = 164 ErrTooManyTemporaryColumns Error = 165 ErrTooManyTemporaryNonConstColumns Error = 166 ErrTooDeepAst Error = 167 ErrTooBigAst Error = 168 ErrBadTypeOfField Error = 169 ErrBadGet Error = 170 ErrBlocksHaveDifferentStructure Error = 171 ErrCannotCreateDirectory Error = 172 ErrCannotAllocateMemory Error = 173 ErrCyclicAliases Error = 174 ErrChunkNotFound Error = 176 ErrDuplicateChunkName Error = 177 ErrMultipleAliasesForExpression Error = 178 ErrMultipleExpressionsForAlias Error = 179 ErrThereIsNoProfile Error = 180 ErrIllegalFinal Error = 181 ErrIllegalPrewhere Error = 182 ErrUnexpectedExpression Error = 183 ErrIllegalAggregation Error = 184 ErrUnsupportedMyisamBlockType Error = 185 ErrUnsupportedCollationLocale Error = 186 ErrCollationComparisonFailed Error = 187 ErrUnknownAction Error = 188 ErrTableMustNotBeCreatedManually Error = 189 ErrSizesOfArraysDoesntMatch Error = 190 ErrSetSizeLimitExceeded Error = 191 ErrUnknownUser Error = 192 ErrWrongPassword Error = 193 ErrRequiredPassword Error = 194 ErrIPAddressNotAllowed Error = 195 ErrUnknownAddressPatternType Error = 196 ErrServerRevisionIsTooOld Error = 197 ErrDNSError Error = 198 ErrUnknownQuota Error = 199 ErrQuotaDoesntAllowKeys Error = 200 ErrQuotaExpired Error = 201 ErrTooManySimultaneousQueries Error = 202 ErrNoFreeConnection Error = 203 ErrCannotFsync Error = 204 ErrNestedTypeTooDeep Error = 205 ErrAliasRequired Error = 206 ErrAmbiguousIdentifier Error = 207 ErrEmptyNestedTable Error = 208 ErrSocketTimeout Error = 209 ErrNetworkError Error = 210 ErrEmptyQuery Error = 211 ErrUnknownLoadBalancing Error = 212 ErrUnknownTotalsMode Error = 213 ErrCannotStatvfs Error = 214 ErrNotAnAggregate Error = 215 ErrQueryWithSameIDIsAlreadyRunning Error = 216 ErrClientHasConnectedToWrongPort Error = 217 ErrTableIsDropped Error = 218 ErrDatabaseNotEmpty Error = 219 ErrDuplicateInterserverIoEndpoint Error = 220 ErrNoSuchInterserverIoEndpoint Error = 221 ErrAddingReplicaToNonEmptyTable Error = 222 ErrUnexpectedAstStructure Error = 223 ErrReplicaIsAlreadyActive Error = 224 ErrNoZookeeper Error = 225 ErrNoFileInDataPart Error = 226 ErrUnexpectedFileInDataPart Error = 227 ErrBadSizeOfFileInDataPart Error = 228 ErrQueryIsTooLarge Error = 229 ErrNotFoundExpectedDataPart Error = 230 ErrTooManyUnexpectedDataParts Error = 231 ErrNoSuchDataPart Error = 232 ErrBadDataPartName Error = 233 ErrNoReplicaHasPart Error = 234 ErrDuplicateDataPart Error = 235 ErrAborted Error = 236 ErrNoReplicaNameGiven Error = 237 ErrFormatVersionTooOld Error = 238 ErrCannotMunmap Error = 239 ErrCannotMremap Error = 240 ErrMemoryLimitExceeded Error = 241 ErrTableIsReadOnly Error = 242 ErrNotEnoughSpace Error = 243 ErrUnexpectedZookeeperError Error = 244 ErrCorruptedData Error = 246 ErrIncorrectMark Error = 247 ErrInvalidPartitionValue Error = 248 ErrNotEnoughBlockNumbers Error = 250 ErrNoSuchReplica Error = 251 ErrTooManyParts Error = 252 ErrReplicaIsAlreadyExist Error = 253 ErrNoActiveReplicas Error = 254 ErrTooManyRetriesToFetchParts Error = 255 ErrPartitionAlreadyExists Error = 256 ErrPartitionDoesntExist Error = 257 ErrUnionAllResultStructuresMismatch Error = 258 ErrClientOutputFormatSpecified Error = 260 ErrUnknownBlockInfoField Error = 261 ErrBadCollation Error = 262 ErrCannotCompileCode Error = 263 ErrIncompatibleTypeOfJoin Error = 264 ErrNoAvailableReplica Error = 265 ErrMismatchReplicasDataSources Error = 266 ErrStorageDoesntSupportParallelReplicas Error = 267 ErrCPUIDError Error = 268 ErrInfiniteLoop Error = 269 ErrCannotCompress Error = 270 ErrCannotDecompress Error = 271 ErrAioSubmitError Error = 272 ErrAioCompletionError Error = 273 ErrAioReadError Error = 274 ErrAioWriteError Error = 275 ErrIndexNotUsed Error = 277 ErrLeadershipLost Error = 278 ErrAllConnectionTriesFailed Error = 279 ErrNoAvailableData Error = 280 ErrDictionaryIsEmpty Error = 281 ErrIncorrectIndex Error = 282 ErrUnknownDistributedProductMode Error = 283 ErrUnknownGlobalSubqueriesMethod Error = 284 ErrTooLessLiveReplicas Error = 285 ErrUnsatisfiedQuorumForPreviousWrite Error = 286 ErrUnknownFormatVersion Error = 287 ErrDistributedInJoinSubqueryDenied Error = 288 ErrReplicaIsNotInQuorum Error = 289 ErrLimitExceeded Error = 290 ErrDatabaseAccessDenied Error = 291 ErrLeadershipChanged Error = 292 ErrMongodbCannotAuthenticate Error = 293 ErrInvalidBlockExtraInfo Error = 294 ErrReceivedEmptyData Error = 295 ErrNoRemoteShardFound Error = 296 ErrShardHasNoConnections Error = 297 ErrCannotPipe Error = 298 ErrCannotFork Error = 299 ErrCannotDlsym Error = 300 ErrCannotCreateChildProcess Error = 301 ErrChildWasNotExitedNormally Error = 302 ErrCannotSelect Error = 303 ErrCannotWaitpid Error = 304 ErrTableWasNotDropped Error = 305 ErrTooDeepRecursion Error = 306 ErrTooManyBytes Error = 307 ErrUnexpectedNodeInZookeeper Error = 308 ErrFunctionCannotHaveParameters Error = 309 ErrInvalidShardWeight Error = 317 ErrInvalidConfigParameter Error = 318 ErrUnknownStatusOfInsert Error = 319 ErrValueIsOutOfRangeOfDataType Error = 321 ErrBarrierTimeout Error = 335 ErrUnknownDatabaseEngine Error = 336 ErrDdlGuardIsActive Error = 337 ErrUnfinished Error = 341 ErrMetadataMismatch Error = 342 ErrSupportIsDisabled Error = 344 ErrTableDiffersTooMuch Error = 345 ErrCannotConvertCharset Error = 346 ErrCannotLoadConfig Error = 347 ErrCannotInsertNullInOrdinaryColumn Error = 349 ErrIncompatibleSourceTables Error = 350 ErrAmbiguousTableName Error = 351 ErrAmbiguousColumnName Error = 352 ErrIndexOfPositionalArgumentIsOutOfRange Error = 353 ErrZlibInflateFailed Error = 354 ErrZlibDeflateFailed Error = 355 ErrBadLambda Error = 356 ErrReservedIdentifierName Error = 357 ErrIntoOutfileNotAllowed Error = 358 ErrTableSizeExceedsMaxDropSizeLimit Error = 359 ErrCannotCreateCharsetConverter Error = 360 ErrSeekPositionOutOfBound Error = 361 ErrCurrentWriteBufferIsExhausted Error = 362 ErrCannotCreateIoBuffer Error = 363 ErrReceivedErrorTooManyRequests Error = 364 ErrOutputIsNotSorted Error = 365 ErrSizesOfNestedColumnsAreInconsistent Error = 366 ErrTooManyFetches Error = 367 ErrBadCast Error = 368 ErrAllReplicasAreStale Error = 369 ErrDataTypeCannotBeUsedInTables Error = 370 ErrInconsistentClusterDefinition Error = 371 ErrSessionNotFound Error = 372 ErrSessionIsLocked Error = 373 ErrInvalidSessionTimeout Error = 374 ErrCannotDlopen Error = 375 ErrCannotParseUUID Error = 376 ErrIllegalSyntaxForDataType Error = 377 ErrDataTypeCannotHaveArguments Error = 378 ErrUnknownStatusOfDistributedDdlTask Error = 379 ErrCannotKill Error = 380 ErrHTTPLengthRequired Error = 381 ErrCannotLoadCatboostModel Error = 382 ErrCannotApplyCatboostModel Error = 383 ErrPartIsTemporarilyLocked Error = 384 ErrMultipleStreamsRequired Error = 385 ErrNoCommonType Error = 386 ErrExternalLoadableAlreadyExists Error = 387 ErrCannotAssignOptimize Error = 388 ErrInsertWasDeduplicated Error = 389 ErrCannotGetCreateTableQuery Error = 390 ErrExternalLibraryError Error = 391 ErrQueryIsProhibited Error = 392 ErrThereIsNoQuery Error = 393 ErrQueryWasCancelled Error = 394 ErrFunctionThrowIfValueIsNonZero Error = 395 ErrTooManyRowsOrBytes Error = 396 ErrQueryIsNotSupportedInMaterializedView Error = 397 ErrCannotParseDomainValueFromString Error = 441 ErrKeeperException Error = 999 ErrPocoException Error = 1000 ErrStdException Error = 1001 ErrUnknownException Error = 1002 ErrConditionalTreeParentNotFound Error = 2001 ErrIllegalProjectionManipulator Error = 2002 )
Subset of possible errors.
func ErrorString ¶
ErrorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
type Exception ¶
Exception is server-side error.
func (*Exception) DecodeAware ¶
DecodeAware decodes exception.
func (*Exception) EncodeAware ¶
EncodeAware encodes exception.
type Feature ¶
type Feature int
Feature represents server side feature.
const ( FeatureBlockInfo Feature = 51903 FeatureTimezone Feature = 54058 FeatureQuotaKeyInClientInfo Feature = 54060 FeatureDisplayName Feature = 54372 FeatureVersionPatch Feature = 54401 FeatureTempTables Feature = 50264 FeatureServerLogs Feature = 54406 FeatureColumnDefaultsMetadata Feature = 54410 FeatureClientWriteInfo Feature = 54420 FeatureSettingsSerializedAsStrings Feature = 54429 FeatureInterServerSecret Feature = 54441 FeatureOpenTelemetry Feature = 54442 FeatureXForwardedForInClientInfo Feature = 54443 FeatureRefererInClientInfo Feature = 54447 FeatureDistributedDepth Feature = 54448 FeatureQueryStartTime Feature = 54449 FeatureProfileEvents Feature = 54451 )
Possible features.
func FeatureString ¶
FeatureString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Feature) IsAFeature ¶
IsAFeature returns "true" if the value is listed in the enum definition. "false" otherwise
type IPv4 ¶
type IPv4 uint32
IPv4 represents IPv4 address as uint32 number.
Not using netaddr.IP because uint32 is 5 times faster, consumes 6 times less memory and better represents IPv4.
Use ToIP helper for convenience.
type IPv6 ¶
type IPv6 [16]byte
IPv6 represents IPv6 address.
Same as FixedString(16) internally in ClickHouse.
type InferColumn ¶ added in v0.4.0
type InferColumn interface { Column Infer(t ColumnType) error }
InferColumn is Column that supports type inference.
type Input ¶
type Input []InputColumn
Input of query.
type InputColumn ¶
func (InputColumn) EncodeStart ¶
func (c InputColumn) EncodeStart(buf *Buffer)
type Int128 ¶
Int128 represents Int128 type.
func Int128FromUInt64 ¶
Int128FromUInt64 creates new Int128 from uint64.
type Int256 ¶ added in v0.2.0
Int256 is 256-bit signed integer.
func Int256FromInt ¶ added in v0.2.0
Int256FromInt creates new Int256 from int.
type Interface ¶
type Interface byte
Interface is interface of client.
func InterfaceString ¶
InterfaceString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func InterfaceValues ¶
func InterfaceValues() []Interface
InterfaceValues returns all values of the enum
func (Interface) IsAInterface ¶
IsAInterface returns "true" if the value is listed in the enum definition. "false" otherwise
type Log ¶ added in v0.16.0
type Log struct { Time time.Time Host string QueryID string ThreadID uint64 Priority int8 Source string Text string }
Log from server.
type Logs ¶ added in v0.16.0
type Logs struct { Time ColDateTime TimeMicro ColUInt32 HostName ColStr QueryID ColStr ThreadID ColUInt64 Priority ColInt8 Source ColStr Text ColStr }
Logs from ServerCodeLog packet.
type Precision ¶
type Precision byte
Precision of DateTime64.
Tick size (precision): 10^(-precision) seconds. Valid range: [0:9].
const ( // PrecisionSecond is one second precision. PrecisionSecond Precision = 0 // PrecisionMilli is millisecond precision. PrecisionMilli Precision = 3 // PrecisionMicro is microsecond precision. PrecisionMicro Precision = 6 // PrecisionNano is nanosecond precision. PrecisionNano Precision = 9 // PrecisionMax is maximum precision (nanosecond). PrecisionMax = PrecisionNano )
type Preparable ¶ added in v0.5.0
type Preparable interface {
Prepare() error
}
Preparable is Column that should be prepared before encoding or decoding.
type Profile ¶
type Profile struct { Rows uint64 Blocks uint64 Bytes uint64 AppliedLimit bool RowsBeforeLimit uint64 CalculatedRowsBeforeLimit bool }
func (Profile) EncodeAware ¶
type ProfileEvent ¶ added in v0.16.0
type ProfileEvent struct { ThreadID uint64 Host string Time time.Time Type ProfileEventType Name string Value int64 }
ProfileEvent is detailed profiling event from Server.
type ProfileEventType ¶ added in v0.16.0
type ProfileEventType byte
const ( ProfileIncrement ProfileEventType = 1 ProfileGauge ProfileEventType = 2 )
func ProfileEventTypeString ¶ added in v0.16.0
func ProfileEventTypeString(s string) (ProfileEventType, error)
ProfileEventTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ProfileEventTypeValues ¶ added in v0.16.0
func ProfileEventTypeValues() []ProfileEventType
ProfileEventTypeValues returns all values of the enum
func (ProfileEventType) IsAProfileEventType ¶ added in v0.16.0
func (i ProfileEventType) IsAProfileEventType() bool
IsAProfileEventType returns "true" if the value is listed in the enum definition. "false" otherwise
func (ProfileEventType) String ¶ added in v0.16.0
func (i ProfileEventType) String() string
type ProfileEvents ¶ added in v0.16.0
type ProfileEvents struct { Host ColStr Time ColDateTime ThreadID ColUInt64 Type ColInt8 Name ColStr Value ColAuto // UInt64 or Int64 depending on version }
ProfileEvents is data of ServerProfileEvents packet.
func (*ProfileEvents) All ¶ added in v0.16.0
func (d *ProfileEvents) All() ([]ProfileEvent, error)
func (*ProfileEvents) Result ¶ added in v0.16.0
func (d *ProfileEvents) Result() Results
type Progress ¶
type Progress struct { Rows uint64 Bytes uint64 TotalRows uint64 WroteRows uint64 WroteBytes uint64 }
Progress of query execution.
func (Progress) EncodeAware ¶
type Query ¶
type Query struct { ID string Body string Secret string Stage Stage Compression Compression Info ClientInfo Settings []Setting }
func (Query) EncodeAware ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements ClickHouse protocol decoding from buffered reader. Not goroutine-safe.
func (*Reader) DisableCompression ¶
func (r *Reader) DisableCompression()
DisableCompression makes next read use raw source of data.
func (*Reader) EnableCompression ¶
func (r *Reader) EnableCompression()
EnableCompression makes next reads use decompressed source of data.
type ResultColumn ¶
type ResultColumn struct { Name string // Name of column. Inferred if not provided. Data ColResult // Data of column, required. }
ResultColumn can be uses as part of Results or as single Result.
func AutoResult ¶ added in v0.4.0
func AutoResult(name string) ResultColumn
AutoResult is ResultColumn with type inference.
func (ResultColumn) DecodeResult ¶ added in v0.5.1
func (c ResultColumn) DecodeResult(r *Reader, b Block) error
DecodeResult implements Result as "single result" helper.
type Results ¶ added in v0.5.0
type Results []ResultColumn
Results wrap []ResultColumn to implement Result.
func (Results) DecodeResult ¶ added in v0.5.0
type ServerCode ¶
type ServerCode byte
ServerCode is sent by server to client.
const ( ServerCodeHello ServerCode = 0 // Server part of "handshake" ServerCodeData ServerCode = 1 // data block (can be compressed) ServerCodeException ServerCode = 2 // runtime exception ServerCodeProgress ServerCode = 3 // query execution progress (bytes, lines) ServerCodePong ServerCode = 4 // ping response (ClientPing) ServerCodeEndOfStream ServerCode = 5 // all packets were transmitted ServerCodeProfile ServerCode = 6 // profiling info ServerCodeTotals ServerCode = 7 // packet with total values (can be compressed) ServerCodeExtremes ServerCode = 8 // packet with minimums and maximums (can be compressed) ServerCodeTablesStatus ServerCode = 9 // response to TablesStatus ServerCodeLog ServerCode = 10 // query execution system log ServerCodeTableColumns ServerCode = 11 // columns description ServerPartUUIDs ServerCode = 12 // list of unique parts ids. ServerReadTaskRequest ServerCode = 13 // String (UUID) describes a request for which next task is needed ServerProfileEvents ServerCode = 14 // Packet with profile events from server )
Possible server codes.
func ServerCodeString ¶
func ServerCodeString(s string) (ServerCode, error)
ServerCodeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ServerCodeValues ¶
func ServerCodeValues() []ServerCode
ServerCodeValues returns all values of the enum
func (ServerCode) Compressible ¶
func (c ServerCode) Compressible() bool
Compressible reports whether message can be compressed.
func (ServerCode) IsAServerCode ¶
func (i ServerCode) IsAServerCode() bool
IsAServerCode returns "true" if the value is listed in the enum definition. "false" otherwise
func (ServerCode) String ¶
func (i ServerCode) String() string
type ServerHello ¶
type ServerHello struct { Name string Major int Minor int Revision int Timezone string DisplayName string Patch int }
ServerHello is answer to ClientHello and represents ServerCodeHello message.
func (*ServerHello) DecodeAware ¶
func (s *ServerHello) DecodeAware(r *Reader, v int) error
DecodeAware decodes ServerHello message from Reader.
func (*ServerHello) EncodeAware ¶
func (s *ServerHello) EncodeAware(b *Buffer, v int)
func (ServerHello) Features ¶
func (s ServerHello) Features() []Feature
Features implemented by server.
func (ServerHello) Has ¶
func (s ServerHello) Has(f Feature) bool
Has reports whether Feature is implemented.
func (ServerHello) String ¶
func (s ServerHello) String() string
type Stage ¶
type Stage byte
Stage of query till SELECT should be executed.
StageComplete is query complete.
func StageString ¶
StageString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
type TableColumns ¶
func (*TableColumns) DecodeAware ¶
func (c *TableColumns) DecodeAware(r *Reader, _ int) error
func (TableColumns) EncodeAware ¶
func (c TableColumns) EncodeAware(b *Buffer, _ int)
type UInt128 ¶
UInt128 represents UInt128 type.
func UInt128FromInt ¶
UInt128FromInt creates new UInt128 from int.
func UInt128FromUInt64 ¶
UInt128FromUInt64 creates new UInt128 from uint64.
type UInt256 ¶ added in v0.2.0
UInt256 is 256-bit unsigned integer.
func UInt256FromInt ¶ added in v0.2.0
UInt256FromInt creates new UInt256 from int.
func UInt256FromUInt64 ¶ added in v0.2.0
UInt256FromUInt64 creates new UInt256 from uint64.
Source Files ¶
- block.go
- bool.go
- buffer.go
- client_code.go
- client_code_enum.go
- client_data.go
- client_hello.go
- client_info.go
- client_info_interface_enum.go
- client_info_query_enum.go
- col_arr.go
- col_auto.go
- col_auto_gen.go
- col_bool.go
- col_bool_unsafe.go
- col_date32_gen.go
- col_date32_unsafe_gen.go
- col_date_gen.go
- col_date_unsafe_gen.go
- col_datetime64_gen.go
- col_datetime64_unsafe_gen.go
- col_datetime_gen.go
- col_datetime_unsafe_gen.go
- col_decimal128_gen.go
- col_decimal128_unsafe_gen.go
- col_decimal256_gen.go
- col_decimal256_unsafe_gen.go
- col_decimal32_gen.go
- col_decimal32_unsafe_gen.go
- col_decimal64_gen.go
- col_decimal64_unsafe_gen.go
- col_enum16_gen.go
- col_enum16_unsafe_gen.go
- col_enum8.go
- col_enum8_gen.go
- col_enum8_unsafe_gen.go
- col_fixed_str.go
- col_float32_gen.go
- col_float32_unsafe_gen.go
- col_float64_gen.go
- col_float64_unsafe_gen.go
- col_int128_gen.go
- col_int128_unsafe_gen.go
- col_int16_gen.go
- col_int16_unsafe_gen.go
- col_int256_gen.go
- col_int256_unsafe_gen.go
- col_int32_gen.go
- col_int32_unsafe_gen.go
- col_int64_gen.go
- col_int64_unsafe_gen.go
- col_int8_gen.go
- col_int8_unsafe_gen.go
- col_ipv4_gen.go
- col_ipv4_unsafe_gen.go
- col_ipv6_gen.go
- col_ipv6_unsafe_gen.go
- col_low_cardinality.go
- col_low_cardinality_enum.go
- col_map.go
- col_nullable.go
- col_raw.go
- col_str.go
- col_tuple.go
- col_uint128_gen.go
- col_uint128_unsafe_gen.go
- col_uint16_gen.go
- col_uint16_unsafe_gen.go
- col_uint256_gen.go
- col_uint256_unsafe_gen.go
- col_uint32_gen.go
- col_uint32_unsafe_gen.go
- col_uint64_gen.go
- col_uint64_unsafe_gen.go
- col_uint8_gen.go
- col_uint8_safe_gen.go
- col_uuid.go
- col_uuid_unsafe.go
- column.go
- compression.go
- compression_enum.go
- date.go
- date32.go
- datetime.go
- datetime64.go
- decimal.go
- enum16.go
- enum8.go
- error.go
- error_codes.go
- error_enum.go
- exception.go
- feature.go
- feature_enum.go
- gen.go
- int128.go
- int256.go
- ipv4.go
- ipv6.go
- profile.go
- profile_enum.go
- profile_events.go
- progress.go
- proto.go
- query.go
- reader.go
- server_code.go
- server_code_enum.go
- server_hello.go
- server_log.go
- slice_unsafe.go
- stage.go
- stage_enum.go
- table_columns.go