gorm-generics-api

Community

Type-safe GORM CRUD with Go generics

Authorliurida
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Provides a type-safe, context-first alternative to the traditional GORM API to avoid SQL pollution from reused DB instances, reduce runtime type errors, and make CRUD and complex queries explicit and safer in Go projects.

Core Features & Use Cases

  • Type-safe CRUD: Create, read, update, and delete records with compile-time generics for model types.
  • Advanced queries, joins, and preload: Perform enhanced joins, nested preloads, per-record limits, and scoped queries while preserving strong typing.
  • Raw SQL and code generation: Run typed raw SQL queries and generate boilerplate query code using the GORM CLI to keep raw queries type-safe and maintainable.
  • Use Case: Migrate a codebase to generics to prevent accidental DB state reuse and to implement efficient preloads for a social app where Users have Friends and Pets.

Quick Start

Show me step-by-step how to perform create, query, update, delete, join, and preload operations for a User model using GORM generics with an active database connection.

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

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.