Skip to content
Back to skills

Prisma Orm

ASecurity

Use Prisma ORM safely in production: client singleton, migrations, lean selects, transactions and pooling

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmenttypescriptsqlapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill prisma-orm --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prisma Orm?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prisma Orm
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-prisma-orm/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-prisma-orm)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Use Prisma ORM safely in production: client singleton, migrations, lean selects, transactions and pooling
profile: standard
tags: prisma, database, orm, typescript
---

# Prisma ORM

Use when editing `schema.prisma`, writing queries, or deploying Prisma migrations.

## Client lifecycle and pooling
- Reuse a single `PrismaClient` instance cached on `globalThis` in development so hot reloads do not exhaust database connections.
- In serverless functions, keep connection limits tight (`connection_limit`) or route through PgBouncer/Prisma Accelerate (`directUrl` for migrations vs pooled `DATABASE_URL`).

## Migrations
- Author schema updates with `prisma migrate dev --name <change>` locally and commit the SQL migration file after reading it.
- Run `prisma migrate deploy` in CI/release jobs. Never run `prisma db push` or `migrate reset` against production or shared staging databases.

## Queries and N+1 safety
- Always narrow payloads with `select` (especially when user/secret columns exist) rather than returning full models to API responses.
- Batch related lookups or use nested `include` / `where: { id: { in: ids } }` instead of `findUnique` loops (avoid triggering N+1 queries on relations).
- Use `prisma.$transaction([...])` for atomic updates; keep interactive `prisma.$transaction(async (tx) => ...)` short and free of external HTTP calls.

## Verify
Run `npx prisma validate`, `prisma generate`, and integration tests against a test database checking migrations, selected fields, and transaction rollback.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.