Explain Prisma schema code
Paste a Prisma schema and Vibe explains the tables it describes: each model and field, what ?, @id and @default do, and how two models point at each other.
Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.
Vibe24 lines selected
Press Explain it for the sample, or paste your own code first.
What this Prisma schema sample shows
- models and fields
- Each
modelbecomes a table and each field a column, written as name, type, then attributes, except relation fields likeauthorandposts, which link tables instead of storing a value.prisma migrate diffturnedmodel UserintoCREATE TABLE "User".name String?became"name" TEXTand a new user with no name storedNULL; without the?it became"name" TEXT NOT NULL. - attributes
@idmarks the primary key and@default(autoincrement())gives each new row the next number: the first user got id 1.@uniqueonemailbecame a unique index: adding a secondana@example.comfailed withUNIQUE constraint failed: User.email.@default(now())becameDEFAULT CURRENT_TIMESTAMP, which filledcreatedAt, and@default(false)left a new post unpublished.- relations
author User @relation(...)saysauthorIdholds aUser'sid, and became a foreign key: a post for user 99, who doesn't exist, failed withFOREIGN KEY constraint failed.posts Post[]is the other side, a list with no column of its own. Without it,prisma validatestopped: the relation fieldauthoris missing an opposite relation field on the model User.- the generator and datasource
generator clienttellsprisma generateto write the code your app uses to query the database: it wrote client.ts and the files next to it into src/generated/prisma, theoutputfolder.datasource dbnames the database type, here SQLite. In Prisma 7 the address the command line tool uses lives in prisma.config.ts, and your app passes its own connection tonew PrismaClient(): withurl = env("DATABASE_URL")added here,prisma validatestopped, saying the datasource propertyurlis no longer supported in schema files.
Good to know
- Run with Prisma 7.10.1 and SQLite 3.53.4:
prisma validatepassed,prisma migrate diff --from-emptyprinted the SQL, and that SQL was run against an empty SQLite file with foreign keys switched on. onDelete: Cascademade the foreign keyON DELETE CASCADE: deleting a user with 2 posts left 0 posts. With it taken out, Prisma wroteON DELETE RESTRICTinstead, and deleting a user who still had a post failed and left the user in place.
Watch out: Changing this file doesn't change your database. The tables only change when you run a command such as prisma migrate dev or prisma db push, and your app's query code only changes when prisma generate runs. Before applying a migration, read the SQL it will run: making name required became "name" TEXT NOT NULL, which a table that already has users without a name can't hold.
Explain Prisma schema code beside your editor
Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).
Install on Mac
curl -fsSL https://unvibe.site/install.sh | bashPaste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.
Or download the .dmg · Intel Mac build · SHA-256 checksums
Opening the .dmg the first time
- Open the .dmg and drag Unvibe to Applications.
- Open it once; macOS says it can't verify it. Click Done.

Real screen, macOS 15 - System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.

Real screen, macOS 15
The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open