Prisma

P

Prisma

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

Join

Nothing is written in a SQLite database when i try to insert anything

I don't understand why this happen
Solution:
I forgot to await await prisma.test.create({ data: { skibidi: "ohio" } });
No description

Querying a SQLite database will just hang forever

Why ?
Solution:
Solved: I had to install a matching version of @prisma/client and prisma client. ```json { "name": "", "version": "1.0.0",...

Error when updating Record

I just set up prisma postgres and when I try to update a relationship I get the following error. PostgresError { code: "55000", message: "cannot delete from table \"_LocationToLocationType\" because it does not have a replica identity and publishes deletes", severity: "ERROR", detail: None, column: None, hint: Some("To enable deleting from the table, set REPLICA IDENTITY using ALTER TABLE.") how to fix this using prisms ORM?...

Migration File Accidentally Deleted

1. A developer created changes to the prisma.schema file and commited these changes to a supabase database 2. The developer deleted the migration.sql file in the migrations folder before committing it to version control. This file is unrecoverable 3. We are now unable to interact with our database...

new optional field failing

introduced a new column into one of my models model MyModel { ... myKey String? @default(uuid()) }...

Dockerize Svelte with Prisma

Hi! Is there any example or recommendation on how to create a Dockerfile for a Svelte 5 app using Prisma for Supabase? I keep getting the error: /app/node_modules/.pnpm/@[email protected]/node_modules/.prisma/client/default.js:43 throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); ...

Soft delete & include

I recently impemented soft-delete with prisma ClientExtentions and it works wonderfully, but: When handling relational joins I cannot simply add a {where: {isDeleted: false}} to every include statement with a deep patch function, cause to-one relations dont have where. Is there a generic way to add a where statement to every include?...

enum @map value

I have this enum mapping but it doesn't generate the same value instead it uses the key as the value. ```ts enum Gender { MALE @map("M") FEMALE @map("F")...
No description

Psql Timeout connecting a new connection from collection pool

Hello, I used to get this error like a couple of times a day, which would crash my whole server. Today, it's been happening way more often. As soon as I start my server, my CPU usage goes too 100% and after a few mins, my servers crashes with the same error My chat app has like 1.5k users. Is there anyway to troubleshoot why this is happening?...

Seeking Work

I'm a US citizen looking to immigrate to Germany, and Prisma was suggested to me as a good place to look for work on my way in. I hope this is not a bad place to ask as I couldn't find a contact us place on your website. Looking forward to hearing from you, thank you!

Unknown argument...Available options are marked with ?.

Hello, I'm facing a problem while seeding my database. I have an implicit many-to-many relation table, and when creating one of the tables, I want to connect some existing rows from the other table into that one, like this: ```javascript const invoices: Prisma.InvoiceUncheckedCreateInput[] = []; const list_aimis: {id: number}[] = faker.helpers.multiple(() => {...

Prisma Sentry Tracing

Why does prisma sentry tracing looks like this? What is this http request supposed to be? I see it all the time but with different ports. Is this the way the application communicates with prisma engine?
No description

Cannot create a JSON value from a string with CHARACTER SET 'binary'

Hello, I am using Prisma with Planetscale, and today, for some reason, some of my schemas using JSON are encountering the error target: stickyqr.-.primary: vttablet: rpc error: code = Unknown desc = Cannot create a JSON value from a string with CHARACTER SET 'binary'. (errno 3144) (sqlstate 22032). Everything was working fine yesterday, but this morning I ran into this issue. Nothing has changed, and I am not sure if you have any ideas on how to fix this problem?...

Migrations taking too long

Hi, I'm rewriting this since I think I may have written in the wrong channel, sorry. I've followed the instruction to create a baseline migration as shown here: https://www.prisma.io/docs/orm/prisma-migrate/getting-started This works good but now when I try to create a new migration it takes forever (~15 mins) to run (pnpm exec prisma migrate dev --name testing) I have to say that the database is around 70 tables and is running in a docker container using the official mysql image....
No description

Migration creates Implicit relational tables in database for an explicit M-N relationship

I have created two models, Parameters and Tests. Also, there is a model that defines explicit M-N relationship between these models. When I migrate the schema to database, it is also creating a table "_ParameterToTest" in the database, that is usually created for implicit relationship. How do I avoid creating this database? ```js...
Solution:
Hi @Faiz Khatri 👋 In your schema, you have defined an explicit many-to-many relationship using the ParametersToTests model. However, you've also defined an implicit many-to-many relationship by including Parameters Parameter[] in the Test model and Tests Test[] in the Parameter model. To avoid creating the additional _ParameterToTest table, you need to remove these implicit relation fields and rely solely on your explicit relationship through the ParametersToTests model. ...

Creating Custom Thumbnails: Overcoming Background Skin Upload Challenges

I want to use my bg skin for making thumbnails but we can't download it, and if we can't download it , we can't upload it on prisma app , I used screenshot but it shows up laying on the floor , i want a 3d character, so that can give them a pose and use other tools to make it attractive, so the main problem is how should I upload my bg skin , the photos below are my inspiration...
No description

How to derive a type from types generated by Prisma?

Hi, The following TypeScript code snippet is working where I'm able to derive a type X from the query result from Prisma. ``` const rows = await prisma.role_users.findMany({ select: {...

Can't delete records from Prisma Postgres in Studio

I haven't been able to delete data from the new Prisma Postgres within Studio--neither a single register nor with a rawquery using prisma client. The error I get is: ```Type: undefined...

Prisma and Hono on Cloudflare Workers

Hello everyone, I am trying to connect with database using hono and prisma. Current Configs: .env ```...
No description

Using Prisma Client (and libquery engine) on AWS SAM without Layers

Hi, I am trying to get the Prisma client libquery engine to work directly inside the Lambda. I have one root package.json where I install prisma deps, and I am trying to import the engine with import x from '../../node_modules/.prisma/.../.so.node, but that was giving me issues unable to resolve the module or find type declarations. Then I tried to use tsconfig.json to set up some paths for it to find the engine file, but no success. That is, whenever I would run sam build I would get the schema.prisma in the build folder but not the libquery...so.node. I eventually stumbled across the idea to change the output folder (/generated/client) to the same local folder (i.e. src/common/prisma) where I have my schema.prisma and now I get the libquery engine as part of the sam build. The issue now is Im getting errors with Dynamic require of "fs" not supported as I have set up my project to use SAM's built-in transpiler using ESM format. I'm not sure where to go to get this setup working. Is it even possible to use Prisma directly with Lambdas and with Layers, or should I be very strongly considering using a Layer to get this working?...