Prisma

P

Prisma

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

Join

Dbo schema getting ignored in sql server

Hey I try to pull the database via prisma db pull with the following conf `generator client { provider = "prisma-client" output = "../../../../libs/omi/api/prisma/src"...

Prisma queries fail in production

Hello, I’m using @prisma/extension-accelerate with Expo Router API Routes (which run in Cloudflare Workers). I encounter the following error in my deployed API. The strange part is that sometimes it works, and sometimes it doesn’t. I’ve attached a screenshot showing how I instantiate Prisma....
No description

Error P6004 -Query did not produce a result within the maximum allowed execution time of 10 seconds

I've only been getting these errors today and it's a relatively small query of 100 rows. Example request id: 936ecc459e75ced6 or 936e844f69c34595. Would someone from the Prisma team be able to investigate these request IDs and see if the timeout is due to maybe connection pools or something else?...

Next.js and Prisma Issue.

How I can get rid of the prisma generate issue
No description

I keep getting this error Error in performIO: Driver

How do I solve this issue when using npx prisma db push with cloudflare Error in performIO: Driver...

Missing field enableTracing

I'm having a problem with prisma in the production server. It is working fine locally Error: ```thread '<unnamed>' panicked at query-engine/query-engine-node-api/src/engine.rs:76:45:...

Prisma seeding

I'm having an issue with my prisma seeding, idk what is happening, there is no 'g' whatsoever in any place, i've been struggling with prisma my whole week and it just keeps appearing errors after errors that makes no sense, ```// This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema...
No description

Searching by null returns no results

Given an example model like this: ```ts model Item { name: String...

ExpressJs Transactions

Is there a best practices or best way to wrap all requests to an ExpressJS API server in a transaction. I would like to start a transaction for any request going to /api and then either commit on successfully return or rollback if an error occurs. If possible I would like this to be as transparent as possible. Is such a thing possible? Thanks!

Generating Prisma Client

I am trying to better understand how to correctly import the client from https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/generating-prisma-client I have used the new configuration: ```js generator client { provider = "prisma-client-js"...

Prisma 6.6.0: Unable to use Prisma.JsonNull and Prisma.DbNull due to "We could not serialize [object

I have hit a problem that is affecting both dev and prod... on a Friday night. Any help on the GH issue would be helpful: https://github.com/prisma/prisma/issues/26987...

Dmmf in frontend

Hi, I need to determine whether a database field is an array. To achieve this, I’ve created a function that uses Prisma's DMMF. Additionally, I want to associate multilingual labels with each field in the database. For this, I’ve defined a typed object that maps each field to its translated labels....

Prisma Postgres performance

Hey Prisma team, could anyone shed some light on the disparities shown at https://bejamas.com/compare/planetscale-vs-prisma-postgres ? Particularly, the "Cold Query". I've been considering switching from PlanetScale to Prisma Postgres for a while now, and the difference in "Hot Query" seems acceptable (for North America at least), but I wasn't sure what the cold queries were even referring to here, since in most places I've gotten the impression that Prisma Postgres shouldn't have cold starts (not sure if that's different from cold queries)...

How to get proper type for relation from two different include queries.

I'm building a Next.js app for a personal project building a GUI for a sqlite db as a learning exercise. I opted for Prisma here and have been working my way through typing issues. A quick run down of my scheme: player with id and name, deck with id and name, game with id and datetime, anddeck_game with a bulk of the data (in hindsight, not a great name). deck_game has an id, a game_id, player_id, deck_id, and position. How this works is for each game that's played, I track what player was in it, what deck they had, and what position they finished in. So in a 4 player game I'd have 4 deck_game rows matching the game_id, with the player_id and deck_id matching their respective tables, and the position that player/deck finished in. For my app, I've made several Prisma calls with some complicated includes....

Dynamic select column doesn't return the correct type

Hello, I have an issue with a particular query I'm trying to run. I have a relation model called 'Posts' and in this particular query I only want to include posts if a specific condition is met before hand (i.e. condition ? { /* select */ } : false). When doing this the return type changes, seek below result. ```ts const user = await this.prismaService.users.findFirst({ select: {...

Schema Troubleshooting

Hi everyone reposting this, i have a pretty simple Schema with three models. However, whenever i try to push the schema to my MYSQL DB, i keep running into foreign key restraints. I don't see anything wrong with my relations thats causing this to occur. One thing to note is that i did accidentally migrate the schema to my db, but i went and dropped the table and the migration folder. Did I make a silly syntax mistake that i'm missing, or will i need to baseline my db due to migrations being out...
No description

Relations on non unique fields

Hi guys, i'm building a new db and i need it to be multilingual. in order to achieve that i've created a contents table wich will handle every text/image for each language ```prisma model Contents { id Int language Languages...

Upgrade from 6.0.1 -> 6.5.0 broke migrate dev

I recently upgraded from 6.0.1 to 6.5.0, and didn't change any migrations or schema files. But when I run migrate reset and then run migrate dev I am now receiving an exit code of 130 whereas previously I could generate migrations without issue. This happens regardless of if I modify a schema file or not. The output of the command looks like this: ``` Drift detected: Your database schema is not in sync with your migration history....

Prisma PostgresProvisioning stuck?

Hello. Im quite new to prisma, but when I set up a new environment, it just states "Provisioning" and under setup "Almost there! Your database will be ready shortly."Anyone that knows what can cause this? I have 6 environments available in my plan, so that should not be the issue. Thanks!...