Type Mappings
| OmniQL | PostgreSQL | MySQL | MongoDB |
|---|---|---|---|
AUTO | SERIAL | INT AUTO_INCREMENT | ObjectId |
BIGAUTO | BIGSERIAL | BIGINT AUTO_INCREMENT | ObjectId |
INT | INTEGER | INT | Int32 |
BIGINT | BIGINT | BIGINT | Int64 |
SMALLINT | SMALLINT | SMALLINT | Int32 |
DECIMAL | DECIMAL | DECIMAL | Decimal128 |
NUMERIC | NUMERIC | DECIMAL | Decimal128 |
FLOAT | DOUBLE PRECISION | DOUBLE | Double |
REAL | REAL | FLOAT | Double |
STRING | VARCHAR | VARCHAR(255) | String |
TEXT | TEXT | TEXT | String |
CHAR | CHAR | CHAR | String |
BOOLEAN | BOOLEAN | BOOLEAN | Boolean |
BOOL | BOOLEAN | BOOLEAN | Boolean |
TIMESTAMP | TIMESTAMP | TIMESTAMP | Date |
DATETIME | TIMESTAMP | DATETIME | Date |
DATE | DATE | DATE | Date |
TIME | TIME | TIME | String |
JSON | JSON | JSON | Object |
JSONB | JSONB | JSON | Object |
UUID | UUID | CHAR(36) | UUID |
BINARY | BYTEA | BLOB | BinData |
BLOB | BYTEA | BLOB | BinData |
Numeric Types
AUTO
Auto-incrementing primary key.| Database | Output |
|---|---|
| PostgreSQL | CREATE TABLE users (id SERIAL PRIMARY KEY, name VARCHAR) |
| MySQL | CREATE TABLE users (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255)) |
BIGAUTO
Auto-incrementing for large tables.| Database | Output |
|---|---|
| PostgreSQL | id BIGSERIAL PRIMARY KEY |
| MySQL | id BIGINT AUTO_INCREMENT PRIMARY KEY |
INT
Standard integer (-2,147,483,648 to 2,147,483,647).BIGINT
Large integer for big numbers.SMALLINT
Small integer (-32,768 to 32,767).DECIMAL / NUMERIC
Exact numeric with precision.| Database | Output |
|---|---|
| PostgreSQL | price DECIMAL(10,2) |
| MySQL | price DECIMAL(10,2) |
FLOAT
Double-precision floating point.| Database | Output |
|---|---|
| PostgreSQL | temperature DOUBLE PRECISION |
| MySQL | temperature DOUBLE |
REAL
Single-precision floating point.| Database | Output |
|---|---|
| PostgreSQL | value REAL |
| MySQL | value FLOAT |
String Types
STRING
Variable-length string.| Database | Output |
|---|---|
| PostgreSQL | name VARCHAR or name VARCHAR(100) |
| MySQL | name VARCHAR(255) or name VARCHAR(100) |
TEXT
Unlimited length text.CHAR
Fixed-length string.Boolean Types
BOOLEAN / BOOL
True or false values.| Database | Output |
|---|---|
| PostgreSQL | active BOOLEAN |
| MySQL | active BOOLEAN |
| MongoDB | Boolean |
Boolean in Queries
Date and Time Types
TIMESTAMP
Date and time.| Database | Output |
|---|---|
| PostgreSQL | created_at TIMESTAMP |
| MySQL | created_at TIMESTAMP |
| MongoDB | Date |
DATETIME
Date and time (MySQL uses DATETIME, PostgreSQL uses TIMESTAMP).| Database | Output |
|---|---|
| PostgreSQL | event_time TIMESTAMP |
| MySQL | event_time DATETIME |
DATE
Date only (no time).TIME
Time only (no date).Date Literals in Queries
JSON Types
JSON
Standard JSON data.| Database | Output |
|---|---|
| PostgreSQL | metadata JSON |
| MySQL | metadata JSON |
| MongoDB | Object (native) |
JSONB
PostgreSQL optimized binary JSON.| Database | Output |
|---|---|
| PostgreSQL | metadata JSONB |
| MySQL | metadata JSON |
UUID Type
Universally unique identifier.| Database | Output |
|---|---|
| PostgreSQL | id UUID |
| MySQL | id CHAR(36) |
| MongoDB | UUID |
UUID in Queries
Binary Types
BINARY / BLOB
Binary data (files, images).| Database | Output |
|---|---|
| PostgreSQL | content BYTEA |
| MySQL | content BLOB |
| MongoDB | BinData |
Type with Constraints
Use colons to add constraints after the type:| Constraint | Syntax | Effect |
|---|---|---|
| Not Null | :NOTNULL | Column cannot be NULL |
| Unique | :UNIQUE | Values must be unique |
| Primary Key | :PRIMARYKEY | Column is primary key |
Type with Size
Specify size in parentheses:Limitations
Not currently supported:- DEFAULT values
- CHECK constraints
- Array types
- Type casting

