SQL REFERENCE
Data Types
Teide supports numeric, string, boolean, and temporal data types.
Numeric Types
| SQL Type |
Aliases |
Storage |
Description |
| SMALLINT |
INT2 |
16-bit |
Small signed integer |
| INTEGER |
INT, INT4 |
32-bit |
Signed integer |
| BIGINT |
INT8, INT64 |
64-bit |
Large signed integer |
| REAL |
DOUBLE, FLOAT, DOUBLE PRECISION |
64-bit |
Floating-point number (maps to F64 internally, not F32) |
String Types
| SQL Type |
Aliases |
Storage |
Description |
| VARCHAR |
TEXT, STRING |
Variable |
UTF-8 text (stored as interned symbols) |
Boolean Type
| SQL Type |
Aliases |
Storage |
Description |
| BOOLEAN |
BOOL |
1-bit |
true or false |
Temporal Types
| SQL Type |
Aliases |
Storage |
Description |
| DATE |
|
32-bit |
Calendar date (days since 2000-01-01) |
| TIME |
|
32-bit |
Time of day (milliseconds since midnight) |
| TIMESTAMP |
|
64-bit |
Date and time (microseconds since 2000-01-01) |
Temporal Literal Formats
Temporal columns accept both string literals and raw integer values in INSERT statements:
| Type |
String Format |
Integer Meaning |
Example |
| DATE |
'YYYY-MM-DD' |
Days since 2000-01-01 |
'2025-01-15' or 9146 |
| TIME |
'HH:MM:SS[.mmm]' |
Milliseconds since midnight |
'12:30:00' or 45000000 |
| TIMESTAMP |
'YYYY-MM-DD HH:MM:SS[.ffffff]' |
Microseconds since 2000-01-01 |
'2025-01-15 09:30:00' |
CREATE TABLE events (id INTEGER, name VARCHAR, event_date DATE, event_time TIME);
INSERT INTO events VALUES (1, 'Launch', '2025-03-15', '09:00:00');
INSERT INTO events VALUES (2, 'Update', '2025-06-01', '14:30:00');
Type Casting
-- CAST syntax
SELECT CAST(42 AS REAL);
SELECT CAST(3.14 AS INTEGER);
-- Temporal CAST from string literals
SELECT CAST('2025-01-15' AS DATE);
SELECT CAST('12:30:00' AS TIME);
SELECT CAST('2025-01-15 09:30:00' AS TIMESTAMP);
-- PostgreSQL :: shorthand
SELECT 42::REAL;
NULL Representation
Teide uses type-specific sentinel values for NULL:
- Float columns: NaN
- Integer columns: 0
- VARCHAR columns: empty string