Full Stack Web Development
Step 15 / 21120 min

Prisma ORM

Databases

Explanation

Prisma gives type-safe database access with a schema, migrations/push, and an ergonomic client for Node apps.

Code example

typescript
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

const skill = await prisma.skill.create({
  data: { name: "Docker", level: "beginner" },
});

const skills = await prisma.skill.findMany({ orderBy: { name: "asc" } });
console.log(skill, skills);

Helpful resources

Exercise

Model users and skills in Prisma, push the schema, and build CRUD queries.