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 / INTint64 / intMaps SQL integers
VARCHAR / TEXTstringMaps SQL strings
DECIMAL / FLOATfloat64Maps numeric decimals
BOOLEANboolMaps 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.