Prisma

P

Prisma

Join the community to ask questions about Prisma and get answers from other members.

Join

Prisma stores invalid data

when trying to store a big int like my discord user if which is 229368888486395905, when prisma stores the number, it is different to what my id is! This is what it stores: 229368888486395900

MTI key relation

``` model Supertype { id Int @id @default(autoincrement()) Subtype Subtype[] }...
Solution:
Hi :vmathi: This looks correct to me. Did you get any issue with it?

Prisma first query goes slow

Hi, I have a question. I've noticed that when Prisma executes its first query of the day, it's quite slow. Even a simple find operation for a single item from the database experiences this delay, sometimes taking more than ten seconds. I've read in the documentation that $connect can help with this when making the first query, but the question is where to place it. Additionally, the documentation also mentions that it's not necessary to use it explicitly so im a little confuse
Solution:
Yeah. they are talking about the same issue. well i will try this workaround that invokes a simple database query every 10-15 mins, in order to prevent Query Engine. thanks

[ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './runtime/library.js' is not defined in "exports"

Hello, I get the error from the title whenever I try to run a project in Docker (image node:20.11.0-bullseye). Prisma is the only dependency in the project, prisma generate has been correctly executed. Error stack: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './runtime/library.js' is not defined by "exports" in /ragemp-server/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/package.json 2024-04-30 12:50:56 at throwExportsNotFound (internal/modules/esm/resolve.js:285:9) 2024-04-30 12:50:56 at packageExportsResolve (internal/modules/esm/resolve.js:491:3)...

Health Check of Query Engine timed out.

Hello there, I've been using Prisma for a bit now and I decided today to setup Prisma Accelerate. I'm using a mariadb (mysql) server and I've successfully setup accelerate, however, when queries that worked before accelerate are run, they error. Error + Logging: ``` prisma:client clientVersion 5.13.0 +0ms...

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 ...