Prisma

P

Prisma

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

Join

Type 'string[]' is not assignable to type 'string'.ts(2322) when trying to create a form using Prism

so I'm trying to create a submitForm using prisma, react-hook-form and zod and mysql as my database. But the problem I'm encountering right now is I get this error on form-submit.ts Type 'string[]' is not assignable to type 'string'.ts(2322) I know this comes from my schema.prisma, because upon reading the docs, on Scalar https://www.prisma.io/docs/orm/reference/prisma-schema-reference#-modifier ...

Strange @relation fields in auto-generated models

Using [email protected], I ran npx prisma db pull to generate models for an existing SQLite database. It generated these models: ``` model chapters {...

I feel this is simple but I fear i've just been at it too long I'm starting to not see straight.

I have a parent record with a many to many relationship with a child, such as: ```js model User {...

findMany query is failing as it's breaching planetscale's 100k limit but rawquery is working fine

Is findMany fetch all records before it applies distinct condition? await prisma.table.findMany({ distinct: ['field'] })...

Pulse listening to all schemas in my RDS instance

I want pulse to only subscribe to changes within one schema but it gives me changes of all schema, is it intended? how do I fix it?

How to avoid resetting the DB when switching between branches with schema diffs

Hello, We are a small team of 4 working with prisma every day, and we often have to switch to the branch of a coworker to review their work. But doing so, we need to reset the DB to migrate their version of the schema if they made change to it (while we also made some changes on our end while working). ...

Connecting prisma with mongodb issue

Hello, been following docs, used nextjs and i get this error.

Deploy on GCP

Hey, i'm deploying my NestJS application on GCP cloud run, using Prisma, but I still have this error : The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information. However, I did what was necessary regarding environment variables, here is my entry point in NestJS : ...

mysql table collation

I have a database with the default collation set to utf8mb4_0900_as_ci because i need case insensitivity but accent sensitivity. I noticed the default collation set by prisma is utf8mb4_unicode_ci. is it safe for me to manually change to the collation i need without breaking anything in Prisma? Or is there a way to have prisma set a specific collation for new tables?

Reason why relation is giving an error when id is provided

Hello im trying to create a new row but even when the id is provided it gives an error `` 2024-05-01 23:58:55 Invalid prisma.entryAlternativeTitle.create()` invocation: 2024-05-01 23:58:55 2024-05-01 23:58:55 {...
Solution:
some wierd artifact i removed node_modules and prisma generated and it fixed it

Temporary table support?

Hi, I'm trying to create a temporary table. My sql works fine via mysql cmd line, but not via prisma client. Any idea what is wrong? sql: CREATE TEMPORARY TABLE TempA AS SELECT ra.a,...

No models defined

Hi everyone ... I'm following the quickstart from here https://www.prisma.io/docs/getting-started/quickstart and getting this error You don't have any models defined in your schema.prisma, so nothing will be generated. Schema is definitely there and has a model defined....

Pulse import not recognized / types not working in Next.js project

Pulse is causing type issues when imported specifically inside of Next projects, hasn't happened for me in regular Node projects. The code itself actually works when run, but it causes a litany of type errors because the .subscribe function isn't applied to the client's types. To repro:...
No description

Error with correct Model

I getting as problem in IDETS2353: Object literal may only specify known properties, and 'canal' does not exist in type 'PostSelect<DefaultArgs>' and error (it's lower) ```ts // My piece of code const customId = "15"...
Solution:
i just had output in my scheme

Prisma throws an error with code 2F005

When running an upsert, prisma throws the following error: Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "2F005", message: "control reached end of trigger procedure without RETURN", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })...

Error on prisma Client

at async l (/opt/render/project/src/node_modules/@prisma/client/runtime/library.js:127:11167). I am getting this error

invalid invocation prisma.paypal.findMany()

I'm quite confused by this error since it only happens at runtime when deployed. Cannot recreate locally. We have a findMany query that is throwing this error: Error converting field "date" of expected non-nullable type "String", found incompatible value of "2024-04-28 00:00:00 +00:00" This is the model:...

Prisma Query

Hello I'm trying to create a search logic using nest js and prisma, `` async searchConsumer( prisma: Prisma.TransactionClient, query: SearchAccountQuery,...

Prisma stores invalid data

when trying to store a big int like my discord user if which is 229368888486395905, when prisma stores the number, it is different to what my id is! This is what it stores: 229368888486395900

MTI key relation

``` model Supertype { id Int @id @default(autoincrement()) Subtype Subtype[] }...
Solution:
Hi :vmathi: This looks correct to me. Did you get any issue with it?