Next steps

JavaScript
PostgreSQL

Next steps

This section lists a number of potential next steps you can now take from here. Feel free to explore these or read the Introduction page to get a high-level overview of Prisma ORM.

Continue exploring the Prisma Client API

You can send a variety of queries with the Prisma Client API. Check out the API reference and use your existing database setup from this guide to try them out.

You can use your editor's auto-completion feature to learn about the different API calls and the arguments it takes. Auto-completion is commonly invoked by hitting CTRL+SPACE on your keyboard.

Here are a few suggestions for a number of more queries you can send with Prisma Client:

Filter all Post records that contain "hello"

const filteredPosts = await prisma.post.findMany({
where: {
OR: [
{ title: { contains: "hello" },
{ content: { contains: "hello" },
],
},
})

Create a new Post record and connect it to an existing User record

const post = await prisma.post.create({
data: {
title: 'Join us for Prisma Day 2020',
author: {
connect: { email: 'alice@prisma.io' },
},
},
})

Use the fluent relations API to retrieve the Post records of a User by traversing the relations

const posts = await prisma.profile
.findUnique({
where: { id: 1 },
})
.user()
.posts()

Delete a User record

const deletedUser = await prisma.user.delete({
where: { email: 'sarah@prisma.io' },
})

Explore the data in Prisma Studio

Prisma Studio is a visual editor for the data in your database. Run npx prisma studio in your terminal.

Change the database schema (e.g. add more tables)

To evolve the app, you need to follow the same flow of the tutorial:

  1. Manually adjust your database schema using SQL
  2. Re-introspect your database
  3. Optionally re-configure your Prisma Client API
  4. Re-generate Prisma Client

Introspect workflow

Try a Prisma ORM example

The repository contains a number of ready-to-run examples:

TypeScript
JavaScript (Node.js)
DemoStackDescription
FullstackSimple app (React) with a REST API
FullstackSimple app (React) with a GraphQL API
Backend onlySimple GraphQL server based on
Backend onlySimple REST API with Express.JS
Backend onlySimple gRPC API