SQL Reference
Data types
The NYXDB type system — integers, decimals, floats, temporal, string/binary, containers, vector(N), and semantic types.
Type names are case-insensitive and ignore _, -, and spaces: int64,
Int64, and INT_64 all resolve to the same type. The canonical form is
lowercase; the display form is PascalCase.
Integers
| Type | Width | Aliases |
|---|---|---|
uint8 … uint256 | 8–256-bit unsigned | — |
int8 … int256 | 8–256-bit signed | int/integer (int32), bigint (int64) |
Widths: uint8, uint16, uint32, uint64, uint128, uint256; int8,
int16, int32, int64, int128, int256.
Floating point & decimal
| Type | Notes |
|---|---|
float32 | aliases float, real |
float64 | aliases double, double precision |
decimal(P[,S]) | precision 1–76; resolves to a sized decimal by precision |
decimal32(S) … decimal256(S) | fixed-width decimals, scale only |
Temporal
| Type | Notes |
|---|---|
date, date32 | day precision (date32 = extended range) |
datetime | second precision |
datetime64(precision[, 'TZ']) | sub-second, precision 0–9, optional timezone |
timestamp, duration | high-precision instant / interval |
CREATE TABLE ticks (
id UInt64,
ts DateTime64(9),
PRIMARY KEY (id)
);String & binary
| Type | Notes |
|---|---|
string | variable-length text; aliases varchar, text, char |
fixed_string(N) | fixed-length, N 1–1048576 |
bytes | binary; aliases binary, varbinary, blob |
uuid | 128-bit UUID; alias guid |
ipv4, ipv6 | IP addresses |
json | JSON-structured value |
bool | boolean; alias boolean |
Containers & wrappers
| Type | Notes |
|---|---|
array(T) | homogeneous array |
map(K, V) | key-value map |
tuple(T1, T2, …) | heterogeneous tuple |
nullable(T) | nullable wrapper |
low_cardinality(T) | dictionary-encoding hint |
CREATE TABLE arr_t (id Int64, tags array(String), nums array(Int64));Vector
vector(N[, element_type]) is a fixed-dimension dense numeric vector for
similarity search. N is 1–65535; element type is float32 (default) or
float64.
CREATE TABLE docs (id UInt64, embedding vector(768), PRIMARY KEY (id));See Indexes → vector search and the vector distance functions in Functions.
Semantic types
dynamic, variant, and object cover untyped / polymorphic / schema-less
values.