managing-database-tests
Installation
SKILL.md
Database Test Manager
Overview
Manage database testing including fixture loading, transaction-based test isolation, migration validation, query performance testing, and data integrity checks. Supports PostgreSQL, MySQL, MongoDB, SQLite (in-memory), and Redis with ORM-agnostic patterns for Prisma, TypeORM, SQLAlchemy, Knex, and Drizzle.
Prerequisites
- Database instance available for testing (Docker container, in-memory SQLite, or dedicated test server)
- Database client library and ORM installed (Prisma, TypeORM, Knex, SQLAlchemy, etc.)
- Migration files up to date and tested independently
- Test database connection string configured in environment (distinct from development/production)
- Database seed data scripts for baseline test state
Instructions
- Set up the test database infrastructure:
- Use Docker to spin up a dedicated test database:
docker run -d -p 5433:5432 --name test-db postgres:16-alpine. - Or use SQLite in-memory mode for fast unit tests:
sqlite::memory:. - Or use Testcontainers for ephemeral database per test suite.
- Use Docker to spin up a dedicated test database:
Related skills