data-access-patterns

Installation
SKILL.md

Data Access Patterns Skill

Use this skill when writing or modifying database access code in internal/models/.

This project uses explicit SQL over ORMs for performance, readability, and fine-grained control.


Core Principles

  • No ORM: Use database/sql directly. Do NOT introduce or use any ORM.
  • PostgreSQL Driver: The project uses github.com/lib/pq (imported in internal/db/db.go).
  • Raw SQL: Write explicit, readable SQL queries. Use PostgreSQL-specific features (JSONB, ON CONFLICT) and $1, $2 placeholders.
  • Transactional Integrity: Use *sql.Tx when multiple operations must complete together or fail (atomicity).
  • Separation of Concerns: Keep database models and access logic in internal/models/. Repository functions should focus on data retrieval and persistence.

Repository Function Naming

Installs
3
GitHub Stars
1
First Seen
Feb 11, 2026
data-access-patterns — sjtw/tarkov-build-optimiser