SQL DDL to Go (Golang) Struct Converter
BeanTrans converts MySQL, PostgreSQL, and SQLite CREATE TABLE statements into idiomatic Go structs with PascalCase field names and json struct tags completely in browser memory.
Key Capabilities
- Parses CREATE TABLE columns across MySQL, PostgreSQL, and SQLite into clean Go struct definitions.
- Converts snake_case SQL columns to exported Go field names while preserving json tags.
- Zero server upload—ideal for backend Go microservices using private schemas.
Type Mapping Reference
| Source | Target | Notes |
|---|---|---|
BIGINT / INT | int64 / int | Maps SQL integers |
VARCHAR / TEXT | string | Maps SQL strings |
DECIMAL / FLOAT | float64 | Maps numeric decimals |
BOOLEAN | bool | Maps boolean flags |
Frequently Asked Questions
Can BeanTrans parse PostgreSQL and MySQL CREATE TABLE syntax into Go structs?
Yes. The SQL DDL AST parser handles common MySQL, PostgreSQL, and SQLite column types, constraints, and quoted identifiers.
Can I also convert the same SQL DDL to Rust or TypeScript?
Yes. Keep your SQL on the left and switch the Target dropdown to Rust, TypeScript, Java, Python, Kotlin, Protobuf, or JSON.
Does BeanTrans store or log my SQL DDL?
No. All parsing happens locally inside your browser.