Database Operations

VerifiedCaution

Manages PostgreSQL database via Prisma for a backend project. Runs actions like migrations, seeding, reset, Prisma Studio, schema inspection, client generation, and status checks. Use when you need to modify or inspect the database, such as applying new migrations or seeding test data.

Sby Skills Guide Bot
DevelopmentIntermediate
606/2/2026
Claude Code
#database#prisma#postgresql#migrations#docker

Recommended for

Our review

Manages PostgreSQL database operations via Prisma including migrations, seeding, schema inspection, and Prisma Studio.

Strengths

  • Automates common database tasks like migrations and seeding
  • Reduces manual Docker commands
  • Safe reset operation with user confirmation
  • Provides schema viewing and client generation

Limitations

  • Requires Docker and the backend container to be running
  • Only works with a specific project setup (local paths)
  • Reset confirms but still drops data without backup
When to use it

Use when you need to run database migrations, seed test data, open Prisma Studio, or inspect the Prisma schema during development.

When not to use it

Do not use for production database operations or when you need to execute raw SQL queries not covered by Prisma.

Security analysis

Caution
Quality score88/100

The skill leverages Bash and Docker to execute Prisma commands directly inside a running container. While all actions are legitimate database operations, the use of docker exec and argument interpolation poses a risk if inputs are not carefully controlled. The reset action highlights a destructive operation but is gated by a confirm step.

Findings
  • Uses docker exec to run arbitrary commands inside a container, which could be exploited if arguments are not sanitized.
  • The reset action is destructive (drops all data) but includes user confirmation instruction.

Examples

Run pending migrations
Run the pending database migrations.
Seed test data
Seed the database with test data.
Open Prisma Studio
Open Prisma Studio to browse the database visually.

name: db description: Database operations - run migrations, seed data, open Prisma Studio, reset, or inspect schema. Use when the user needs to work with the database. argument-hint: [action] allowed-tools: Bash, Read disable-model-invocation: true

Database Operations

Manage the PostgreSQL database via Prisma. All commands target the backend at C:/Users/pi/projects/rea/main/backend.

Parse $ARGUMENTS for the action.

Actions

migrate (default)

Run pending migrations against the local database.

docker exec rea-backend sh -c "cd /home/site/wwwroot && npx prisma migrate deploy"

migrate:dev

Create a new migration during development.

docker exec rea-backend sh -c "cd /home/site/wwwroot && npx prisma migrate dev --name $ARGUMENTS[1]"

Requires a migration name as the second argument.

seed

Seed the database with test data.

docker exec rea-backend sh -c "cd /home/site/wwwroot && npm run db:seed"

reset

Reset the database (drops all data, re-runs migrations and seed). Confirm with user before running.

docker exec rea-backend sh -c "cd /home/site/wwwroot && npx prisma migrate reset --force"

studio

Open Prisma Studio for visual database browsing.

docker exec rea-backend sh -c "cd /home/site/wwwroot && npx prisma studio"

Note: Prisma Studio runs on port 5555 inside the container. The user may need to map this port.

schema

Display the current Prisma schema. Read the file: C:/Users/pi/projects/rea/main/backend/prisma/schema.prisma

generate

Regenerate the Prisma client after schema changes.

docker exec rea-backend sh -c "cd /home/site/wwwroot && npx prisma generate"

status

Show migration status.

docker exec rea-backend sh -c "cd /home/site/wwwroot && npx prisma migrate status"

Notes

  • The database container must be running (docker-compose up -d db)
  • Connection string: postgresql://dev:dev@db:5432/realestate (inside Docker network)
  • Adminer UI available at http://localhost:8080 (server: db, user: dev, pass: dev, db: realestate)
Related skills