Prisma

P

Prisma

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

Join

Error Initializing Prisma on Expo

I've created an Expo project which I am trying to connect to Supabase via Prisma, but I get the following error after bundling on my physical device: ``` ERROR Error: 🟄 @prisma/react-native failed to initialize, js engine: hermes at ContextNavigator (http://10.0.0.213:8081/node_modules%5Cexpo-router%5Centry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=app:144849:24)...

Does Accelerate support MSSQL?

Does Prisma Accelerate support MSSQL? I don't know if I set it up right, but I ge the following error, when I try to configure MSSQL in accelerate and then setup the client/edge in my application:
Unknown server error: {"type":"UnknownJsonError","body":{"code":"P6000","message":"Something went wrong."}} (The request id was: 88b049569d096dc7)
Unknown server error: {"type":"UnknownJsonError","body":{"code":"P6000","message":"Something went wrong."}} (The request id was: 88b049569d096dc7)
...

[FIXED] Error when providing certificate

I'm passing the certificate in the url, but it doesn't work. My project tree is this: ``` ā”œā”€ā”€ src...
Solution:
I added the file to the NestJS CLI assets configuration and decided to test the full path in the dist folder (sslcert=/app/dist/infra/db/prisma/cert/global-bundle.pem) and it worked.

dmmf in prisma 5

I'm loading a prisma model metadata like this in prisma 4: let currentModel = Prisma.dmmf.datamodel.models.find(m => m.name === model) It seems Prisma.dmmf is undefined in prisma 5. I need it in filter string parsing, to find out whether a certain field is a list, so that I can nest it within "some" prisma filter construct. Any suggestions as to what I can use in prisma 5 to achieve the same?...

How to ignore custom migtation script without reset all data?

I cant create new migration without resetting the data if i do this

Null, Undefined, <form><input>, Zod validation and query result type mismatches.

I have a problem that seems complex to me, and can't figure out an elegant and scalable solution: I use Zod, Prisma, mySQL and React. I define my Zod schemas, that are 2-3 layers deep with .optional() properties in each layers. .optional() in zod translates to the undefined type in typescript....

P3009 error on deploy

Hi im facing a strange issue with this error: Error: P3009 636migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve 637The 20240528074437_rmv_clothing_table migration started at 2024-05-28 09:07:03.450140 UTC failed...

Queryraw condition joining

I need to use a procedure and then filter on this from a sqlserver database. I am having some issues constructing a query that is dynamic and safe. Prisma.join is only for joining values, but how do I join conditions? What makes it complicated is that the conditions are dynamic filters. Some some may be present or not. Example ```typescript...

prisma accelerate can I connect to my database?

My database was made locally. The database functioned as intended when I tried it without acceleration. but acceleration is necessary for my authentication. I am using auth.js V5 The latest version of prisma accelerate next.js...
No description

Any expected SDL-First generator with CRUD abilities?

Hi guys, I really like Prisma and I want to use it with GraphQL, the thing is, I want to generate automatically all CRUD operations based on my schema, and the only valid option right now is to use TypeGraphQL, and I prefer to use Schema First language, will there be a generator for that?...

SET UP PRISMA ON EXISTING DATABASE?

I am unable to create migration, everytime it is asking me to reset my database

Disable CLI ads

Hi, I was just wondering if there was a way to disable the Prisma Accelerate ads when running prisma generate This command is part of my CI and I would like to keep it as simple as possible, and Prisma is the only package to display so many things I understand why this is here, Prisma ORM is free, and you're promoting your own stuff to gain money, fine. However, I was hoping there was some kind of config, or maybe an environment variable to turn it off?...
Solution:
Hey @rdx šŸ‘‹ At the moment, it's not possible. I would recommend you to subscribe to this GitHub Issue to get updates about this: https://github.com/prisma/prisma/issues/22513...
No description

Extend client Type loose relation

Hey there, i'm having some trouble when I extend a Prisma client type (in typescript). I have a User, which have a oneToOne relation with a Preferences model, looking like that: ```prisma model User { id String @id @default(uuid())...
Solution:
And adding them manually would have force me to explicitly define all Preferences properties too, since the prisma findUnique function doesn't return a Preferences object, but a custom object based on my query (from what I understand), so the object is not Exactly like the Preferences object would be. Here is what i done for my issue: ```typescript export interface UserWithRoles extends Prisma.UserGetPayload<{ include: { preferences: true } }>{...

Nuxt 3 - Prisma building production

Hi Guys, it seems like I am havcing issues with my Prisma sections of my system working once i build and run my application. Just wondering if there is another step I am missing as it works fine when doing it on my dev server using pnpm run dev. Thanks in advance...

Use orderBy based on the field that is coming from nested one to many relation

Hi. Is there a way for me to use orderBy based on the field that is coming from nested one to many relations. I just saw _count when try to use orderBy in this case. I do know that we can use SQL raw query to do it but I just wondering if there is other way to it as well?

403 - Forbidden when running "npx prisma generate"

Solution:
I've tried everything to solve it. Reinstalling, switching OS, nothing worked.

PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware

I created a next.js (14.2.3) app and followed Auth.js documentation to add Goole OAUTH and prisma database (schema successfully initiated), now when I click "Sign In with Google" I see the following error in console: ```TXT [auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror [auth][cause]: Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware. In order to run Prisma Client on edge runtime, either:...

How to manage shared Prisma types in serverless frontend/backend apps

Hi! What are the best practices for using Prisma with a serverless architecture? I've already read docs on deployment, my question is more around development workflow of generating types since i'm using TS. I'm using Prisma Client exclusively on the backend, but I'd like to be able to access the generated types on the front end. Should I use a top-level shared-types directory / package that uses Data Transfer Objects? or is there a better way?