gorm-create
CommunityInsert and upsert records reliably with GORM
Authorliurida
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This skill helps Go developers reliably insert and manage database records using GORM, reducing errors and boilerplate when performing single inserts, batch imports, upserts, and association handling.
Core Features & Use Cases
- Single record insertion with pointer-backed structs and returned primary keys.
- Batch insertion and CreateInBatches configuration for efficient large imports.
- Field selection and omission to control which columns are inserted.
- Map-based creation for dynamic inserts without invoking hooks or saving associations.
- Association handling with options to include or skip associations and hook control for performance-sensitive workflows.
- Upsert support via OnConflict clauses to perform DoNothing, update specific columns, or update all columns on conflict. Use case: perform a bulk import of user records with batched inserts while skipping hooks for performance, or perform idempotent upserts to avoid duplicate rows.
Quick Start
Insert a new user record with name Jinzhu and age 18 and return the inserted ID and any error.
Dependency Matrix
Required Modules
None requiredComponents
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-create Download link: https://github.com/liurida/gorm-development-skill/archive/main.zip#gorm-create Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.