Skip to main content

Data Types

StackQL data types are used to represent values for input or output fields (properties or parameters) used within cloud resources. StackQL data types are listed in the table below:

StackQL typeDescriptionExample
stringsequence of Unicode characters enclosed by single quotes'mybucket'
arrayordered collection of values, surrounded by brackets [ ], separated by a comma[0,1,2]
objectunordered set of zero or more name/value pairs inserted between { } and separated by a comma{"name": "mydb"}
booleantrue or false, boolean values are not surrounded within quotes and will be treated as string valuestrue
integera whole number that can be positive, negative, or zero2
doubledouble-precision floating-point number, can be positive or negative0.95


StackQL data types map to the data types exposed in the APIs for all major cloud providers.

Type Conversion​

CAST(expression AS type) and CONVERT(expression, type) convert a value to another type. In addition to the conversion types inherited from the MySQL grammar (CHAR, DATE, DATETIME, DECIMAL, SIGNED, UNSIGNED, TIME, JSON), StackQL v1.0 and later accept TEXT, INTEGER, INT, BIGINT, BOOLEAN and BOOL. The conversion is performed by the SQL backend, so its semantics are those of SQLite or PostgreSQL. Conversions are commonly used to compare a typed session variable with a string column:

SET some_id = 42;

SELECT CAST($some_id AS TEXT) AS id_text,
CONVERT($some_id, TEXT) || '-east' AS label;

Boolean fields served by XML providers such as AWS are reported as true and false; StackQL releases before v1.0 reported them as 0 and 1.