Skip to content
HALOWERK

Codewerk

ddl to erd

Parses DDL with node-sql-parser 5.4.0 (PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, Snowflake, T-SQL, Redshift grammars): CREATE TABLE with inline and table-level PRIMARY KEY, UNIQUE, REFERENCES and FOREIGN KEY, ALTER TABLE . ADD [CONSTRAINT] FOREIGN KEY and CREATE UNIQUE INDEX. Cardinality rules: a NOT NULL (or primary key) foreign key means exactly one parent (||), a nullable one zero or one (|o); a foreign key whose columns form the child's primary key or a unique key makes the.

POST https://code.halowerk.com/v1/ddl-to-erd

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
ddlstringYesSQL DDL with CREATE TABLE statements.
dialectstringNo
include_columnsbooleanNoRender attribute blocks (false = only entities and relationships).
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "ddl"
  ],
  "properties": {
    "ddl": {
      "type": "string",
      "minLength": 10,
      "maxLength": 500000,
      "description": "SQL DDL with CREATE TABLE statements."
    },
    "dialect": {
      "type": "string",
      "enum": [
        "postgres",
        "mysql",
        "mariadb",
        "sqlite",
        "bigquery",
        "snowflake",
        "transactsql",
        "redshift"
      ],
      "default": "postgres"
    },
    "include_columns": {
      "type": "boolean",
      "default": true,
      "description": "Render attribute blocks (false = only entities and relationships)."
    }
  }
}

Open original schema

Published input example

{
  "dialect": "postgres",
  "ddl": "CREATE TABLE customer (id SERIAL PRIMARY KEY, email VARCHAR(255) NOT NULL UNIQUE);\nCREATE TABLE orders (id BIGINT PRIMARY KEY, customer_id INT NOT NULL REFERENCES customer(id), total NUMERIC(10,2));"
}

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 โ†’