Skip to content

XTDB Data Types

XTDB data types are implemented using Apache Arrow.

Scalar Types

XTDB Type Description SQL Example Clojure Example

BIGINT

64-bit Signed Integer

9223372036854775807

9223372036854775807

BOOLEAN

3-Value Boolean: true, false, or null

TRUE

true

DATE

Date Without Time

DATE '2007-06-29'

#time/date "2007-06-29"

DOUBLE

64-bit Floating Point Number

1.0

1.0

FLOAT

32-bit Floating Point Number

1.0

1.0

INTEGER

32-bit Signed Integer

2147483647

2147483647

INTERVAL

Month-Day-Nano Interval

INTERVAL '163 12:00:00' DAY TO SECOND

#xt/interval-mdn ["P163D" "PT12H"]

INTERVAL

Year-Month Interval

INTERVAL '12-11' YEAR TO MONTH

#xt/interval-ym "P12Y11M"

PERIOD

<a pair of TIMESTAMPs>

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

(period #time/date "1998-01-05" #time/date "1998-01-12")

SMALLINT

16-bit Signed Integer

32767

32767

TIMESTAMP
[WITHOUT
TIMEZONE]

Timestamp without a Timezone offset

TIMESTAMP '16:00:00'

#time/date-time "2007-06-29T16:00:00"

TIMESTAMP
WITH
TIMEZONE

Timestamp with a Timezone offset

TIMESTAMP '16:00:00+04:00'

#time/zoned-date-time "2007-06-29T16:00:00+04:00"

TIME
[WITHOUT
TIMEZONE]

Time of day with nanosecond precision

TIME '22:15:04.1237'

#time/time "22:15:04.1237"

UUID

Universally Unique Identifier

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

#uuid "97a392d5-5e3f-406f-9651-a828ee79b156"

URI

Universal Resource Identifier

'https://xtdb.com'

TBD

VARBINARY

Variable-Length Binary String (Byte Array)

0x41424344

TBD

VARCHAR

Variable-Length String with UTF8 character encoding

'Hello'

"Hello"

KEYWORD

EDN Keyword

-- TBD

:keyword

DURATION

Duration of time

DURATION 'PT1H3M5S'

#time/duration "PT1H3M5S"

Collection Types

XTDB supports arbitrarily nested data.

XTDB Type Description SQL Example Clojure Example

ARRAY

Array/List/Vector of Values

[1, 2, 3]

[1 2 3]

OBJECT

Object/Struct/Map of key-value pairs

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

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

SET

Set of distinct, unordered values

TBD

#{"Lucy" "38"}