dapper-conventions
CommunityStandardize Dapper repositories for persistence.
System Documentation
What problem does it solve?
NewsParser Dapper repository conventions for Infrastructure/Persistence/Repositories/. Use when adding a new repository class, adding a method to an existing repository, writing a query with multi-table stitching, using pgvector, or writing an update/delete operation. Triggers on: "add repository", "new repository", "add method to repository", "Dapper query", "pgvector query", "ExecuteAsync", "repository pattern", "add GetPendingFor", "write a query", "IDbConnectionFactory", "IUnitOfWork".
Core Features & Use Cases
- Repository class structure — Constructor injection pattern with internal access and matching namespace/usings.
- Connection lifecycle — per-operation connections and UoW integration guidance.
- CommandDefinition usage — always wrap in CommandDefinition with cancellationToken.
- SQL constants organization — place SQL in *Sql.cs per aggregate.
- Update and insert patterns — enum to string binding, vector support, and insert/return patterns.
- pgvector and JSONB handling — parameter binding and maps for vector, KeyFacts, SelectedMediaFileIds.
- Multi-row loading and stitching — separate queries with in-memory or Dapper multi-mapping patterns.
- ILIKE escape handling and SKIP LOCKED cautions — safe search patterns and transaction context.
- IUnitOfWork usage — optional optimization for atomic operations.
- Method-name catalogue — mapping to common repository method signatures.
- Checklist for new methods — validation rules for code style and safety.
Quick Start
Follow these conventions when implementing or reviewing a Dapper repository to ensure consistency.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 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: dapper-conventions Download link: https://github.com/roromanenko/NewsParser/archive/main.zip#dapper-conventions 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.