SQL to TypeScript
Convert SQL CREATE TABLE statements to TypeScript interfaces. Keep your types in sync with your database.
SQL to TypeScript Type Mapping:
INT/SERIAL → numberVARCHAR/TEXT → stringBOOLEAN → booleanTIMESTAMP → DateJSON/JSONB → RecordDECIMAL → numberUUID → stringBYTEA → BufferDatabase Type Safety - Détails techniques
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.
Alternative en ligne de commande
-- 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}