Prisma

P

Prisma

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

Join

Will using prisma accelerate with AWS RDS aurora increase my network egress traffic costs?

We're integrating prisma orm, and wondering about if we should also start with prisma accelerate. It looks like we might add network traffic costs to our setup on AWS by going with accelerate as our proxy. I imagine that we could also move to prisma postgres too?

Error trying to generate Prisma Client inside OpenAI Codex Cloud environment. Can't download binary

I'm trying to use OpenAI Codex AI agent (Cloud). I'm new to this (not a big vibecoder myself) but Codex is mostly working. The only thing I can't get right despite having tryied a lot of different stuff is have it successfully generate my Prisma Client inside its cloud container so that it could run the code and test stuff autonomously (I don't mean to really use the client making requests to any database. its just that without the generated client I get TypeScript errors where I'm importing it)....

GetPayload: Make all properties optional on related model

I'm struggling to find a clean way to use the the GetPayload model helper functions with nested relationships without some level of properties being required. We use helper functions to compute dynamic data points (status', counts, etc). For a specific helper function, we attempt to compute a status based on the number of entries in a related 1:M relationship. We do not care which fields are included in the array of related objects, just that the array itself exists. I've included several examples below using a standard users->posts relationship to demonstrate the issue. In each case below, all fields are required. ```typescript type UserPosts = Prisma.userGetPayload<{...

Run `prisma dev` programmatically

Is there a programmatic function to have run prisma dev (local postgres db) programmatically? Thanks.

Prisma website crush

Hi, when entering prisma website it randomly freezes and throws this error: TypeError: Cannot read properties of undefined (reading 'length') at main.c4a49258.chunk.js:1:8629...

Is there any way to close existing connections?

Like the title says. I've hit the limit and because app is deployed trough vercel I can't close these connections anywhere through vercel or prisma.io. Is there any way I could close these zombie connections?

Timed out fetching a new connection from the connection pool.

can someone actually give valid solution to An error occurred while trying to interact with the database, nothing i try works, im sure my service makes quite a lot of db requests, not sure how to see that inside of postgres or such, but how to fix this for once, it spams them like thousands

prismaSchemaFolder Pattern?

Hi, do I need a .prisma file every time I encounter a folder structure of prismaSchemaFolder? Based on the example below, (a,b).prisma fails to read the model of c in (a,b).prisma. The services folder does not have .prisma. The services folder subtest folder has .prisma....

Does prisma make a query even though the value is null?

For example I have the following table that has connection to many model FileJob { id String @id originalName String? createdAt DateTime @default(now())...

Unknown Accelerate usage

Hi, for work I created a Vercel Prisma Postgres integration (free tier for now). I then connected to the direct postgres database (without accelerate) in my nestjs app. Everything was fine until I got quota alerts and now it has reached the limit. When I was looking at the dashboard when it was still working, I could see ~20k accelerate operations per day. So I'm not sure where the operations are coming from (since I don't use accelerate for my app). What am I missing?

select 1 queries in production

Hey all, I'm trying to track down an inconsistency between dev and prod environments - I'm using Neon postgres, and I'm finding that in my production environment, Prisma is running a SELECT 1 query about every 5 seconds, but it doesn't seem to happen at all in development. I haven't been able to find any options about enabling/disabling this behavior, and I'm having trouble even figuring out what's triggering it it one environment and not the other. This looks like some kind of connection health check, but it's causing the connection from my application to Neon to never go fully idle, which means I'm winding up paying for uptime usage when it should be spinning down to zero when inactive. ...
No description

Structuring a file system for permissions

Hello, I have an application with many modules like Course, jobs etc, and each one has files. I have a table that holds the "metadata" of a file like if it belongs to a course, a job or job application etc, and I have to check if the one accessing the CV for example is HR or the user that applied. Right now the table FileMetadata has a lot of relations (to every other resource that I have, like course(videos/photos), job application, job (photos in it), etc). Is this the right approach? I need pretty granular permissions, because an user can't access the files from a course/section he is not enrolled for example. This really bugs me because it seems there could be a better aproach but I don't see one. So Filemetadata is really the key from AWS, the name and a lot of forignkeys from different tables This would be an idea of the file metadata: model FileMetadata { id String @id @unique...

No sign of Branching / Environments

I am new to Prisma Postgress (from Neon), and I don't see any sign of branching / db environments in the dashboard / console. On vercel I have a staging branch and a main branch. How do I deploy these to separate dbs under the same project? Ordo I have to create two projects? ...

Console errors. Dashboard frozen on web.

I just joined Prisma Postgres some minutes ago, and I am already disappointed. The dashboard is frozen and I can't click or scroll, or do anything. When I refresh, it works for like 3 seconds then freezes again. See screenshot....
No description

TypedSQL - Boolean Argument Documentation

According to the docs, boolean values are converted to TINYINT(1) in MySQL, https://www.prisma.io/docs/orm/overview/databases/mysql#native-type-mapping-from-prisma-orm-to-mysql. However, TypedSQL converts boolean js values to strings, like 'true' and 'false'. This leads to consternation when trying to craft where clauses.

Create query causes whole server to hang

Hi, we have two rather complex and deeply nested create queries in our project that when ran cause our complete Next.js server to hang. It doesn't crash with any error, it just never resolves and stops everything else from working. I am already looking into what specific part of the queries are causing this, but I wonder if its a known issue that it causes the whole server to hang....

Still not solved: Prisma can't find multi-file-separated models in 6.14.0

I am on version 6.14.0, followed all the instructions to add a typescript config file and remove the package.json instructions and ended up with this setup where it is not finding any of my models and it just dropped all my tables when migrating. Here is my setup: This is my exact file structure: ``` yda-web/...

`@prisma/client/runtime` size is big(bigger than rust-engine version)

Hi! I have a question about a preview feature no-rust-engine . We use Prisma ORM on AWS Lambda function. I updated Prisma version to 6.14.0 from 6.6.0 and setup configuration to use runtime, hoping that this will reduce the total size. Turned out the size actually increased. As seen in the screenshot, the node_modules size is around 100MB. I narrowed down the directory and found that runtime has many files that are not relevant to the project (we use postgres) should these be removed manually to reduce the total size? ...
No description

Why does Prisma add :5432 to Unix socket paths for Cloud SQL connection

Hi! I'm trying to use Prisma with Google Cloud SQL Unix sockets on Cloud Run, and I've discovered that Prisma is automatically appending :5432 to my Unix socket path, which breaks the connection. What I'm using: bashDATABASE_URL="postgresql://postgres:password@localhost/postgres?host=/cloudsql/project:region:instance" What Prisma tries to connect to:...

Need Help

I am using prisma orm. Locally everything works fine but when i deploy my project to the vercel and test it returns this error. What is the issue and how to solve this? my project is in next js
No description
Next