> Prisma ORM
Type-safe database access with Prisma. Schema definition, migrations, queries, and relations.
fetch
$
curl "https://skillshub.wtf/skillshub-team/catalog-batch5/prisma-orm?format=md"SKILL.md•Prisma ORM
Prisma ORM
Setup
npm install prisma @prisma/client
npx prisma init
Schema (prisma/schema.prisma)
datasource db { provider = "postgresql" url = env("DATABASE_URL") }
generator client { provider = "prisma-client-js" }
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
title String
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
createdAt DateTime @default(now())
}
Migrations
npx prisma migrate dev --name init
npx prisma generate # Regenerate client
Queries
const users = await prisma.user.findMany({ include: { posts: true } });
const user = await prisma.user.create({ data: { email: 'a@b.com', name: 'Alice' } });
await prisma.post.update({ where: { id: 1 }, data: { published: true } });
await prisma.user.delete({ where: { id: 1 } });
Advanced: transactions, raw SQL, middleware, soft deletes
> related_skills --same-repo
> Nix Dev Shells with direnv
Auto-activate reproducible dev environments with Nix flakes and direnv.
> Dagger with GitHub Actions
Run Dagger CI/CD pipelines in GitHub Actions for portable, testable builds.
> Bun + Hono API
Build fast APIs with Bun runtime and Hono framework.
> Deno Fresh Framework
Build full-stack web apps with Fresh on Deno. Islands, routes, and zero runtime overhead.