Skip to content
HALOWERK

Codewerk

mysql to pg plan

Parses MySQL DDL (mysqldump or SHOW CREATE TABLE output; backticks, inline and table-level keys, table options) with an own parser and maps every column by pgloader's documented default MySQL casting rules (PostgreSQL License, docs/ref/mysql.rst at commit 231ab86, 2026-09-14), using exact value ranges from the MySQL 8.4 and PostgreSQL 18 manuals where pgloader decides by display width (INT -> integer, INT UNSIGNED -> bigint, BIGINT UNSIGNED -> numeric(20,0), DECIMAL -> numeric(10,0).

POST https://code.halowerk.com/v1/mysql-to-pg-plan

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
mysql_ddlstringYesMySQL CREATE TABLE statements (other statements are skipped).
tinyint1_as_booleanbooleanNo
datetime_asstringNopgloader default is timestamptz.
enum_asstringNo
unsigned_checksbooleanNoAdd CHECK (col >= 0) for UNSIGNED columns.
identitystringNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "mysql_ddl"
  ],
  "properties": {
    "mysql_ddl": {
      "type": "string",
      "minLength": 10,
      "maxLength": 2000000,
      "description": "MySQL CREATE TABLE statements (other statements are skipped)."
    },
    "tinyint1_as_boolean": {
      "type": "boolean",
      "default": true
    },
    "datetime_as": {
      "type": "string",
      "enum": [
        "timestamptz",
        "timestamp"
      ],
      "default": "timestamptz",
      "description": "pgloader default is timestamptz."
    },
    "enum_as": {
      "type": "string",
      "enum": [
        "enum_type",
        "check"
      ],
      "default": "enum_type"
    },
    "unsigned_checks": {
      "type": "boolean",
      "default": true,
      "description": "Add CHECK (col >= 0) for UNSIGNED columns."
    },
    "identity": {
      "type": "string",
      "enum": [
        "identity",
        "serial"
      ],
      "default": "identity"
    }
  }
}

Open original schema

Published input example

{
  "mysql_ddl": "CREATE TABLE `users` (`id` int unsigned NOT NULL AUTO_INCREMENT, `email` varchar(191) NOT NULL, `is_active` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’