PostgreSQL CREATE TABLE to TypeScript interface
Paste a PostgreSQL CREATE TABLE and get a matching TypeScript interface. Nullable columns map to optional properties, the primary key stays required, and you choose whether BIGINT and NUMERIC come out as number or string (JavaScript loses precision past 2^53, so string is the safe call for money and large ids).
It reads your real DDL, so the names, optionality and types match the table you actually have, not a guess. Runs on the server and is discarded after the response.
Example
CREATE TABLE product (
id BIGSERIAL PRIMARY KEY,
sku VARCHAR(40) UNIQUE NOT NULL,
name VARCHAR(200) NOT NULL,
price NUMERIC(12, 2) NOT NULL,
in_stock BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMP NOT NULL DEFAULT now()
);
export interface Product {
id: number;
sku: string;
name: string;
price: number;
inStock: boolean;
createdAt: string;
}