FAQ
Which SQL dialects are supported?
Standard CREATE TABLE syntax, with MySQL best supported. Table options such as engine and charset are ignored.
Are primary keys annotated?
Yes. The Java output adds an @Id annotation on the primary key field for use with JPA.
How are column types mapped?
Through the usual correspondences: varchar to String, int to Integer, datetime to Date. Review custom types manually after generating.
About this tool
Paste a CREATE TABLE statement and get a Java entity (with @Id), a C# class or a TypeScript interface. The class name is optional and otherwise derived from the table (user_info becomes UserInfo).
The hard part is splitting columns without breaking them. DDL is full of commas: decimal(10,2), enum('new','done'), COMMENT 'primary, auto increment', PRIMARY KEY (id, uid). A naive split on commas shreds those lines, losing the type, reducing a composite key to its first column and truncating comments. This tool splits by parenthesis depth and quote state, so all of the above parse correctly.
Both primary key styles are recognised: table level PRIMARY KEY (...) including composite keys, and inline `id` int PRIMARY KEY.
Type mapping traps worth knowing: tinyint(1) becomes boolean because MySQL uses it for booleans - but tinyint(4) does too, so if you store small integers there, change it back to Integer / number manually; bigint maps to Long in Java and number in TS (snowflake ids above 2^53 lose precision in TS, prefer string); decimal is BigDecimal in Java (never double - it loses precision) and number in TS; datetime / timestamp are LocalDateTime, DateTime and string (ISO) respectively. Unrecognised types fall back per language: String for Java and C#, string for TS.
Nullability in TypeScript is emitted as | null, not ?: a nullable column always exists with a value that may be null, whereas an optional property ? means the caller may omit it. Conflating the two is how front ends and back ends drift apart.
What it does not do: no getters or setters, no Lombok, no JPA annotations beyond @Id, no foreign keys or indexes, no ALTER TABLE. For full ORM mapping use an IDEA / MyBatis generator.