Skip to content
Logo of XTDB

XTDB Data Types

XTDB data types are implemented using Apache Arrow.

Scalar Types

XTDB Type Arrow Vector Type Description SQL Example Datalog Example

BIGINT

BigIntVector

64-bit Signed Integer

9223372036854775807
9223372036854775807

BOOLEAN

BitVector

3-Value Boolean: true (1), false (0), or null

TRUE
true

DATE

DateDayVector

Date Without Time

DATE '2007-06-29'
#inst "2007-06-29"

DOUBLE

Float8Vector

64-bit Floating Point Number

1.0
1.0

FLOAT

Float4Vector

32-bit Floating Point Number

1.0
1.0

INTEGER

IntVector

32-bit Signed Integer

2147483647
2147483647

INTERVAL

IntervalDayVector

Day/Time Interval

INTERVAL '163 12'
DAY TO HOUR
;; TBD

INTERVAL

IntervalYearVector

Year/Month Interval

INTERVAL '163-11'
YEAR TO MONTH
;;TODO

PERIOD

<a pair of TIMESTAMPs>

Time Period (for use in Temporal Predicates; not usable as a column type)

PERIOD(
DATE '1998-01-05',
DATE '1998-01-12')
;; TBD

SMALLINT

SmallIntVector

16-bit Signed Integer

32767
32767

TIMESTAMP
[WITHOUT
TIMEZONE]

TimeStampMicroVector

Timestamp without a Timezone offset

TIMESTAMP
'2007-06-29
 16:00:00'
#inst "2007-06-29T16:00:00"

TIMESTAMP
WITH
TIMEZONE

TimeStampMicroTZVector

Timestamp with a Timezone offset

TIMESTAMP
'2007-06-29
 16:00:00+04:00'
;; TBD

TIME
[WITHOUT
TIMEZONE]

TimeNanoVector

Time of day with nanosecond precision

TIME '22:15:04.1237'
;; TBD

UUID

UuidVector *

Universally Unique Identifier

'97a392d5-5e3f-406f-9651-a828ee79b156'
;; TBD

URI

UriVector *

Universal Resource Identifier

'https://xtdb.com'
;; TBD

VARBINARY

VarBinaryVector

Variable-Length Binary String (Byte Array)

0x41424344
;; TBD

VARCHAR

VarCharVector

Variable-Length String with UTF8 character encoding

'Hello'
"Hello"

KEYWORD

TBD

EDN Keyword

-- TBD
:my.namespace/hello
Note
The types marked with an asterisk (UuidVector, UriVector) are Apache Arrow extension types.

Collection Types

XTDB supports arbitrarily nested data.

XTDB Type Arrow Vector Type Description SQL Example Datalog Example

ARRAY

ListVector

Array/List/Vector of Values

[1, 2, 3]
[1 2 3]

OBJECT

StructVector

Object/Struct/Map of key-value pairs

{'name':'Lucy',
 'age':'38'}
{:name 'Lucy'
 :age '38'}

SET

Arrow extension type

Set of distinct, unordered values

-- TBD
#{"Lucy" "38"}