Prisma

P

Prisma

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

Join

Pulse Type

Is there a good way to get the type of a Prisma Client instance with Pulse before instantiating it? For context, I have a class that will eventually have a member populated with a Pulse DB instance: ```ts...

Serving HTTPS from Prisma Client

I'm currently trying to spin up an AWS EC2 Instance with my Prisma Client Code base. I have it connected to an AWS RDS Instance and was able to connect and migrate to that. But my EC2 instance for the API has an SSL Cert and I have an A Record and CNAME set up for an HTTPS endpoint, but when I curl against the endpoint I receive: ``` Connected to URL (IP) port 4000...

Prisma migrate deploy doing modification in node_modules after upgrading prisma

Hello, I have updated prisma from 5.17 to 5.18 I have doing npx prisma migrate deploy in a docker image with limited right In 5.17 i had no issue doing this but after upgrading to 5.18 i have this error: Error: Can't write to /home/node/node_modules/@prisma/engines please make sure you install "prisma" with the right permissions. I can't allow my user node to do modifications inside node_modules and i don't understand why this command is now doing writes...

index without preview feature

Howdy, I have a user model that I frequently search on with where {}. I wanted to improve performance and read about indices with postgresql. I found that this is a preview feature on the docs, but my handy AI assistant claims I can just do this: ``` model User { id Int @id @default(autoincrement()) firstName String...

why does prisma never read from main db and always from replicas?

we're barely seeing any traffic on our main db, but both replicas have 80% cpu utilization. why is the load not getting spread? I just reset both replicas at the same itme and for some reason the entire website went down, which sshouldn't happen if prisma were reading from main ```import { PrismaClient } from '@prisma/client';...

Getting `Can't reach database server ` long after DB load has dialed down

Hi, We are using prisma accelerate. Somehow we are getting this error, DESPITE our db being completely accessible through other tools (like psql and dbeaver etc). There was a heavy load at 13:30 GMT but it has been more than 1 hour since that and we still continue to get this error....

use datatype set

Hey i got some questions i wanted to use the datatype set for sql but i saw it is not possible anywork arrounds? Permissions set('WRITE','READ','ADMIN','DELETE','SUPERADMIN','BLOCKED') NOT NULL,...

self-relation

Greetings! Could someone help me? I haven't been able to understand this. I'm checking the followers and following of a user and everything appears correct in my db, but then when I check it the result is reversed. Any idea why? That 1 should appear in following and not in followers.

Share prisma schema and client between two backend services.

I have this backend project where I am creating two services both running on different port e.g httpService , wsService. Though I am challenged with handling prisma between the two services since they are going to rely on the same database, I think they would need to share the prisma client and not to have challenges with manually updating the schema from one service to another. Below is my file structure, whenever I try to run prisma it tries to create a package.json in the root folder which I don't desire. How can I share prisma client between to services running within different docker containers? ``` backend/ ├── docker-compose.yml ├── httpServer/...

Default value not working inside a type

Hello I am having a small problem with prism. Basically I can't put default values on the types, as you can see from the screenshot I have inserted a new temporary user and this user has null in the column where that type should be. "@prisma/client": "^5.17.0" "prisma": "^5.18.0" ...
No description

Prisma Client did not initialize yet

Hi, I am getting the error shown in this image. But when I run prisma generate I get this error: The "path" argument must be of type string. Received undefined
No description

Is it possible to run "prisma generate" without internet connection?

Hi! I'm running prisma on a machine, which is without internet connection. When I run "npx prisma generate", it needs to download the engine from internet. So i get an error. Any option to pre download the prisma.sh and move that to the offline machine then tell prisma generate to use that pre downloaded binaries?? Thanks...

Get part of a text from DB with Prisma

Is there a way to get the first 50 symbols from a String column content instead getting the all content of 300 symbols for example. I know there are ```sql SELECT LEFT(content, 50) AS preview FROM your_table; SELECT SUBSTRING(content FROM 1 FOR 50) AS preview...

unique constraints

How to tell prisma that I want only one image with isPrimary set to true but also allow any number of images with isPrimary set to false for the same drugItem? ```ts model Image { id String @id @default(auto()) @map("_id") @db.ObjectId createdAt DateTime @default(now())...

Prisma-to-sql

Is it possible to convert smt like model.findFirst({ ... }) to sql so i can combine it with a custom sql query? Or make a .findFirst() with AND Query, where 1 query is RAW SQL?...

any fix/status for this bug? https://github.com/prisma/prisma/issues/24475

can someone please give me an update on this bug? there has been no movement on this for a couple of months now..thx

I encountered an issue where the database operation in Prisma results in an indefinite wait time.

Hi Everyone I am stuck in a issue. I have build project in NestJS, GraphQL using Prisma ORM (PostgreSQL). On my ec2 machine, the database query goes into infinite loop, when I check in my playground, it is still loading, response not coming from the database server. When I check my same connection using my database client (DBeaver) it is working I can fetch the records there. But it is stucked on my server. When I check my rds logs, I can see one line "could not receive data from client: Connection reset by peer" Don't know why I getting this kind of issue, I didn't face this issue in any of project. I checked the RDS, the CPU utilization is normal is upto 6% and active connection is between is 5 to 10. Anyone can tell me what is the exact issue....

Prisma Pulse for Microsoft SQL Server

Is there any roadmap for offering Prisma Pulse for Microsoft SQL Server? Thanks!...

Read Only database

Hello my application is build with blitzjs. I'm having trouble using the read replica with enhancePrisma(PrismaClient) because it doesn't expose extends method and I use it because thats how blitz integrates with prisma and I get an error when trying to just use PrismaClient()...So my goal is to have my main write database and read only database for certain queries. I wanted to know if there is another way to use read only databases than read replicas?