Schemint

paste PostgreSQL or JSON, get your schema reviewed like a senior would

MySQL CREATE TABLE to TypeScript interface

Paste a CREATE TABLE, get a typed interface. Nothing you paste is stored.

Paste a MySQL CREATE TABLE (backticks, AUTO_INCREMENT, ENGINE= all fine) and get a TypeScript interface. TINYINT(1) comes out as boolean, DATETIME as a timestamp, nullable columns become optional, and you choose whether BIGINT and DECIMAL map to number or string.

It reads your real DDL, so names and types match the table you actually have. Runs on the server and is discarded after the response.

Try it on your own schema

Example

MySQL in:

CREATE TABLE `product` (
    `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    `sku` VARCHAR(40) NOT NULL,
    `name` VARCHAR(200) NOT NULL,
    `price` DECIMAL(12, 2) NOT NULL,
    `in_stock` TINYINT(1) NOT NULL DEFAULT 1,
    `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `uq_product_sku` (`sku`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Generated:

Product.ts

export interface Product {
  id: number;
  sku: string;
  name: string;
  price: number;
  inStock: boolean;
  createdAt: string;
}

Related