Prisma

P

Prisma

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

Join

Build nightmare BigInts and external prisma/zenclient project not building with TurboRepo and nuxt

I have a nuxt app in a turbo repo monorepo and have followed the instructions to setup a separate /db project in packages. I can get prisma and zenclient to work when I include them as part of the nuxt projecvt, but when I separate them i get the following error when it ry to build: @rhythmic/platform:build: ERROR Transform failed with 3 errors: @rhythmic/platform:build: C:\Projects\rhythmic\packages\db\generated\prisma\runtime\library.js:111:10142: ERROR: Big integer literals are not available in the configured target environment ("es2019") ...

binaryTargets option seemingly not working with bun in CI

When using the setup-bun github action, I get this error with Prisma ```sh PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x". This happened because Prisma Client was generated for "debian-openssl-1.1.x", but the actual deployment required "debian-openssl-3.0.x"....
No description

ِArray of data

How can i let user to add array of data using form

Initialisation of prisma req based nestjs

Respected sir, My passport google strategy requires authservice in and that requires prisma request based service due to this my passport js is not initializing at start of app.... For that ai suggested moduleref of prismaReqBased service anything best service to inject in authservice.... Anything i am doing wrong .. ...

Error During Migration: must be a member of pg_signal_backend in Supabase with Prisma on Serverless

Hi everyone, I’m using Supabase as my database and Prisma (version ^5.15.1) as the ORM in a serverless environment. When I try to execute a migration (npx prisma migrate dev), I encounter the following error: ```...

Migrating data from Railway to new database Prisma Postgres

Hey, i got dump of data from railway, how can i migrate it here? Dump is this fie...
No description

Accelerate cannot connect to Postgres RDS inside of VPC with static IPs configured

Using latest version of Prisma on a node server and Postgres 13 in AWS RDS. We're seeing the error Accelerate was not able to connect to your database. The underlying error is: Health Check of Query Engine timed out. We have an RDS instance inside of a VPC and allowed the static IPs to connect inbound to our database. Do you have any recommendations on how to troubleshoot? Are there internal logs from prisma side that can help us debug?...

Count records where number of related records is greater than X

Hey folks, I'm struggling to figure out the right way to express a particular query. I have a model game and a related model like. A game has 0 or more likes related to it. What I want to get: the total number of games that have at least 5 related likes. Ideally I would do this without fetching unnecessary extra data from the database. Appreciate any help, thanks....

Can't reach database server at `aws-0-ap-southeast-1.pooler.supabase.com:5432

Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma ✔ Generated Prisma Client (v6.2.1) to ./node_modules/@prisma/client in 41ms ...

Gi,Migration 2 shemafiles...schma1.prisma

Respected sir, shema1.prisma and shema2.prisma Fules how to generate migration files for both in seperate folders....what cli command i can use #migrations Prisma folder in that this two files exists.... Thanks...

Using Prisma with Azure SQL Hyperscale

Is anyone using Prisma with Azure SQL Hyperscale? I am running into an issue that when the sql azure scales up or down there is a massive slow down in the application and errors from disconnections of the connection pooling. I am curious how others may have solved this. In .NET's EF they had automatic retry logic but is there an equavaliant in Prisma?...

why update/delete need the 'select' statement to not be empty??

will throw an error: ``` const deletedUser = await prisma.user.delete({ where: { id: 1 },...

Misleading error message: ERR_INVALID_ARG_TYPE

So i was trying to use raw sql but i forgot to account for @map values in my prisma schema so i was trying to update a column with the model name instead of the map name which i should have used in raw sql. However i ran into very weird error. The query itself was pretty simple: `` await prisma.$executeRaw UPDATE "users" SET "pending_actions" = array_remove(pending_actions, ${action})...

Custom/composite IDs as relation references

I am exploring Prisma as an alternative to our current ORM/backend, Parse, due to it not being very well maintained. Overall, the migration is looking pretty clean, but I'm running into an issue around translating the way Parse did relations and the way Prisma does them (this is for a Mongo database). Parse does it by having a relation field (or "pointer") with a composite key string value of ClassName$RecordID (i.e., Author$a43fE3f3) instead of the way Prisma does it where you define the cl...

If I extend create, is there a way to extend createMany as well?

Hi, I'm looking to extend the create method for one of my Models, but is there a way to simultaneously extend createMany? I asked the AI and it said that I'd have to manually update both, but would extending createMany to call create under the hood be a reasonable approach or would it be bad for some reason?

Prisma Pulse development flow

Hey all, am working on implementing prisma pulse, very cool tech. However I'm concerned about the development flow versus a production flow. What is the recommeneded path for this? How should I implement a localhost postgres db to work with prisma pulse?...

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