database-testing
Validate database integrity, test migrations forward and backward, verify schema constraints, manage seed data, and identify query performance issues.
Skill by kindlmann
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jaiminvadadoriya-database-testing
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, testing, data, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/database-testing
What's inside
- Skill name
database-testing- Description
- Validate database integrity, test migrations forward and backward, verify schema constraints, manage seed data, and identify query performance issues. Covers PostgreSQL, MySQL, MongoDB with ORMs like Prisma, TypeORM, and SQLAlchemy. Use when: "database test," "migration test," "data integrity," "SQL test," "schema validation," "seed data," "query performance." Related: test-data-management, test-environments, security-testing.
- License
- MIT
- Metadata
- author: kindlmann · version: 1.0 · category: automation
- Instructions
- 520 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- body: 520 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
<objective>
Validate database integrity, test migrations safely, verify constraints, and detect query performance issues.
**Before starting:** Check for `.agents/qa-project-context.md` in the project root. It contains database type, ORM, migration tooling, and environment configuration that shape every pattern below.
</objective>
---
## Discovery Questions
1. **Database type:** PostgreSQL, MySQL, SQLite, MongoDB, or multi-database? Each has different constraint syntax, migration tools, and performance profiling approaches.
2. **ORM / query builder:** Prisma, TypeORM, Drizzle, Sequelize, SQLAlchemy, Django ORM, or raw SQL? The ORM determines migration tooling and test patterns.
3. **Migration tool:** Prisma Migrate, TypeORM migrations, Flyway, Liquibase, Alembic, knex migrations, or custom? This determines how to test forward and backward migrations.
4. **Test database strategy:** Isolated database per test? Transaction rollback? Docker containers? Shared database with cleanup? This affects speed and reliability.
5. **Existing seed data:** Are there factories, fixtures, or seed scripts? Check for `prisma/seed.ts`, `seeds/`, `fixtures/`, or factory patterns.
6. **Performance baselines:** Are there existing query performance benchmarks or slow query monitoring?
---
## Core Principles
1. **Test migrations forward AND backward.** Every migration should be reversible. If a rollback fails, you cannot recover from a bad deploy. Test the `down` migration, not just the `up`.
2. **Constraints are the first line of defense.** `NOT NULL`, `UNIQUE`, `FOREIGN KEY`, and `CHECK` constraints prevent bad data at the database level, regardless of what application code does. Test that they exist and enforce correctly.
3. **Deterministic seed data.** Tests must produce the same results every run. Use factories with fixed seeds, not random data. Timestamp-based IDs, `uuid()`, and `now()` in seed data create non-deterministic tests.
4. **Isolate database state per test.** Tests that share database state are order-dependent and flaky. Use transaction rollback, per-test databases, or guaranteed cleanup.
5. **Test the migration, not the ORM.** The ORM's `sync` or `push` command skips the migration path users will experience. Always test the actual migration files.
---
## Migration Testing
### Forward Migration Validation
```typescript
// test/migrations/forward.test.ts
import { execSync } from 'child_process';
import { Pool } from 'pg';
describe('Forward migrations', () => {
let pool: Pool;
beforeAll(async () => {
// Create a fresh database for migration testing
const adminPool = new Pool({ database: 'postgres' });
await adminPool.query('DROP DATABASE IF EXISTS test_migrations');
await adminPool.query('CREATE DATABASE test_migrations');
await adminPool.end();
pool = new Pool({ database: 'test_migrations' });
});
afterAll(async () => {
await pool.end();
});
it('should apply all migrations from empty database', () => {
// Run all migrations against empty database
execSync('npx prisma migrate deploy', {
env: { ...process.env, DATABASE_URL: 'postgresql://localhost/test_migrations' },
});
});
it('should have correct schema after all migrations', async () => {
// Verify expected tables exist
const tables = await pool.query(`
SELECT table_name FROM information_schema.tables
WHERE table_schema = 'public' ORDER BY table_name
`);
const tableNames = tables.rows.map((r) => r.table_name);
expect(tableNames).toContain('users');
expect(tableNames).toContain('orders');
expect(tableNames).toContain('products');
});
it('should have correct columns on users table', async () => {
const columns = await pool.query(`
SELECT column_name, data_type, is_nullable, column_default
FROM information_schema.columns
WHERE table_name = 'users' ORDER BY ordinal_position
`);
const colMap = Object.fromEntries(
columns.rows.map((r) => [r.column_name, r])
);
expect(colMap.id.data_type).toBe('uuid');
expect(colMap.email.is_nullable).toBe('NO');
expect(colMap.created_at.column_default).toContain('now()');
});
});
```
### Rollback Testing
Prisma Migrate has no first-class `rollback` command. Production rollbacks happen by writing a *new* forward migration that reverts the previous one. For tests, the supported pattern is `prisma migrate resolve` to mark a migration as rolled back, plus a fresh DB reset between tests.
```typescript
import { execSync } from 'node:child_process';
describe('Migration rollback', () => {
it('the down migration cleanly reverses the latest up', async () => {
// Apply all migrations to a fresh DB
execSync('npx prisma migrate deploy', { env: migrationEnv });
// Capture pre-rollback state and insert test data
await pool.query(
`INSERT INTO users (id, email, name) VALUES ($1, $2, $3)`,
['550e8400-e29b-41d4-a716-446655440000', 'alice@example.com', 'Alice'],
);
// Get the latest applied migration name (Prisma stores in _prisma_migrations)
const { rows } = await pool.query(
`SELECT migration_name FROM _prisma_migrations
WHERE finished_at IS NOT NULL
ORDER BY finished_at DESC LIMIT 1`,
);From JaiminVadadoriya/Distributed-Cloud-Storage---Sync-Platform, MIT.
More from JaiminVadadoriya/Distributed-Cloud-Storage---Sync-Platform
- 0.502score
ai-test-generation
kindlmann
Staged pipeline for AI-assisted test generation: requirements extraction → risk analysis → coverage matrix → scenario generation → oracle design → test code →…
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
ci-cd-integration
kindlmann
Design CI/CD pipelines for test execution.
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
ai-bug-triage
kindlmann
Hybrid fingerprint + LLM pipeline for bug classification, deduplication, and ticket generation.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
accessibility-testing
kindlmann
Test for WCAG 2.2 compliance using axe-core with Playwright, keyboard navigation audits, screen reader testing, ARIA pattern validation, and legal compliance…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ai-system-testing
kindlmann
Test AI-powered features including LLM prompts, tool calls, nondeterministic outputs, evaluation frameworks, and hallucination risk assessment.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
api-testing
kindlmann
Test REST and GraphQL APIs with Playwright APIRequestContext, Supertest, or standalone HTTP clients.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ai-qa-review
kindlmann
QA-focused code review for test quality.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
chaos-engineering
kindlmann
Validate system resilience through controlled fault injection.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
cypress-automation
kindlmann
Build Cypress test suites with component testing, E2E testing, custom commands, cy.intercept for network control, Cypress Cloud integration, and TypeScript…
SkillCFreshness: C★ 1Claude Code +9 - 0.488score
coverage-analysis
kindlmann
Measure and improve test coverage meaningfully.
SkillCFreshness: C★ 1Claude Code +9 - 0.488score
compliance-testing
kindlmann
Test for regulatory compliance including GDPR/CMP consent verification, Better Ads Standards, cookie compliance auditing, and privacy policy validation.
SkillCFreshness: C★ 1Claude Code +9 - 0.488score
cross-browser-testing
kindlmann
Design analytics-driven browser test matrices and execute cross-browser tests.
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 30, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from kindlmann
- 0.570score
coverage-analysis
kindlmann
Measure and improve test coverage meaningfully.
SkillAFreshness: AClaude Code +9 - 0.570score
ai-qa-review
kindlmann
Review EXISTING test code for quality, smells, and testability issues.
SkillAFreshness: AClaude Code +9 - 0.570score
release-readiness
kindlmann
Validate release readiness with evidence-based go/no-go decisions.
SkillAFreshness: AClaude Code +9 - 0.570score
risk-based-testing
kindlmann
Produce a risk matrix or heatmap that quantifies what could break by business impact × probability, runs failure mode analysis on the top items, and maps test…
SkillAFreshness: AClaude Code +9 - 0.570score
qa-project-context
kindlmann
Create and fill .agents/qa-project-context.md with the project's tech stack, test frameworks, CI/CD pipeline, environments, quality goals, risk areas, team…
SkillAFreshness: AClaude Code +9 - 0.502score
ai-test-generation
kindlmann
Staged pipeline for AI-assisted test generation: requirements extraction → risk analysis → coverage matrix → scenario generation → oracle design → test code →…
SkillCFreshness: C★ 1Claude Code +9
Cite this page
database-testing skill. Agent Mart. https://agentmart.dev/skills/jaiminvadadoriya-database-testing (last updated 2026-10-24)