Prisma

P

Prisma

The official Discord server of Prisma! Find us online at prisma.io

Join

Sorting by distance

Hi, I am stuck with this, please help me out. I want to fetch data based on users location. I am using prisma. I have one prisma query where i have applied all sorts or filter and search, which would be a nightmare if i were to do it in raw query. but now that i want data by location i want to run this query and get data on the ordered by distance table. How should i use it with first query. because this query cannot be run with prisma query....

Cloudflare Pages Error: @prisma/client did not initialize yet. Please run "prisma generate" and try

This is my error log from Cloudflare: ``` 20:50:29.629 ▲ Collecting page data ... 20:50:30.354 ▲ Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again. 20:50:30.355 ▲ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report 20:50:30.355 ▲ at new PrismaClient (/opt/buildhome/repo/frontend/node_modules/.prisma/client/default.js:43:11)...

Error querying the database: FATAL: Max client connections reached

Hi! I'm building a NextJS app with Supabase as my DB, and using Trigger.dev for background jobs. I've been running into the "Max client connections reached" error a lot, and it's heavily impacting production. I've gone through both of these docs: - https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool - https://supabase.com/docs/guides/database/connecting-to-postgres#connection-pooler...

Prisma too many connection to my database

Hey everyone, I use Prisma for ORM and Neon for my database I noticed something, my connections aren't unique and after some time, i reach to the max to my database ...

How do you seed/initialize basic data as products, delivery methods during deploy ?

When i develop my app and running it up using docker i run "prisma migrate dev" command what automatically run "prisma db seed", but "prisma migrate deploy" does't seed my db in cloud, any solutions ? should i manually connect to RDS and privde this data by using insert command ??

Prisma not working in cpanel

So I just recently hosted my project in cpanel using a VPS server now I have done everything right I have even generated the prisma client but when I launch my application I get {“message”:{“name”: “PrismaClientInitializationError”, “clientVersion”: “5.13.0”}}

Issue when running migrate command

I am using neon.tech's postgresql instance and this is the error that occurs whenever I run the migrate comamnd, this is my command: pnpx prisma migrate dev --name init...
No description

Prisma generate have different result in v5.13

I just upgrade prisma to 5.13 and it broke everything in my CI. It have different docker result between 5.12 and 5.13 When I downgrade it to 5.12, it runs without problem. my stack: bun + sveltekit...

Prisma warns of data loss when changing required field to optional, even when there is a default val

Hi there, I currently a column with this row: ```sql autoDeleteIntroductionsOnLeave Boolean? @default(false)...

Prisma VSCode extension v5.13.1 causing severe issue

Hey team! I have been using Prisma ORM for few months now and it has worked wonders for me, but a few days ago i started facing issue in my schema.prisma file, it stopped formatting and syntax highlighting etc. after a lot of debugging the issue I found was that when i am using VSC extension of Prisma on v5.13.1 it stops working, all the features like formatting etc stops and alongside that when i use Prisma: Restart Language Server it gives error Command 'Prisma: Restart Language Server' resulted in an Error (screenshot attached), but when I downgrade the extension to v5.12.1 it starts working back as usual....

multiple relations to same table

Hi Ya'll! I am trying to figure out my schema. I have a PI table and a contact table. I want the PI to be able to have two contacts one public and one private but I am having trouble figuring out how these relations work. Any thoughts would be appreciated
```ts model PI { id String @id @default(cuid())...

anyway i can have the _sum in this findMany()

Anyway I can have the _sum in findMany() or should i use typescript to get the sum? ```ts const bookings = await db.booking.findMany({ select: { courseId: true,...

Bun App. Cant fix Prisma Generate. Dockerfile?

This is the log error when I run ./server.js on Fly.io 2024-04-26T10:34:58.943 runner[e78464ea2742d8] sin [info] Machine started in 518ms 2024-04-26T10:34:59.024 app[e78464ea2742d8] sin [info] $ NODE_ENV=production bun ./server.js ...

How can show advertisement in queue in sync with all users?

What I expected: I expected the advertisement to be displayed in real-time to the user, with the next advertisement in the queue being displayed once the current one is dismissed. I also tried with useEffect to fetch data at one time and then make queue but its not real time I haven't use prisma or postgres, cause I don't know can I use it or not ? ...

Transaction timeout

Why might a transaction work fine on local, but then get a timeout when deployed. Same DB. Same Node version. Using NextJS deployed in a vercel serverless env. Exact same user. Exact same auth system. Exact same DB. Exact same project. Only real difference is one is running locally and one is deployed to vercel. Even worse is the transaction succeeds. The data is saved and I still get that error....

Status of NanoID

Hi 👋 , I've noticed there's already been implemented NanoID in prisma-engines https://github.com/prisma/prisma-engines/pull/3556. But for some reason the final implementation (i.e. docs, code completion) has not been finished. https://github.com/prisma/prisma/issues/17199 ...

Can't use Neon

After pasting the schema.prism and .env sections I tried to run this command npx prisma migrate dev --name init However, I get this error: Environment variables loaded from .env Prisma schema loaded from prisma\schema.prisma...