Paste your CREATE TABLE statements and get a TypeScript interface per table, with SQL types mapped to their closest TS equivalent and nullable columns typed as | null.
// Generated by ERD Factory - review relation/field names before use.
export interface Users {
id: number;
email: string;
full_name: string | null;
created_at: string | null;
last_login_at: string | null;
}
export interface Orders {
id: number;
user_id: number | null;
status: string;
total_cents: number;
currency: string | null;
placed_at: string | null;
shipped_at: string | null;
}
export interface OrderItems {
id: number;
order_id: number | null;
product_id: number;
quantity: number;
}
export interface Products {
id: number;
sku: string;
name: string;
price_cents: number;
inventory_count: number | null;
active: boolean | null;
}
export interface Payments {
id: number;
order_id: number | null;
amount_cents: number;
method: string;
processed_at: string | null;
}
export interface Sessions {
id: number;
token: string;
expires_at: string | null;
}
See these 6 tables as an interactive diagram, get AI-suggested fixes, and save your schema — free.
Open in the full editorPaste a schema and see your first analysis in under ten seconds.
Schema visualization & analysis for people who ship databases.