SQL to GORM

Convert SQL CREATE TABLE statements to Go GORM model structs.

Options
Package Name:

Input SQL (CREATE TABLE statement)

GORM Struct

// Generated struct will appear here...

About

Automatically convert SQL CREATE TABLE statements into Go GORM model structs. Supports custom tags and field mapping, significantly improving Go backend development efficiency.

Key Features

  • Automatic type mapping
  • CamelCase conversion
  • Custom GORM/JSON Tags
  • Supports common SQL types

How to use

  1. 1Enter or select the supported input.
  2. 2Choose the available settings and run the tool.
  3. 3Review the result, then copy or download it.

Example

Input

CREATE TABLE users (id BIGINT PRIMARY KEY, name VARCHAR(255));

Output

type Users struct {
    Id int64
    Name string
}

Limitations

  • The parser supports common CREATE TABLE columns and constraints. Review generated Go types, defaults, and tags before use.
  • Processing happens locally in your browser. Tool input is not uploaded to ToolHub.

Last reviewed:

Related Tools