JSON to Language Struct / Class Generator
About SQL → TypeScript
The SQL `CREATE TABLE` to TypeScript Interface Converter parses PostgreSQL, MySQL, SQLite, and SQL Server table schemas into type-safe TypeScript interfaces with camelCase property mapping and nullable types.
How to Use SQL → TypeScript
Step 1
Paste your SQL `CREATE TABLE` statements into the editor.
Step 2
Select date mapping preference (`Date` object or ISO `string`).
Step 3
Toggle camelCase property conversion.
Step 4
Click "Copy TypeScript Interfaces".
Practical Use Cases for SQL → TypeScript
Full-Stack Database Entity Modeling in TypeScript
Convert raw SQL schema migrations into TypeScript interfaces for Kysely, Knex, Drizzle ORM, and pg-promise database queries.
Frontend API Data Contract Generation
Generate frontend TypeScript model interfaces directly from SQL database table dump files.
Input & Output Examples
Converting PostgreSQL CREATE TABLE to TypeScript
`CREATE TABLE users ( id SERIAL PRIMARY KEY, username VARCHAR(50) NOT NULL, bio TEXT, created_at TIMESTAMP DEFAULT NOW() );`
`export interface User {\n id: number;\n username: string;\n bio?: string | null;\n createdAt: Date;\n}`Key Features & Performance
- ✓Parses SQL dialects: PostgreSQL, MySQL, SQLite, SQL Server (T-SQL), and Oracle.
- ✓Smart type mapping: `INT`/`BIGINT` $\\rightarrow$ `number`, `VARCHAR`/`TEXT` $\\rightarrow$ `string`, `BOOLEAN` $\\rightarrow$ `boolean`, `TIMESTAMP` $\\rightarrow$ `Date` or `string`, `JSONB` $\\rightarrow$ `Record<string, any>`.
- ✓Detects `NOT NULL` constraints and marks nullable/defaulted columns as optional (`?`).
- ✓100% Client-Side memory execution.
- ✓1-Click Copy TypeScript code.
Key Terminology & Definitions
SQL DDL Parser
An AST compiler that tokenizes SQL Data Definition Language statements to extract column names, data types, and constraint rules.
Kysely / Drizzle Table Schema
Type-safe TypeScript query builder abstractions matching database table layouts 1-to-1.
