gorm-belongs-to

Community

Model one-to-one ownership with child-held keys.

Authorliurida
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The belongs-to pattern enables a child model to reference a single parent via a foreign key, establishing a clear ownership relationship in the data model.

Core Features & Use Cases

  • One-to-One Ownership: Place the foreign key on the child model and define the belongs-to association to the parent.
  • Flexible References: Use foreignKey and references tags to customize keys and referenced fields.
  • Eager Loading: Load the related parent efficiently using Preload or Joins.

Quick Start

Declare a foreign key on the child model and add a belongs-to association to the parent.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: gorm-belongs-to
Download link: https://github.com/liurida/gorm-development-skill/archive/main.zip#gorm-belongs-to

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.