go-gorm-model

Generate Go structs with GORM tags from SQL table definitions.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/cristiano-pacheco/ai-tools --skill go-gorm-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-gorm-model
Source: https://github.com/cristiano-pacheco/ai-tools/tree/main/skills/go-gorm-model
Command: npx skills add https://github.com/cristiano-pacheco/ai-tools --skill go-gorm-model

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of database persistence models for Go applications using the GORM ORM, ensuring consistency and adherence to project conventions.

Core Features & Use Cases

  • Model Generation: Creates Go structs that map directly to database tables.
  • Convention Enforcement: Enforces specific naming, field types, and GORM tag usage.
  • Use Case: When developing a new feature that requires storing user profiles, use this Skill to generate the ProfileModel struct, including fields for BusinessName, WhatsAppPhone, and color codes, with appropriate GORM tags for defaults.

Quick Start

Generate a GORM model for a 'user' entity in the 'auth' module.

Frequently Asked Questions about go-gorm-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate GORM models from SQL tables in Go?

To generate GORM models from SQL tables, this Skill maps database tables directly to Go structs, enforcing specific naming conventions, GORM tags, and struct ordering within your project directory.

Can I use PostgreSQL-specific types like JSONB when creating GORM models?

Yes, you can use PostgreSQL-specific types like JSONB when creating GORM models, along with support for primary keys, foreign keys, indexes, unique constraints, and default values.

How does GORM handle nullable fields in generated Go structs?

GORM handles nullable fields in generated Go structs by utilizing pointer types, ensuring accurate database mapping and preventing zero-value confusion during persistence operations.

What is the best way to enforce naming and file location conventions for GORM models?

The best way to enforce naming and file location conventions for GORM models is using this Skill, which strictly structures generated files within the internal/modules/<module>/model/ directory path.

Does this GORM model generator support foreign keys and unique constraints?

Yes, this GORM model generator supports creating models with foreign keys and unique constraints, automatically applying the appropriate GORM tags to maintain database integrity.