gorm-associations

Manage GORM model associations with auto-save control and batch operations.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/liurida/gorm-development-skill --skill gorm-associations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gorm-associations
Source: https://github.com/liurida/gorm-development-skill/tree/main/associations
Command: npx skills add https://github.com/liurida/gorm-development-skill --skill gorm-associations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

GORM's association handling can be complex, leading to unexpected inserts, updates, or deletions when managing related records. This skill removes the guesswork by providing clear guidance on auto‑create/update, selective skipping, batch operations, and association mode commands.

Core Features & Use Cases

  • Auto Create/Update: Seamlessly save related records when creating or updating a model.
  • Selective Skipping: Use Select/Omit to control which associations are persisted.
  • Association Mode: Find, append, replace, delete, clear, and count related records programmatically.
  • Batch Handling: Operate on associations for multiple parent records in one call.
  • Association Tags Guidance: Define foreign keys, polymorphic relations, and join tables correctly.

Quick Start

Ask the assistant to manage a user's many‑to‑many language associations using GORM association mode.

Frequently Asked Questions about gorm-associations

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

FAQPage Schema
How do I prevent GORM from automatically creating or updating related records?

Use the Select or Omit methods to control which GORM associations are persisted, allowing you to selectively skip auto-saving related records during create or update operations.

What is GORM association mode and when should I use it?

GORM association mode provides explicit methods to find, append, replace, delete, clear, and count related records programmatically, offering manual control over associations without relying on auto-save behavior.

How do I handle GORM batch operations for multiple parent records?

GORM allows you to operate on associations for multiple parent records in one call, streamlining batch association updates across many structs in a single database transaction.

How do I configure many-to-many associations in GORM?

Configure many-to-many associations in GORM by using proper struct tags such as many2many, foreignKey, and references to accurately define join tables and polymorphic relations.

Why does GORM insert unexpected records when I update a model?

GORM inserts unexpected records because auto-create and auto-update are enabled by default for associations; you must use Select or Omit to skip saving specific related records during updates.