Data Types
The supported column data types in Jethro are:
- INTEGER - 32-bit integers
- BIGINT - 64-bit integers
- FLOAT - 32-bit floating point
- DOUBLE - 64-bit floating point
STRING - Stores string values of up to 4KB. Replaces char() and varchar() data types in other databases.
TIMESTAMP - Includes both a date part (year+month+day) and a time part (hour+minute+second +optional sub-second, up to 6 digits). Valid values are between '1400-01-01 00:00:00' and '9999-12-31 23:59:59'.
Info
- String processing assumes that the data is in ASCII format. Although Unicode data is allowed to be stored inside string columns (UTF-8), no special Unicode handling is currently implemented.
- To specify a string literal in SQL, use double single quotes. For example: 'abc'.
- For timestamp literals (constant) in SQL, there is an implicit casting from three string formats to timestamp:
'yyyy-MM-dd'
'yyyy-MM-dd HH:mm:ss'
'yyyy-MM-dd HH:mm:ss.SSS...' (1 to 6 digits)
For example: '2014-02-25 13:14:15.250' - To convert between data types, you can use the explicit casting operator :: or the cast() function
Tip
Always store data using the most appropriate data type for the columns' range of possible values.
For example:
- Don't store numbers as strings.
- Don't store timestamps as strings or numbers (unless the range of values doesn't fit between the years 1400-9999).