gormt
Gormt is a command-line and GUI tool that automatically generates Go structs from MySQL database tables. It integrates with GORM to produce type-safe, annotated Go models with support for foreign keys, indexes, and custom field mappings.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | xxjwxc/gormt |
| Owner | xxjwxc |
| Primary language | Go |
| License | MIT — OSI-approved |
| Stars | 2.4k |
| Forks | 361 |
| Open issues | 58 |
| Latest release | v2.1.gorm (2021-06-27) |
| Last updated | 2026-04-24 |
| Source | https://github.com/xxjwxc/gormt |
What gormt is
Gormt connects to MySQL (SQLite, MSSQL) databases, introspects table schemas, and generates Go struct definitions with GORM tags, JSON annotations, and optional helper functions. It supports configuration via YAML or CLI flags and produces models with primary keys, unique constraints, indexes, and association metadata.
Get the gormt source
Clone the repository and explore it locally.
git clone https://github.com/xxjwxc/gormt.gitcd gormt# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Database connection credentials must be stored securely (environment variables, vaults); do not commit plaintext config.yml.
- Generated functions are GORM wrapper helpers; review foreign key and association logic before deploying to production.
- Column comments using special syntax ([@gorm], [@fk]) must be pre-added to schema to enable advanced features in output.
- Output can be single file or split by table name; choose strategy based on project package structure and team conventions.
- Type mapping for database types (datetime, date, etc.) is customizable; verify default mappings match application needs.
When to avoid it — and what to weigh
- PostgreSQL or NoSQL primary use — Gormt is MySQL-focused. PostgreSQL and NoSQL (MongoDB, DynamoDB) support are not described in the data provided.
- Highly dynamic or schema-less databases — Tools designed for schemaless data or frequent schema changes may be more appropriate than a code-generation approach.
- Complex custom type mappings at scale — While custom type definitions are supported, extensive type-system customization may require post-generation refactoring.
- Zero tolerance for generated code review — Generated structs require human review before production use to verify constraints, tags, and business logic alignment.
License & commercial use
Gormt is licensed under the MIT License, which is a permissive OSI-approved license allowing commercial use, modification, and distribution with minimal restrictions.
MIT License permits commercial use without restrictions. No proprietary claims or royalty obligations. However, the tool is provided as-is with no warranties; users assume liability for generated code quality and compliance with their database schemas.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Gormt connects to live databases using supplied credentials; implement credential rotation and restrict tool access. Generated code contains no hardcoded secrets but must be reviewed for injection vulnerabilities, especially in auto-generated query functions. Validate foreign key constraints to prevent unauthorized data access.
Alternatives to consider
GORM gen (official GORM code generation)
First-party GORM tooling; likely more closely aligned with GORM API evolution and supported versions.
sqlc
Language-agnostic SQL-first code generator producing type-safe query results; better for complex SQL and cross-database compatibility.
sqlalchemy (Python) or Sequelize (Node.js)
If cross-language code generation or non-Go ecosystems are required; not applicable to pure Go projects.
Build on gormt with DEV.co software developers
Gormt eliminates manual struct boilerplate. Connect your database, generate code, and focus on business logic. Works with GORM v1/v2 and supports MySQL, SQLite, and MSSQL.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
gormt FAQ
Does Gormt work with PostgreSQL or MongoDB?
Can I regenerate models without overwriting manual edits?
What GORM versions are supported?
How do I automate model regeneration in CI/CD?
Software developers & web developers for hire
Need help beyond evaluating gormt? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.
Ready to speed up your Go backend development?
Gormt eliminates manual struct boilerplate. Connect your database, generate code, and focus on business logic. Works with GORM v1/v2 and supports MySQL, SQLite, and MSSQL.