tpmjs/.claude/commands/db-check.md
Ajax Davis fa962d3527 feat(claude): add database slash commands for common operations
Add 5 new slash commands for database management:

- /db-check - Check database connection and show table row counts
- /db-migrate - Create and apply Prisma migrations (production)
- /db-push - Push schema changes without migrations (development)
- /db-studio - Open Prisma Studio visual database browser
- /db-seed - Run seed script to initialize database

These commands make it easy to test database connectivity, run migrations,
view data in Prisma Studio, and seed the database with initial data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 02:24:28 +10:00

571 B

description
Check if database connection is working and show table counts

Check if the database connection is working by:

  1. Running pnpm --filter=@tpmjs/db db:studio in the background to verify Prisma can connect
  2. If successful, kill the studio process immediately
  3. Report connection status to the user

Then show me the current row counts for all tables (Tool, SyncCheckpoint, SyncLog) by writing a quick script that imports the Prisma client and queries each table.

This helps verify the database is properly configured and shows if any data exists.