Prisma
@prisma.io
6 months ago ✅ Checkpoint: If everything worked, your app should now display the data you've added to your Prisma Postgres instance in a view when running the app with `npm run dev`.
💬 1
♻️ 0
❤️ 0
✅ Checkpoint: If everything worked, your app should now display the data you've added to your Prisma Postgres instance in a view when running the app with `npm run dev`. 🚄 Step 5. Fetch the data in the frontend code.
Open the `app/page.tsx` file and replace the existing code with the following to query your DB & retrieve your users 👇 🤝 Step 4: Integrate Prisma Client in Next.js.
Create a new file called `src/lib/prisma.ts` and add the following code to instantiate Prisma Client. 💡 Tip: You can now view and manage the data in your Prisma Postgres instance via Prisma Studio in your Prisma Data Platform Account.
Run `npx prisma studio` or visit console.prisma.io & add Alice and Bob as users in your app 👇 ⚙️ Step 4: Run a database migration.
To map the models from your Prisma schema to the database, run the following Prisma Migrate command. ✍️ Step 3: Define your Prisma schema.
Add your data models that represent the schema in your underlying database. For this app, we're defining a `User` and `Post` model for a simple blogging app. ✅ Checkpoint: At this point, your project structure will look as follows: 🚀 Step 2: Install Prisma & set up a Prisma Postgres database.
When running `npx prisma init --db`, you'll be prompted to provide some information about your Prisma Postgres instance (such as a name and its region). 🚀 Step 1: Create a new Next.js project with the `create-next-app` CLI and select all of the defaults ↓ 🎓 Learn how to build a fullstack app with @nextjs.org and Prisma Postgres!
🚀 Next.js is a powerful framework for building everything from content-rich sites to fullstack apps. In this thread, I’ll walk you through setting up Next.js with Prisma Postgres, step by step 👇 👀 Want to see how to set up Prisma ORM properly in an ESM or monorepo project?
We’ve put together working Next.js 15 examples using Webpack, Turborepo, pnpm & more.
Check them out and let us know what examples we should add next👇
pris.ly/examples/pc Germany making me feel like I’m back in the UK with these >1hr train delays
🔍 Need to quickly spot the differences between two snippets of code? Try `editor: diff clipboard with selection`, coming to stable in v0.197, this Wednesday.
Still stuck on Prisma ORM or Prisma Postgres after hours of searching?
Ask in our Discord help-and-questions channel.
You’ll get quick answers from AI or a real human. Your choice.
Join the community and get unblocked 👇
pris.ly/discord/var-2 Our team is growing, and we'd love to hear from you!
Check out the three new opportunities we just posted:
- Technical Customer Success Manager (North America)
- Platform Engineer
- Jr. Platform Engineer
We're empowering developers and content teams to create without limits.
directus.io/careers 🤖 AI chatbots need a database that can handle millions of operations a day without slowing down or demanding constant DevOps attention.
That’s why SiteGPT moved to Prisma Postgres for its scalable, usage-based approach.
Read the full story 👇
pris.ly/sitegpt i made a raidz1 pool a few weeks ago, bookmarking lol
The new prisma-client generator is now in Preview as of Prisma 6.12 🚀
If you’ve been holding off, now’s a great time to try it.
pris.ly/client-gen-... great questions! we're working on adding dashboards for this, but for now our limits are pretty soft (unenforced)
to view your sqlite usage, remix & run this: www.val.town/x/stevekrous... 🎥 Learn better by watching? Us too!
Explore our YouTube channel with Prisma walkthroughs, quick tips, and live AMAs. It's all made to help the community stay up to date.
If that sounds helpful, subscribe and let us know what you’d like to see next 👇
pris.ly/youtube/var-3 Dw I know you’re good 🫶 I wish someone would make good code review + git tooling though Like standalone from the editor
you just gotta git gud
Yeah, we have vague dreams of more isolated branches/remixes, a database per val branch For now, you can kinda simulate it yourself in userspace with namespacing: you can put the val & branch name into the sqlite table names or blob key prefixes