Pure Frontend · Auto Type Mapping · Index Generation · Relation Detection
Zero Dependencies · Works OfflineSQL to Go Ent ORM Converter is a pure frontend online tool for automatically converting SQL CREATE TABLE statements into Go Ent framework Schema definition code. Input SQL table definitions, and the tool automatically maps field types, generates field definitions, indexes, foreign key relations (Edges), enum types, etc., outputting standard Ent-compliant Go code. Supports multi-table batch conversion with automatic inter-table relation detection. All processing is done locally in your browser.
Step 1: Paste SQL CREATE TABLE statements in the input box.
Step 2: Select generation options (Edge relations, indexes, validators, package name).
Step 3: Click "Convert to Ent" or Ctrl+Enter to see the generated Go code.
Step 4: Click "Copy Code" or "Download" to export the result.
Generate Ent code from existing database Schema to quickly migrate traditional SQL projects to the Ent ORM framework.
Design data models with SQL first, then one-click generate Ent Schema to accelerate Go project development.
DBAs design table structures with SQL, developers one-click convert to Ent code, reducing manual conversion errors.
Convert SQL DDL to Ent Schema code as project documentation and code reference.
Ent is Facebook's open-source Go ORM framework that uses code generation. It defines data models through Schema and auto-generates CRUD code. Ent Schema uses a fluent API to define fields and relations, e.g. field.String("name").Default(""). Unlike reflection-based ORMs like GORM, Ent generates type-safe code at compile time for better performance. The core of SQL-to-Ent mapping is type conversion: SQL VARCHAR/CHAR→Ent String, INT/INTEGER→Ent Int, BIGINT→Ent Int64, BOOLEAN/BOOL→Ent Bool, TIMESTAMP/DATETIME→Ent Time, DECIMAL→Ent Float64, etc.
SQL to Ent conversion automatically transforms SQL CREATE TABLE statements into Go Ent ORM Schema definition code, including field type mapping, defaults, indexes, and foreign key relations.
Supports automatic mapping for INT/BIGINT/VARCHAR/TEXT/BOOLEAN/TIMESTAMP/DATE/DECIMAL/FLOAT/JSON/ENUM and other common SQL types.
Yes. The tool automatically identifies FOREIGN KEY constraints and generates Ent Edge relationship definitions.
Yes. SQL ENUM types are automatically converted to Ent enum field definitions and Go constants.
No. All SQL to Ent conversion is done locally in your browser. Your data is never uploaded.
The generated code follows standard Ent Schema format and can be used directly in Ent projects.