Prisma

P

Prisma

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

Join

Issues with prisma docker deployments

Hey, locally i am able to use prisma well, but when i deploy to docker, issues start popping up, like this one: ``` 2024-07-22 22:57:55.535
PrismaClientValidationError:...

Dynamic Filtering items with prisma and Nextjs?

Oi everyone! I use prisma in combination with Nextjs and mongodb on a project that deals with animal adoption. Namely, now I would like to do dynamic filtering by certain categories and enable it to interact with the user on the client side. Well, I'm interested in whether it's feasible to do it using prism, since I found out through the documentation that I can filter out certain things via the where: { } query. Any help and suggestions on how to do this are welcome. Thank you all!...

creating a record attempting to update it shortly after causes error

The code provided in the screenshot gives me this error `` Invalid prisma.hosting_ticket.update()` invocation in D:\Coding\Birdflop\botflop-panel\src\functions\tickets\createTicket.ts:84:33 82...
No description

Not updating types

i made changes so i go db pull and its not updating types....
No description

docker container problem

Hi i always got this problem when running docker container with prisma, what should i do?
No description

Help with findFirst and none relations

I'm working on seeding my database for a self storage and I'm trying to randomly select a customer with no leases and assign them a lease. This is my code and it's alway returning the same customer: ` const customer = await prisma.user.findFirst({ where: { customerLeases: { none: {}...

Can't see relation field in Types

Hi, How do I make stages visible in my code? (What I mean is in the image attached, stages doesn't appear on the types for ProjectPage.) ```ts model ProjectPage {...
No description

Help with multiple prisma clients in a turbo monorepo

With the original Prisma setup in my production turborepo with 2 nextjs projects I, ran into an issue where after postinstall prisma generate overwrote each other iniside the node_modules . Therefore I found my exact issue here https://github.com/vercel/turbo/discussions/3493. and applied the fix that was mentioned here https://github.com/vercel/turbo/discussions/3493#discussioncomment-7090955. Now my project seems to build fine locally and it also build fine successfully on vercel. But when i to a page that has a db fetch it fails with th e following error. ```...

At what point is a query used up from the 60k

Is one consumed to get it into the cache or is one consumed per retrieval in the code

Contacts: error combining many-to-one with one-to-one on the same models

I'm just getting started modeling with Prisma and quickly hit a case I can't find help for in the docs. I want a Person to be able to have any number of Contacts, but exactly one primary Contact. My incorrect model looks like this: ``` model Contact { id Int @id @default(autoincrement()) email String...

Getting error when using Prisma Optimize

I am getting the below error when running my server with Prisma Optimize: ```ts PS C:\Users\william\Desktop\GitHub\test> npm run dev ...

How do the accelerate and read replica extensions interact?

If I have accelerate configured and working then add the read replica extension with a direct URL to a read replica I am assuming all reads would bypass accelerate right? What if I put another accelerate URL in the read replica configuration? Do write go to the one accelerate project and read go through the other accelerate project? Thanks!...

property 'data' does not exist on args when using $extends

Basically I was trying the method provided in the solution of this stack overflow post https://stackoverflow.com/questions/77435838/hash-password-in-prisma-orm whoever when building the index.ts file I get the following: ```src/index.ts:12:62 - error TS2339: Property 'data' does not exist on type 'UserFindUniqueArgs<InternalArgs & DefaultArgs> | UserFindUniqueOrThrowArgs<InternalArgs & DefaultArgs> | ... 13 more ... | UserCountArgs<...>'. Property 'data' does not exist on type 'UserFindUniqueArgs<InternalArgs & DefaultArgs>'....

NPM network error only when trying to fetch Prisma

I am using node:20.15-alpine image with docker compose. I recently deployed a similar project without Prisma and it worked. I have confirmed its not a network error by pinging the registry. I will post the error and and compose files to follow.

updateMany fails with "You can't specify target table 'Org' for update in FROM clause" error

For the following schema ```prisma generator client { provider = "prisma-client-js" }...

How can i implement Prisma Client as shared package?

i want to make npm package out of the generated prisma client so that my other apps can use and install the package and access the database is that possible?

@relation field referencing a compound id

Is there a way to have an @relation that points to a compound id on another table? Consider this scenario: https://www.prisma.io/docs/orm/prisma-client/special-fields-and-types/working-with-composite-ids-and-constraints ...

Slowness issue when using Supavisor connection pooling with Prisma

Hey Prisma community, I've set up Supabase Supavisor connection pooling on my Supabase project but it turns out that the request is abnormally slow with Prisma when I use supavisor. I compared the time it took to make a request with console.time and the result was clear. The tests are done locally with a remote postgres database hosted on Supabase with Supavisor enabled. I have the latest version of Prisma installed Here is my connection string in my .env...

unexpected message from server

Hi all, we see this error pretty randomly
error in connector: error querying the database: unexpected message from server
I try to replicate with the same query, but the error persists. Is this the kind of error wherein it makes sense to implement some kind of retry logic?...