proto

package
v2.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 40

Documentation

Index

Constants

View Source
const (
	DBMS_MIN_REVISION_WITH_CLIENT_INFO                          = 54032
	DBMS_MIN_REVISION_WITH_SERVER_TIMEZONE                      = 54058
	DBMS_MIN_REVISION_WITH_QUOTA_KEY_IN_CLIENT_INFO             = 54060
	DBMS_MIN_REVISION_WITH_SERVER_DISPLAY_NAME                  = 54372
	DBMS_MIN_REVISION_WITH_VERSION_PATCH                        = 54401
	DBMS_MIN_REVISION_WITH_CLIENT_WRITE_INFO                    = 54420
	DBMS_MIN_REVISION_WITH_SETTINGS_SERIALIZED_AS_STRINGS       = 54429
	DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET                   = 54441
	DBMS_MIN_REVISION_WITH_OPENTELEMETRY                        = 54442
	DBMS_MIN_PROTOCOL_VERSION_WITH_DISTRIBUTED_DEPTH            = 54448
	DBMS_MIN_PROTOCOL_VERSION_WITH_INITIAL_QUERY_START_TIME     = 54449
	DBMS_MIN_PROTOCOL_VERSION_WITH_INCREMENTAL_PROFILE_EVENTS   = 54451
	DBMS_MIN_REVISION_WITH_PARALLEL_REPLICAS                    = 54453
	DBMS_MIN_REVISION_WITH_CUSTOM_SERIALIZATION                 = 54454
	DBMS_MIN_PROTOCOL_VERSION_WITH_ADDENDUM                     = 54458
	DBMS_MIN_PROTOCOL_VERSION_WITH_QUOTA_KEY                    = 54458
	DBMS_MIN_PROTOCOL_VERSION_WITH_PARAMETERS                   = 54459
	DBMS_MIN_PROTOCOL_VERSION_WITH_SERVER_QUERY_TIME_IN_PROGRES = 54460
	DBMS_TCP_PROTOCOL_VERSION                                   = DBMS_MIN_PROTOCOL_VERSION_WITH_SERVER_QUERY_TIME_IN_PROGRES
)

see https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Protocol.h

View Source
const (
	ClientHello  = 0
	ClientQuery  = 1
	ClientData   = 2
	ClientCancel = 3
	ClientPing   = 4
)
View Source
const (
	ClientQueryNone      = 0
	ClientQueryInitial   = 1
	ClientQuerySecondary = 2
)
View Source
const (
	CompressEnable  uint64 = 1
	CompressDisable uint64 = 0
)
View Source
const (
	ServerHello               = 0
	ServerData                = 1
	ServerException           = 2
	ServerProgress            = 3
	ServerPong                = 4
	ServerEndOfStream         = 5
	ServerProfileInfo         = 6
	ServerTotals              = 7
	ServerExtremes            = 8
	ServerTablesStatus        = 9
	ServerLog                 = 10
	ServerTableColumns        = 11
	ServerPartUUIDs           = 12
	ServerReadTaskRequest     = 13
	ServerProfileEvents       = 14
	ServerTreeReadTaskRequest = 15
)
View Source
const (
	StateComplete = 2
)

Variables

This section is empty.

Functions

func CheckMinVersion added in v2.4.0

func CheckMinVersion(constraint Version, version Version) bool

Types

type Block

type Block struct {
	Packet   byte
	Columns  []column.Interface
	Timezone *time.Location
	// contains filtered or unexported fields
}

func (*Block) AddColumn

func (b *Block) AddColumn(name string, ct column.Type) error

func (*Block) Append

func (b *Block) Append(v ...any) (err error)

func (*Block) ColumnsNames

func (b *Block) ColumnsNames() []string

func (*Block) Decode

func (b *Block) Decode(reader *proto.Reader, revision uint64) (err error)

func (*Block) Encode

func (b *Block) Encode(buffer *proto.Buffer, revision uint64) (err error)

func (*Block) EncodeColumn added in v2.5.0

func (b *Block) EncodeColumn(buffer *proto.Buffer, revision uint64, i int) (err error)

func (*Block) EncodeHeader added in v2.5.0

func (b *Block) EncodeHeader(buffer *proto.Buffer, revision uint64) (err error)

func (*Block) Reset added in v2.3.0

func (b *Block) Reset()

func (*Block) Rows

func (b *Block) Rows() int

func (*Block) SortColumns added in v2.4.0

func (b *Block) SortColumns(columns []string) error

SortColumns sorts our block according to the requested order - a slice of column names. Names must be identical in requested order and block.

type BlockError

type BlockError struct {
	Op         string
	Err        error
	ColumnName string
}

func (*BlockError) Error

func (e *BlockError) Error() string

type ClientHandshake

type ClientHandshake struct {
	ProtocolVersion uint64

	ClientName    string
	ClientVersion Version
}

func (ClientHandshake) Encode

func (h ClientHandshake) Encode(buffer *chproto.Buffer)

func (ClientHandshake) String

func (h ClientHandshake) String() string

type Exception

type Exception struct {
	Code       int32
	Name       string
	Message    string
	StackTrace string
	Nested     []Exception
	// contains filtered or unexported fields
}

func (*Exception) Decode

func (e *Exception) Decode(reader *proto.Reader) (err error)

func (*Exception) Error

func (e *Exception) Error() string

type Parameter added in v2.5.0

type Parameter struct {
	Key   string
	Value string
}

type Parameters added in v2.5.0

type Parameters []Parameter

func (Parameters) Encode added in v2.5.0

func (s Parameters) Encode(buffer *chproto.Buffer, revision uint64) error

type ProfileInfo

type ProfileInfo struct {
	Rows                      uint64
	Bytes                     uint64
	Blocks                    uint64
	AppliedLimit              bool
	RowsBeforeLimit           uint64
	CalculatedRowsBeforeLimit bool
}

func (*ProfileInfo) Decode

func (p *ProfileInfo) Decode(reader *chproto.Reader, revision uint64) (err error)

func (*ProfileInfo) String

func (p *ProfileInfo) String() string

type Progress

type Progress struct {
	Rows       uint64
	Bytes      uint64
	TotalRows  uint64
	WroteRows  uint64
	WroteBytes uint64
	Elapsed    time.Duration
	// contains filtered or unexported fields
}

func (*Progress) Decode

func (p *Progress) Decode(reader *chproto.Reader, revision uint64) (err error)

func (*Progress) String

func (p *Progress) String() string

type Query

type Query struct {
	ID                       string
	ClientName               string
	ClientVersion            Version
	ClientTCPProtocolVersion uint64
	Span                     trace.SpanContext
	Body                     string
	QuotaKey                 string
	Settings                 Settings
	Parameters               Parameters
	Compression              bool
	InitialUser              string
	InitialAddress           string
}

func (*Query) Encode

func (q *Query) Encode(buffer *chproto.Buffer, revision uint64) error

type ServerHandshake

type ServerHandshake struct {
	Name        string
	DisplayName string
	Revision    uint64
	Version     Version
	Timezone    *time.Location
}

func (*ServerHandshake) Decode

func (srv *ServerHandshake) Decode(reader *chproto.Reader) (err error)

func (ServerHandshake) String

func (srv ServerHandshake) String() string

type Setting

type Setting struct {
	Key       string
	Value     any
	Important bool
	Custom    bool
}

type Settings

type Settings []Setting

func (Settings) Encode

func (s Settings) Encode(buffer *chproto.Buffer, revision uint64) error

type TableColumns

type TableColumns struct {
	First  string
	Second string
}

func (*TableColumns) Decode

func (t *TableColumns) Decode(reader *chproto.Reader, revision uint64) (err error)

func (*TableColumns) String

func (t *TableColumns) String() string

type Version added in v2.4.0

type Version struct {
	Major uint64
	Minor uint64
	Patch uint64
}

func ParseVersion added in v2.4.0

func ParseVersion(v string) (ver Version)

func (Version) String added in v2.4.0

func (v Version) String() string

func (*Version) UnmarshalYAML added in v2.4.0

func (v *Version) UnmarshalYAML(value *yaml.Node) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL