SQL to TypeScript Converter
Generate TypeScript interfaces from SQL CREATE TABLE statements. AI-powered with smart type mapping, relation inference, and Prisma/Drizzle support.
How It Works
Paste Your SQL
Paste CREATE TABLE statements from PostgreSQL, MySQL, or SQLite. The editor provides real-time syntax highlighting and instant preview.
Click Convert
Our AI analyzes your schema, maps SQL types to TypeScript, detects foreign key relations, and generates precise interfaces or Prisma/Drizzle schemas.
Copy & Use
Copy the generated TypeScript types or download as a .ts file. Drop them into your project for instant type-safe database access.
Why Use This Tool
Type-Safe Database Access
Generated interfaces ensure your queries return exactly the types you expect catch schema mismatches at compile time, not in production.
Relation Inference
AI detects REFERENCES and FOREIGN KEY constraints, adding typed relation comments so you know how your tables connect.
Prisma & Drizzle Support
Beyond TypeScript interfaces, generate Prisma schema models or Drizzle ORM table definitions directly from your SQL.
Instant AST Preview
See TypeScript types update in real-time as you type SQL, powered by a regex-based parser that runs entirely in your browser.