gorm-advanced-query
CommunityAdvanced GORM queries: subqueries, locking, scopes
Authorliurida
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Manages complex data retrieval scenarios in Go applications using GORM, eliminating the need to write verbose raw SQL for subqueries, row locking, batch processing, and reusable query conditions.
Core Features & Use Cases
- Smart field selection automatically selects only required columns when mapping to smaller structs.
- Row locking provides FOR UPDATE and FOR SHARE locks with options like NOWAIT and SKIP LOCKED for safe concurrent updates.
- Subqueries enable embedding queries within WHERE or FROM clauses without manual SQL string concatenation.
- Group conditions allow nested logical expressions to build sophisticated filters.
- Scopes define reusable query snippets for common patterns such as amount thresholds or payment methods.
- Batch processing with FindInBatches efficiently handles large result sets.
- Counting and plucking simplify aggregate queries and column extraction.
Quick Start
Use the advanced query skill to fetch all paid orders over 1000 using predefined scopes.
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-advanced-query Download link: https://github.com/liurida/gorm-development-skill/archive/main.zip#gorm-advanced-query 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.