2021-10-20
3137
#node
Akshay Kadam
13407
Oct 20, 2021 ⋅ 11 min read

An introduction to Prisma 2

Akshay Kadam Akshay is a creator, computer artist, and micropreneur from Mumbai. Find him on Twitter @deadcoder0904.

Recent posts:

React useCallback: When And How To Use It For Better Performance

React useCallback: When and how to use it for better performance

Learn how React’s useCallback hook boosts performance by memoizing functions and preventing unnecessary re-renders with practical examples and best practices.

Emmanuel John
Feb 26, 2025 ⋅ 6 min read
what is the virtual DOM in react

What is the virtual DOM in React?

Learn the characteristics of the virtual document object model (DOM), explore its benefits in React, and review a practical example.

Ibadehin Mojeed
Feb 26, 2025 ⋅ 9 min read

A practical guide to switch statements in JavaScript

You might start with if...else statements. But as your logic grows more complex, you’ll discover the switch statement in JavaScript is simply better for handling multiple conditions in a clean and readable way.

Fimber Elemuwa
Feb 26, 2025 ⋅ 6 min read
Building Multi-Step Forms With React Hook Form And Zod

Building a reusable multi-step form with React Hook Form and Zod

Use React Hook Form and Zod to build a multi-step form component in React that handles input validation, tracks form progress, and more.

Chinwike Maduabuchi
Feb 26, 2025 ⋅ 13 min read
View all posts

3 Replies to "An introduction to Prisma 2"

  1. Hi! Does Prisma 2 work fine with MongoDB? Because there is nothing about it in the official docs, neither examples.

  2. This seeder function did not work for me at all.

    First :

    .finally(async () => {
    await prisma.disconnect()
    })

    throws an error, in the current Prisma version. To solve this, run “await prisma.$disconnect()”

    Second, and that is more of my own use case, if you’re creating tables in your db in a loop, don’t use forEach but for .. of loop. My use case:

    for (const entity of entities) {
    await prisma.tableName.create({
    data: entity
    })
    }

    Every row has to be created asynchronously.

Leave a Reply