Skip to content

Prisma Studio

Once changes have been made to a database, it is often useful to manually check to ensure that the changes have been made correctly.

Prisma Studio is a tool that allows you to do just this. It provides a visual interface to your database, allowing you to view, add, edit and delete records.

To spin it up, run the following command:

Terminal window
npx prisma studio

This will open a new tab in your browser at http://localhost:5555, showing the database schema and the single User table currently within it:

Prisma Studio

Click on the User table, and you will see the (empty) fields that are currently within it.

You can add and delete new records directly from inside Prisma Studio. Let’s add a new user manually by clicking on the Add Record button:

Prisma Studio Add Record

You’ll see that most of the fields automatically have values added to them. This is because we have set default values for id, createdAt and updatedAt in the Prisma schema. All we need to do is manually add an email to the new user.

Double click the email field and add a new email address. Remember to click Save 1 change when you’re done:

Add email and save

Once you have a completely empty User table, you can close Prisma Studio by typing Ctrl + C and hitting return in the terminal window.

Next, we will add an Article table, and link articles to users with a foreign key.