# Building a Review Summerizer - PrismaClient

**URL:** <https://forum.codewithmosh.com/t/building-a-review-summerizer-prismaclient/72188>\
**Category:** React\
**Created:** [January 28, 2026, 4:56pm UTC](https://forum.codewithmosh.com/t/building-a-review-summerizer-prismaclient/72188 "2026-01-28T16:56:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greiffenberg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/greiffenberg/32/7402_2.png) [@Greiffenberg](https://forum.codewithmosh.com/u/Greiffenberg)\
**Post date:** [January 28, 2026, 4:56pm UTC](https://forum.codewithmosh.com/t/building-a-review-summerizer-prismaclient/72188/1 "2026-01-28T16:56:07Z")

</div>

It might just be my setup, but if this can help someone else I’ll post it anyway 🙂

In “ **Building a Review Summerizer** “ 3.1 I could not get the PrismaClient to work like Mosh.

I needed to create an adapter for it to work, and add the values to the .env file as described here: [Quickstart: Prisma ORM with MySQL (10 min) | Prisma Documentation](https://www.prisma.io/docs/getting-started/prisma-orm/quickstart/mysql)

Furthermore the “url” parameter should/could not be added to the schema.prisma, but is added automatically in prisma.config.ts

EDIT: Forgot that I also needed to run “bunx prisma generate“

At the top of routes.ts I imported the mysql/mariaDB adapter as described in the article above:

```auto
import { PrismaClient } from "./generated/prisma/client";

import { PrismaMariaDb } from "@prisma/adapter-mariadb";

```

Then this seems to work:

```auto
router.get("/api/products/:id/reviews", async (req: Request, res: Response) => {

   const adapter = new PrismaMariaDb({
host: process.env.DATABASE_HOST,
user: process.env.DATABASE_USER,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
connectionLimit: 5,

   });

const prisma = new PrismaClient({ adapter });

const productId = Number(req.params.id);

const reviews = await prisma.review.findMany({
where: { productId },
orderBy: { createdAt: "desc" },

   });

res.json(reviews);

});

```
