Datatypes
In Tql and TqlFlow you will come across multiple different datatypes.
DataType | Description |
---|---|
STRING |
This is used for Text/Characters. |
NUMERIC |
Used for Numbers, these can be Integers, Longs, or Floats. |
INTEGER |
This is used for non-decimal numbers and is a sub type of Numeric. |
BOOLEAN |
This can be true or false . |
DATE |
Used for Dates, Date Times and Times. |
LIST |
This is used for a List of values, the values can be any of the Datatypes. |
DOCUMENT |
This contains Key to Value mappings in a JSON Object. |
ANY¶
When the Datatype in the Documentation mentions ANY
, any of the below value types can be used:
String¶
This is used for Text/Characters.
String Literal:
'hello'
If you want to a single quote inside your string, you can use '
to escape:
'O''Brien'
which would read as O'Brien
In the Documentation if the placeholder value is <STRING-VALUE>
the value can be any of these:
- String Literal
- An Attribute with a Datatype of String
- A String Function.
Numeric¶
This is used for Integers, Floats and Longs. These data types can be represented as Literals and as Attributes.
NOTE: An Integer has its own Datatype information, this is because the Integer Datatype is a subtype of Numeric. An Integer type is within the Numeric datatype and so anywhere a Numeric value can be used an Integer value can be used, but if an Integer is required a Numeric value will need to be converted to an Integer.
These represent the value One with each Numeric Literal Types:
1 # Integer
1.0 # Float
1L # Long
Tql and TqlFlow have Numeric Functions for handling some basic math operations.
In the Documentation if the placeholder value is <NUMERIC-VALUE>
the value can be any of these:
- Numeric Literal
- An Attribute with a Datatype of Integer, Float, or Long
- A Numeric Function
INTEGER¶
This is a sub type of Numeric, a Value that has a type of Integer can be used whenever a Numeric is used, but if an Integer Type is required a Numeric will need to be converted to an Integer. We have specific Integer Functions, specifically the TOINT function converts a Numeric type value to an Integer type value.
Integer Literal:
1
In the Documentation if the placeholder value is <INTEGER-VALUE>
the value can be any of these:
- Integer Literal
- An Attribute with a Datatype of Integer
- An Integer Function.
Boolean¶
This is used for representing true or false values.
Boolean Literals:
true
false
In the Documentation if the placeholder value is <BOOLEAN-VALUE>
the value can be any of these:
- Boolean Literal
- An Attribute with a Datatype of Boolean
- A Conditional
Date¶
This is used for representing Dates and Times.
Date Literals:
Date('2020/01/01') # For a Date
Datetime('2020/01/01 00:00:00') # For a Datetime
Note These are literals and do differ from the Date Function DATEFROMSTRING
The Date Function section contains information on the functions that return Date type values.
In the Documentation if the placeholder value is <DATE-VALUE>
the value can be any of these:
- Date Literal
- An Attribute with a Datatype of Date
- A Date Function
List¶
This is for a list of values, the values in a list can be any of the Datatypes on this page.
List Literal:
['Hello', 'World', 'BurstIQ', 'Flow'] # List of Strings
[1, 2, 3, 4] # List of Integers
[true, true, false, true] # List of Boolean values
[Date(''), Date(''), Date(''), Date('')] # List of Dates
[{...}, {...}, {...}, {...}] # List of Documents
['Hello', 1, Date('01/01/01')] # List using multiple datatypes
In the List Functions section you will find information on working with Lists in Tql and TqlFlow. The functions in this Section return a value that is a List Type.
In the Documentation if the placeholder value is <LIST-VALUE>
the value can be any of these:
- List Literal
- An Attribute with a Datatype of List
- A List Function
Document¶
This is used for representing a Document or Object within the existing one you query, You are able to query against an attribute in a document and can expand these using certain Tql and TqlFlow Clauses.
For some examples on how Documents are used as Literals you can find examples in the Map and If Functionality.
For Sub-document creation this can be done in a Select Clause.