SQL to TypeScript
Convert SQL CREATE TABLE statements to TypeScript interfaces. Keep your types in sync with your database.
SQL CREATE TABLE Statements0 chars
TypeScript Types
Result appears here
SQL to TypeScript Type Mapping:
INT/SERIAL → numberVARCHAR/TEXT → stringBOOLEAN → booleanTIMESTAMP → DateJSON/JSONB → RecordDECIMAL → numberUUID → stringBYTEA → BufferDatabase Type Safety - Detalles técnicos
Generating TypeScript types from SQL schemas ensures your application code matches your database structure. Column types are mapped to TypeScript equivalents, and NULL columns become optional properties.
Alternativa de línea de comandos
-- SQL\nCREATE TABLE users (\n id SERIAL PRIMARY KEY,\n email VARCHAR(255) NOT NULL\n);\n\n// TypeScript\ninterface Users {\n id: number;\n email: string;\n}