managing-database-tests

Featured

Test database testing including fixtures, transactions, and rollback management. Use when performing specialized testing. Trigger with phrases like "test the database", "run database tests", or "validate data integrity".

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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 1. 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. - Verify the test database is isolated from development data. 2. Run database migrations against the test database: - Execute `npx prisma migrate deploy` or `npx knex migrate:latest --env test`. - Verify all migrations apply cleanly to an empty database. - Test rollback: run `migrate:rollback` and verify schema reverts correctly. 3. Implement test isolation strategy (choose one): - **Transaction rollb...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category