Skip to main content

Module types

Module types 

Source
Expand description

ClickHouse type system and type string parser.

§ClickHouse Type System

This module implements the ClickHouse type system for the native TCP protocol.

§ClickHouse Documentation References

§Numeric Types

§String Types

§Date and Time Types

§Compound Types

  • Array - Arrays of elements
  • Tuple - Fixed-size collections
  • Map - Key-value pairs

§Special Types

§Geo Types

§Type Nesting Rules

ClickHouse enforces strict type nesting rules (Error code 43: ILLEGAL_TYPE_OF_ARGUMENT):

✅ Allowed:

  • Array(Nullable(T)) - Array where each element can be NULL
  • LowCardinality(Nullable(T)) - Dictionary-encoded nullable values
  • Array(LowCardinality(T)) - Array of dictionary-encoded values
  • Array(LowCardinality(Nullable(T))) - Combination of all three

❌ NOT Allowed:

  • Nullable(Array(T)) - Arrays themselves cannot be NULL (use empty array instead)
  • Nullable(LowCardinality(T)) - Wrong nesting order
  • Nullable(Nullable(T)) - Double-nullable is invalid

For more details, see the column module documentation.

Structs§

EnumItem
Enum item for Enum8/Enum16 types, mapping a name to its integer value.
TypeAst
Abstract Syntax Tree for a type definition Mirrors C++ struct TypeAst

Enums§

Type
ClickHouse type definition, representing both simple and parametric types.
TypeCode
Type code enumeration matching ClickHouse types
TypeMeta
TypeAst meta-type classification Mirrors C++ TypeAst::Meta

Traits§

ToType
Trait for mapping Rust primitive types to ClickHouse types Equivalent to C++ Type::CreateSimple<T>() template specializations

Functions§

parse_type_name
Parse a type name and return cached AST Mirrors C++ const TypeAst* ParseTypeName(const std::string& type_name)

Type Aliases§

TypeRef
Reference-counted shared pointer to a Type.