gorm-update

Community

Update GORM records safely and efficiently.

Authorliurida
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Updating records with GORM can be error‑prone: accidental global updates, missing where clauses, zero‑value fields being ignored, and hooks being unintentionally triggered.

Core Features & Use Cases

  • Save provides upsert behavior, inserting when the primary key does not exist.
  • Update updates a single column and requires a condition to avoid global updates.
  • Updates can modify multiple columns using a struct (ignores zero values) or a map (includes all values).
  • Select and Omit allow precise control over which fields are written.
  • Batch updates apply changes to many rows when no primary key is present.
  • Global update protection can be overridden with an explicit where clause, raw SQL, or a session that allows it.
  • SQL expressions enable mathematical updates directly in the query.
  • Subquery updates let you set a column based on another table’s data.
  • UpdateColumn and UpdateColumns bypass hooks and timestamp tracking.
  • Returning clauses retrieve the modified rows for databases that support it.
  • Common mistakes and fixes are documented for safe usage.

Quick Start

Ask the skill to set the name of user with ID 123 to 'Alice' using an update operation.

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-update
Download link: https://github.com/liurida/gorm-development-skill/archive/main.zip#gorm-update

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.