Prisma

P

Prisma

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

Join

tabla

in the final packaging of my backend with espress and prisma into using the schema and the sqlite database, both are synchronized but when I try to use my database it tells me that it does not find the table main.Usuario but my table is only called Usuario, maybe this is the error but how do I fix it? ``js PrismaClientKnownRequestError: 0|bundle | Invalid prisma.usuario.findFirst() invocation: 0|bundle | The table main.Usuario` does not exist in the current database....

Hello every one,Add Accelerate to my application with PrismaService class (extend PrismaClient)

Hello every one, I'm having the problem Add Accelerate to my application: PrismaService.ts ...

I have a nested create many query I am getting Unknown argument 'QuestionOptions'

(v5.17.0)CockroachDB , I restarted the application I have removed all migration. I have re-migrated the data again. and push the data. But I'm still having this problem...

Prisma doesn't see .env.development

Hi! I want to seperate my dev and prod env on my NextJS project. NextJS follow this rule by default, next dev use .env.development and next build use .env or .env.production. But Prisma doesn't follow this rule. When I want to migrate/generate prisma-client on my test env, that DB URLs located at .env.development, Prisma always use .env, and tries to connect prod database. My package.json file scripts look like that:...

Solve optimistic concurrency issue without adding a `version` field

Question In the following page there is a suggestion how to solve concurrency issue by adding a version field and ask about it in the where clause when updating a model: ```js...

Finding model constraints in code

Hello, I'm looking for a way to find the foreign keys of a model in the Prisma client. Not by typing but in JS. I can't find anything, even after digging into the engine...

Recursive CTE

Hello all, I'm trying to make a recursive query, but I'm not sure where to start? I have something like the following model: ```js model Role {...
Solution:
I'm not sure I'm too satisfied with the answer, but I ended up writing a view to solve my issue, and then use seed.ts to ensure that it exists.

Is there any way to avoid this cast?

``` public forProject<T extends Prisma.unified_applicationDefaultArgs>( projectId: string, payload?: T, txn: Prisma.TransactionClient = this.prisma...

I have a nested create many query I am getting Unknown argument 'answers'

(v5.16.1) CockroachDB , I restarted the application I have removed all migration. I have re-migrated the data again. and push the data. But I'm still having this problem...
No description

Getting P2023 When getting params

I am getting this error message when getting params with the id: ``` code: 'P2023', clientVersion: '5.17.0', meta: {...

$use but instead with $extends issue

Hey! i am trying to use $extends but i am having an issue here, here is what kappa told me and it worked perfectly: ```js...

migrations folder

is there a way to have 2 migrations folders?

Cant add data to user table

Hey, Im just making a simple Gemini Nextjs App but the logic for adding additional credits after stripe payment isnt implementing Basically I want to create a user if it doesnt exist or update the user if it exist https://github.com/Raunak0713/AI_Content/...
No description

unrecognized keys some

I'm trying to write a query that returns a list of users where any of them have a related record in another table. It seemed that "some" would get me what I need based on the docs, but I'm getting an error about some being an unrecognized key.
No description

Nested relation query help

Hello, I was trying to query users, then I added the implementation to show payments but now I realize it was bringing payments of all users from the membership instead of bringing all payments of that specific user for each specific membership. Is there a way to do this query in the same object or is there a way to reference the current user for each index of the array? ```prisma.user.findMany({ orderBy: { id: 'desc', },...

Pulse local development + static IPs

two questions - What are your recommendations for connecting local developer environments with Pulse? Is there any kind of Docker emulator or something that we can use? - Does Pulse have static IPs? I see that's available for Accelerate but can't figure out if it is for Pulse...

Error: 🟥 @prisma/react-native failed to initialize, js engine: hermes

getting this error message for expo da prisma connection db.ts in root directory ...
No description

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