DB
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

TypeWidthAliases
uint8uint2568–256-bit unsigned
int8int2568–256-bit signedint/integer (int32), bigint (int64)

Widths: uint8, uint16, uint32, uint64, uint128, uint256; int8, int16, int32, int64, int128, int256.

Floating point & decimal

TypeNotes
float32aliases float, real
float64aliases 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

TypeNotes
date, date32day precision (date32 = extended range)
datetimesecond precision
datetime64(precision[, 'TZ'])sub-second, precision 0–9, optional timezone
timestamp, durationhigh-precision instant / interval
CREATE TABLE ticks (
  id UInt64,
  ts DateTime64(9),
  PRIMARY KEY (id)
);

String & binary

TypeNotes
stringvariable-length text; aliases varchar, text, char
fixed_string(N)fixed-length, N 1–1048576
bytesbinary; aliases binary, varbinary, blob
uuid128-bit UUID; alias guid
ipv4, ipv6IP addresses
jsonJSON-structured value
boolboolean; alias boolean

Containers & wrappers

TypeNotes
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.

On this page