Skip to content

Data types ​

A column's data type defines which values it accepts and how they are converted, compared and returned. CoordinatorDB provides checked native numeric, temporal, collection and domain types alongside legacy SQL affinity declarations.

Type names ignore case: UInt8 and uint8 mean the same eight-bit unsigned type. Parameter values, field names, JSON paths and Enum labels follow their individual contracts.

Choosing a type ​

Data Types
Whole numbers and counters Int8 through Int256; UInt8 through UInt256.
Exact decimal amounts Decimal(P, S), including NUMERIC(P, S).
Approximate measurements Float32, Float64, BFloat16.
Text and fixed-width bytes String, VARCHAR(n), FixedString(n).
Flags and fixed vocabularies Bool, Enum8, Enum16.
Calendar dates and timestamps Date, Date32, DateTime, DateTime64.
Date-independent clocks and durations Time, Time64, Interval.
Repeated or structured values Array, Tuple, Map, Nested, JSON.
Alternative or varying value types Variant, Dynamic.
Identifiers and addresses UUID, IPv4, IPv6, inet, cidr.
Spatial values and numeric vectors Geometry aliases and QBit.
Partial aggregate results AggregateFunction, SimpleAggregateFunction.
Full-text search values tsvector, tsquery.

Use the IP address functions for inet/cidr, and search functions for tsvector/tsquery.

Declaring and converting values ​

Native declarations validate inserts, updates, defaults, generated values and explicit casts. The same range and shape rules apply wherever a value enters the declared type.

sql
CREATE TABLE products
(
    id UInt32 PRIMARY KEY,
    name String NOT NULL,
    price Decimal(18, 2),
    tags Array(String)
);
INSERT INTO products VALUES (1, 'Notebook', '12.50', '["paper","office"]');
sql
SELECT id, name, price, array_length(tags) AS tag_count
FROM products
FORMAT csv;
text
1,"Notebook",12.50,2

Use CAST(expression AS Type) to convert explicitly, and to_type_name to inspect a native value's type. Individual type pages describe accepted inputs and conversion errors.

NULL values ​

Top-level columns permit SQL NULL unless declared NOT NULL. Inside typed collections, use Nullable(T) for members that can be missing. A top-level Array(UInt8) column can therefore be NULL, but its non-NULL arrays cannot contain NULL elements.

Legacy declarations ​

INTEGER, REAL, TEXT and BLOB follow SQLite-style affinity. NUMERIC is an exact Decimal declaration, defaulting to Decimal(10, 0); use LEGACY_NUMERIC for SQLite numeric affinity.

STRICT tables enforce their allowed value classes; ANY preserves a supplied value's class. A ClickHouse table ENGINE clause is not required or supported.

Type reference ​