prisma-orm — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited prisma-orm (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are a Prisma ORM expert for TypeScript applications.
prisma.$transaction() for consistencymodel User {
id String @id @default(uuid())
email String @unique
name String?
posts Post[]
profile Profile?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@map("users")
@@index([email])
}
model Post {
id String @id @default(uuid())
title String
content String?
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
authorId String @map("author_id")
@@map("posts")
@@index([authorId])
}Key attributes: @id, @unique, @default(), @map(), @relation(), @@map(), @@index(), @@unique(). Read reference/schema-patterns.md for all types and patterns.
| Type | Schema Pattern |
|---|---|
| One-to-One | FK with @unique on one side, optional ? field on other |
| One-to-Many | FK on "many" side, array [] on "one" side |
| Many-to-Many (implicit) | Array [] on both sides, Prisma creates junction table |
| Many-to-Many (explicit) | Junction model with two @relation fields |
| Self-relation | Model references itself (e.g., parent/children) |
// Create with relation
const user = await prisma.user.create({
data: { email: '[email protected]', name: 'Alice', posts: { create: { title: 'Hello' } } },
include: { posts: true },
});
// Query with filtering
const posts = await prisma.post.findMany({
where: { author: { email: { contains: '@company.com' } } },
orderBy: { createdAt: 'desc' },
take: 20,
skip: 0,
select: { id: true, title: true, author: { select: { name: true } } },
});
// Cursor pagination (preferred over offset)
const next = await prisma.post.findMany({
cursor: { id: lastId },
skip: 1,
take: 20,
orderBy: { id: 'asc' },
});Read reference/client-patterns.md for CRUD recipes, nested writes, transactions, and error handling.
# Development: create and apply migration
npx prisma migrate dev --name add_user_table
# Production: apply pending migrations
npx prisma migrate deploy
# Reset database (development only)
npx prisma migrate reset
# Generate client after schema change
npx prisma generate
# Browse database
npx prisma studioRead reference/migration-workflow.md for CI/CD integration, handling drift, and rollback strategies.
prisma.$queryRaw for complex SQL not supported by clientprisma.$transaction([...]) for sequential, or prisma.$transaction(async (tx) => {...}) for interactiveprisma.$use() for logging, soft delete, audit trailspgbouncer=true in connection string for serverlessselect to reduce payloadinclude to eager-load relationsprisma migrate deployreference/schema-patterns.md — Model patterns, field types, attributes, enums, multi-file schemasreference/client-patterns.md — CRUD recipes, filtering, transactions, raw SQL, error handlingreference/migration-workflow.md — Dev vs prod workflow, seeding, CI/CD, rollback~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.