Prisma

P

Prisma

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

Join

Initial value for data in my table

Greeting I want add initial value zero for this table How can i do it ?...
No description

Multiple roles for a user

I have a scenario where a user can have multiple roles at the same time. For example a user can be editor and translator. What is the recommended approach for this situation?...

Issue with seeding in Next.js + Prisma + Docker + SQLite

Hi everyone, I have an application with Next.js, Prisma, Docker, and SQLite. Everything works fine in development, but when I run the Docker image and execute the npm run seed command, the data is successfully added, but it doesn't reflect in the application until I restart it. This also happens when using Prisma Studio. Has anyone experienced a similar issue? How can I resolve it? I ran the container with npm run dev and everything worked fine. Does anyone know what it is causing this behavior? And how can I make it work with npm run start? Thanks in advance #...

BLOB in prisma schema

Is there a way of storing BLOB in prisma schema? Please if you know tell me the aswer and don't tell me "don't store images in db", use S3 or something like that
Solution:
Hey 👋 Yes, you can use Bytes type to store BLOB data: https://www.prisma.io/docs/orm/reference/prisma-schema-reference#bytes...

Using Prisma inside firebase functions

Hey guys, I have a backend that runs mostly on Firebase/Firestore functions. However, we started migrating some tables to a PostgreSQL DB and I'm trying to use Prisma on Firebase. Connecting locally and deploying are already figured out by using a VPC + pg-pool. The issue is that when deploying the Firebase functions my code can't find the client library that is being generated. My package.json `"scripts": { "build": "tsc",...

mongodb connection with prisma

I tried pushing my mongodb database from the command line, and i am getting The provided database string is invalid. An invalid argument was provided: Database must be defined in the connection string in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.

Prisma Optimize Issue

My code is attached, I am fetching classes from my database which has assignments inside of it. Then, the assignments and classes are mapped in a seperate component that is inside the skeleton. Assignments are mapped inside the classes map. I'm not sure how to make this lightning fast but it sometimes takes 5 seconds to load even on production. https://cdn.discordapp.com/attachments/1331006139244085278/1331012480964628582/Screen_Recording_2025-01-20_at_1.27.48_PM.mov?ex=67901178&is=678ebff8&hm=fbe72a3de16c8c35da39f95caef198955b81682f4be84df338ab8b779612b999& this video gets t1 (before the prisma call) and t2 (after the prisma call) and prints t2-t1 to see how long the prisma call took. ...
No description

how do you manage very large models in nextjs?

So I made an app in nextjs and the user model is HUGE, around 70 lines of fields + relations, orders, products, chats, messages, reviews as buyer, as seller, followers, notifications and many fields. The app isn't slow but I don't want the app to carry this information in everyplace because not all fields are necessary all the time and also I want to hide some information. How do you manage large objects in your nextjs app with prisma?...

Prisma Playground Run button doesn't working

Idk why this happens, but I can't run any code in examples, run button just stuck on infinite loading 😵‍💫
No description

Nullable unique field on Prisma

Hi, @everyone, I have a Prisma model on MongoDB. ``` model StakeTx { txId String @id @map("_id") stakeId String? @unique @db.ObjectId...

'ts-node' is not recognized

I understand that this error comes from that ts-node is not installed globally . I want to report that in the seeding guide, there is written " Add typescript, ts-node and @types/node development dependencies: " npm install -D typescript ts-node @types/node and ...

Prisma and Google cloud run

Hello guys have you ever run on this issue before: I get this error in the logs when trying to access prisma client "Prisma cannot find the required libssl system library in your system. Please install openssl and try again." This is my prisma config ```generator client { provider = "prisma-client-js" previewFeatures = ["fullTextSearchPostgres"]...

Prisma pulse issue

whne trying to connect pulse got this error, I also tried .stream() method, same result.... I'm using nextjs 15 with server actions Error creating stream: [TypeError: fetch failed] {...

Prisma no data loss migrations

Hi ,Is it common practice to modified the generated sql migration such as replacing drop statements with alter or update statements?

Insert `Map` as `Json`

I have the schema ```prisma model Foo { id Int @id @default(autoincrement()) fields Json...

Will early access members receive an email when free is ending

Hi there! I just wanted to confirm that when early access ends all subscribers will be notified with ample time to ensure they want to continue on their plan?

Compatibility with workers

Hey, is it possible to code a telegram bot using cloudflare workers and prisma postgres - accelerate? using bun as a runtime I'm struggling to do that and I'm starting to have compatibility doubt Thanks...

Check array contains

Hello, what's the correct way to check if an array doesn't have a value? I'm doing this right now but it's not working: ``` await tx.player.update({ select: { id: true },...

Existing Database in snake_case

I'm running db pull on an existing database.... they are come in as snake_case. Anyway to auto convert these?

Random accelerate network error

hello, i'm migrating a big project to prisma, at the moment i migrate my dev environment to make all the tests. I'm using Prisma Postgres on starter plan with a NextJS app and an expressjs external api, both connect using prisma accelerate. Sometime I got this error: ```...