Type Mappings
sql-splitter handles 50+ data type mappings during conversion.
Numeric Types
Section titled “Numeric Types”| MySQL | PostgreSQL | SQLite | MSSQL |
|---|---|---|---|
TINYINT | SMALLINT | INTEGER | TINYINT |
SMALLINT | SMALLINT | INTEGER | SMALLINT |
MEDIUMINT | INTEGER | INTEGER | INT |
INT | INTEGER | INTEGER | INT |
BIGINT | BIGINT | INTEGER | BIGINT |
FLOAT | REAL | REAL | REAL |
DOUBLE | DOUBLE PRECISION | REAL | FLOAT |
DECIMAL(p,s) | DECIMAL(p,s) | REAL | DECIMAL(p,s) |
String Types
Section titled “String Types”| MySQL | PostgreSQL | SQLite | MSSQL |
|---|---|---|---|
CHAR(n) | CHAR(n) | TEXT | CHAR(n) |
VARCHAR(n) | VARCHAR(n) | TEXT | VARCHAR(n) |
TEXT | TEXT | TEXT | TEXT |
MEDIUMTEXT | TEXT | TEXT | NVARCHAR(MAX) |
LONGTEXT | TEXT | TEXT | NVARCHAR(MAX) |
CHAR, VARCHAR, and TEXT are valid MSSQL types and pass through unchanged.
Binary Types
Section titled “Binary Types”| MySQL | PostgreSQL | SQLite | MSSQL |
|---|---|---|---|
BINARY(n) | BYTEA | BLOB | BINARY(n) |
VARBINARY(n) | BYTEA | BLOB | VARBINARY(n) |
BLOB | BYTEA | BLOB | VARBINARY(MAX) |
MEDIUMBLOB | BYTEA | BLOB | VARBINARY(MAX) |
LONGBLOB | BYTEA | BLOB | VARBINARY(MAX) |
Date/Time Types
Section titled “Date/Time Types”| MySQL | PostgreSQL | SQLite | MSSQL |
|---|---|---|---|
DATE | DATE | TEXT | DATE |
TIME | TIME | TEXT | TIME |
DATETIME | TIMESTAMP | TEXT | DATETIME2 |
TIMESTAMP | TIMESTAMP | TEXT | TIMESTAMP |
MySQL YEAR and TIMESTAMP (for MSSQL targets) are not rewritten and pass through unchanged.
Boolean Types
Section titled “Boolean Types”| MySQL | PostgreSQL | SQLite | MSSQL |
|---|---|---|---|
TINYINT(1) | BOOLEAN | INTEGER | BIT |
The BOOL/BOOLEAN aliases are not rewritten—only the literal TINYINT(1) form is detected.
Auto-Increment
Section titled “Auto-Increment”| MySQL | PostgreSQL | SQLite | MSSQL |
|---|---|---|---|
INT AUTO_INCREMENT | SERIAL | INTEGER PRIMARY KEY | INT IDENTITY(1,1) |
BIGINT AUTO_INCREMENT | BIGSERIAL | INTEGER PRIMARY KEY | BIGINT IDENTITY(1,1) |
JSON Types
Section titled “JSON Types”| MySQL | PostgreSQL | SQLite | MSSQL |
|---|---|---|---|
JSON | JSONB | TEXT | NVARCHAR(MAX) |
Special Types
Section titled “Special Types”ENUM (MySQL)
Section titled “ENUM (MySQL)”MySQL ENUMs are converted to:
- PostgreSQL:
VARCHAR(255)(a warning suggests adding a CHECK constraint manually) - SQLite:
TEXT - MSSQL:
NVARCHAR(255)
UUID (PostgreSQL)
Section titled “UUID (PostgreSQL)”PostgreSQL UUID is converted to:
- MySQL:
VARCHAR(36) - SQLite:
TEXT - MSSQL:
UNIQUEIDENTIFIER
Arrays (PostgreSQL)
Section titled “Arrays (PostgreSQL)”PostgreSQL array types (e.g. integer[]) generate a warning but are not converted—they pass through unchanged. The warning suggests using JSON in the target dialect.
Unsupported Features
Section titled “Unsupported Features”These features generate warnings during conversion:
- Custom types (
CREATE TYPE) - skipped when converting from PostgreSQL - Triggers (
CREATE TRIGGER) - skipped when converting from PostgreSQL - Stored procedures and functions (
CREATE PROCEDURE/CREATE FUNCTION) - skipped when converting from PostgreSQL - Table inheritance (
INHERITS) - Partitioning (
PARTITION BY, when converting PostgreSQL to SQLite) - MySQL
UNSIGNED/ZEROFILLmodifiers (removed)
See Known Limitations for the full list of skipped and lossily rewritten constructs.