Data Types
Data types define the kind of values that can be stored and manipulated within a query. They are essential for structuring data correctly, ensuring type safety, and enabling reliable computations. In DQL, data types influence how values are interpreted in expressions, how comparisons are evaluated, and how results are computed or aggregated.
DQL supports a range of SQL-like data types, including numeric, textual, temporal, and structured formats. Using the right data types improves query performance, accuracy, and consistency across datasets. They help ensure that operations such as arithmetic, string manipulation, and filtering behave as expected throughout the query pipeline.
Type Casting
To convert values between types (e.g., for precision or compatibility).
Example: $cast "age" to DECIMAL(10,2)- JSON
- SQL
{
"$cast": "DECIMAL(10,2)",
"$identifier": "age"
}
CAST(age AS DECIMAL(10,2))
This shorter form places the type annotation directly on the expression.
- JSON
- SQL
{
"$identifier": "age",
"$shortCast": [ "DECIMAL(10,2)" ]
}
age::DECIMAL(10,2)
BIGINT
Added in: indicate.dsl.dql@1.0.0
Aliases: INT8, LONG
A signed eight-byte integer data type.
BIT
Added in: indicate.dsl.dql@1.0.0
Aliases: BITSTRING
A string of 1s and 0s.
BLOB
Added in: indicate.dsl.dql@1.0.0
Aliases: BINARY, VARBINARY, BYTEA
Variable-length binary data.
BOOLEAN
Added in: indicate.dsl.dql@1.0.0
Aliases: BOOL, LOGICAL
A logical Boolean data type (TRUE / FALSE).
DATE
Added in: indicate.dsl.dql@1.0.0
A calendar date data type (year, month, day).
DECIMAL
Added in: indicate.dsl.dql@1.0.0
Aliases: NUMERIC
A fixed-precision number data type. Can take precision and scale: DECIMAL(precision, scale). Defaults to precision = 18 and scale = 3 if unspecified.
DOUBLE
Added in: indicate.dsl.dql@1.0.0
Aliases: FLOAT8
A double precision floating-point number (8 bytes).
FLOAT
Added in: indicate.dsl.dql@1.0.0
Aliases: FLOAT4, REAL
A single precision floating-point number (4 bytes).
HUGEINT
Added in: indicate.dsl.dql@1.0.0
A signed sixteen-byte integer data type.
INTEGER
Added in: indicate.dsl.dql@1.0.0
Aliases: INT, INT4, SIGNED
A signed four-byte integer data type.
INTERVAL
Added in: indicate.dsl.dql@1.0.0
A date / time delta data type.
JSON
Added in: indicate.dsl.dql@1.0.0
A JSON data type.
JSONB
Added in: indicate.dsl.dql@1.0.0
A binary JSON data type.
SMALLINT
Added in: indicate.dsl.dql@1.0.0
Aliases: INT2, SHORT
A signed two-byte integer data type.
TIME
Added in: indicate.dsl.dql@1.0.0
A time of day data type (no time zone).
TIMESTAMPTZ
Added in: indicate.dsl.dql@1.0.0
A date and time with time zone data type.
TIMESTAMP
Added in: indicate.dsl.dql@1.0.0
Aliases: DATETIME
A date and time data type (no time zone).
TINYINT
Added in: indicate.dsl.dql@1.0.0
Aliases: INT1
A signed one-byte integer data type.
UBIGINT
Added in: indicate.dsl.dql@1.0.0
An unsigned eight-byte integer data type.
UHUGEINT
Added in: indicate.dsl.dql@1.0.0
An unsigned sixteen-byte integer data type.
UINTEGER
Added in: indicate.dsl.dql@1.0.0
An unsigned four-byte integer data type.
USMALLINT
Added in: indicate.dsl.dql@1.0.0
An unsigned two-byte integer data type.
UTINYINT
Added in: indicate.dsl.dql@1.0.0
An unsigned one-byte integer data type.
UUID
Added in: indicate.dsl.dql@1.0.0
A UUID (Universally Unique Identifier) data type.
VARCHAR
Added in: indicate.dsl.dql@1.0.0
Aliases: STRING
A variable-length character string data type.
TEXT
Added in: indicate.dsl.dql@1.0.0
A variable-length character string data type (unlimited length).
CHAR
Added in: indicate.dsl.dql@1.0.0
Aliases: BPCHAR
A fixed-length character string data type.
ARRAY
Added in: indicate.dsl.dql@1.0.0
An ordered, fixed-length sequence of data values of the same type.
LIST
Added in: indicate.dsl.dql@1.0.0
An ordered, fixed-length sequence of data values of the same type.