gorm-indexes

Community

Speed database queries with precise GORM indexes

Authorliurida
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Indexes are essential for reducing query latency and preventing full table scans, but designing and applying the right indexes is error prone and can hurt write performance if done incorrectly. This Skill documents how to declare indexes in GORM model tags and apply them safely so queries that use WHERE, JOIN, or ORDER BY run significantly faster without unnecessary overhead.

Core Features & Use Cases

  • Declarative index definitions: Define basic and named indexes, unique constraints, and multiple indexes directly on struct fields using model tags.
  • Composite and shared indexes: Create multi-column indexes, control column ordering via priority, and use shared composite naming for embedded structs to avoid duplicates.
  • Advanced index options: Configure partial indexes, expression indexes, index type and class, collation, prefix length, comments, and database-specific options such as concurrent creation or parsers.
  • Practical use cases: Speed up search and lookup queries, enforce uniqueness across columns, reduce cost of frequent joins, and implement efficient partial indexes for active subsets of data.

Quick Start

Tag your model fields with index or uniqueIndex (and additional options) and run AutoMigrate to create the indexes in the database.

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

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.