Skip to main content
Skip to main content
Edit this page

Basics

Note

Client protocol reference is in progress.

Most examples are only in Go.

This document describes binary protocol for ClickHouse TCP clients.

Varint​

For lengths, packet codes and other cases the unsigned varint encoding is used. Use binary.PutUvarint and binary.ReadUvarint.

Note

Signed varint is not used.

String​

Variable length strings are encoded as (length, value), where length is varint and value is utf8 string.

Info

Validate length to prevent OOM:

0 ≤ len < MAX

Integers​

Tip

ClickHouse uses Little Endian for fixed size integers.

Int32​

Boolean​

Booleans are represented by single byte, 1 is true and 0 is false.