How to use SQL → Go Struct
Paste your input on the left, choose the options you want, and the output appears instantly on the right. Everything runs in your browser — none of your data is sent to a server.
- Paste or type your input in the
INPUTpanel - The output regenerates automatically as you type
- Use
Copyto put the result in your clipboard - Click
Sampleto load a working example
What is SQL → Go Struct?
SQL → Go Struct parses a `CREATE TABLE` statement and emits a Go struct ready to paste into your repo. Type mappings follow common Go conventions: INT/BIGINT/SERIAL → int64; VARCHAR(n)/TEXT → string; BOOLEAN → bool; TIMESTAMP/TIMESTAMPTZ → time.Time (with auto-import); UUID → uuid.UUID (or string per toggle); DECIMAL → string for precision (or float64 per toggle); JSON/JSONB → json.RawMessage. NOT NULL columns map to value types; nullable columns map to pointer types so a missing value is unambiguously expressible. Pairs with our existing JSON → Go Struct, Go Struct Tag Builder, and SQL → JSON Schema tools. This tool is part of santekno's developer toolbox — a curated collection of utilities built for engineers who care about speed, privacy, and simplicity.
Common use cases
- Debugging API payloads and integration issues
- Inspecting tokens, hashes, or encoded strings during development
- Generating fixtures and sample data for tests
- Sharing readable output with teammates in code reviews