pilinux/gorest · Archived

db-infra-mocks

Propose minimal seams and local substitutes so tests run without real RDBMS/Redis/Mongo infrastructure.

First seen Mar 2, 2026

Installation

$ npx skills add pilinux/gorest --skill db-infra-mocks

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from pilinux/gorest · top by installs.

npx skills add pilinux/gorest

Browse all from pilinux/gorest

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 502
License LICENSE
Default branch main
Open issues 0
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

LicenseMIT
More metadata
mode
design
purpose
infra

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,753 B
  • docs SUMMARY.md 125 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 4 installs

SKILL.md

DB Infrastructure Mocks

When to Use

  • Integration dependencies (RDBMS, Redis, MongoDB) prevent running tests or local development and you need safe, testable alternatives.

Responsibilities

  • Locate where clients and connections are constructed and consumed (database/ package).
  • Propose interface-based seams and minimal mock implementations.
  • Provide migration path and verification steps so production behavior remains unchanged.

Rules

  • Prefer small interfaces and constructor injection over large refactors.
  • Make tests deterministic and avoid network calls.
  • Provide unit and integration verification steps for any change.

Project-Specific Details

  • RDBMS connections: gdb.InitDB() / gdb.GetDB() (GORM *gorm.DB).
  • Redis connections: gdb.InitRedis() / gdb.GetRedis() (radix v4 radix.Client).
  • MongoDB connections: gdb.InitMongo() / gdb.GetMongo() (*mongo.Client from official driver v2).
  • Close all: gdb.CloseAllDB().

Recommended Approaches

  • RDBMS: Use SQLite in-memory (driver: "sqlite3") for simple GORM-backed tests.
  • Redis: Use a radix v4 compatible mock or inject an interface wrapper around radix.Client.
  • MongoDB: Inject a mock repository interface or use a local test MongoDB instance.

Output

  • Dependency map with path:line of client construction and usage.
  • Recommended seam (interface signature) and where to inject it.
  • Example mock/test code snippet and verification commands.

Related Skills

  • test-runner, patch-applier, migration-helper