Prisma

P

Prisma

The official Discord for the Prisma ORM and Prisma Data Platform! Learn more at https://prisma.io

Join

Deploying migrations

Hi guys, Hoping someone can sanity check me on this. Currently in the process of trying to figure out how to run migrations in production - my prod DB is a fork of my local DB, so it will have records from previous migrations that I ran in development. I no longer have access to those original migration files (they weren't committed to git). What's the best way to proceed here? I ran migrate dev in my local environment and it generated a single migration file, but I'm obviously a bit hesitant to just run migrate deploy in my pipeline considering my setup....

snaplet/seed with prismaSchemaFolder

I can't propperly get snaplet/seed to work together with prismaSchemaFolder snaplet/seed will only run when I define ```json "prisma": { "schema": "prisma/schema/schema.prisma" },...

Configure new database connection

Hello Team, I wanted to create another DB string but option is not visible, please checl https://prnt.sc/8xongBGZ-uyG I am waiting feedback...

Is "daisy-chaining Extensions" a good practice?

Hi, I need to execute many dependent processes upon "update" of my "users" table. For that, I understand the best option is to use Prisma Extensions. However, since each of these processes requires a fair amount of code, I'd like to separate them in different files, in order not to put everything inside the query.ysers.update block ``` query: {...

how to remove `| null` from relations in relationMode = "prisma"?

I appreciate that these relations arent enforced at the DB level, and so prisma doesn't know if they exist, but it doesn't make sense to for my backend to have to check all those relations on every query. I know if we used relationMode = "foreignKeys" that this woudn't be an issue, but due to other factors we aren't able to use this mode. I know that these relations prisma is marking as nullable will exist, and I would be happy for prisma to not make those relations nullable....

@prisma/nuxt with bun stuck on generating prisma client

I'm using bun to development my site. When I tried to run command bun run dev(It run nuxt dev) And it stuck on Grnerating Prisma client... Here's module I use ```ts...

Order Conversation based on Chat `createdAt`?

I’m building a chat application using Prisma (PostgreSQL) for my backend, and I need to order conversations by the latest message's createdAt timestamp. However, I’m struggling to find a way to achieve this without adding an additional field like latestMessageCreatedAt to the Conversation model. Here's my Prisma schema for Conversation and Message: ```prisma...

Cant run prisma generate at build time

My build env does not have access to my database. Can I run prisma generate before deploying or at runtime?

error while trying to create Prisma pulse project.

error:
Prisma Pulse could not connect to the datasource db url. PostgreSQL returned the error: "must be superuser to create FOR ALL TABLES publication". This is probably not a problem with Prisma Pulse.
Prisma Pulse could not connect to the datasource db url. PostgreSQL returned the error: "must be superuser to create FOR ALL TABLES publication". This is probably not a problem with Prisma Pulse.
...

Weird prisma error

any idea what does it make?
No description

Generate prisma client programmatically

I tried looking through existing Github issues, discussions, and here in Discord with no success, but I'd like to generate the client package programmatically if possible. For example, in a Prisma schema file I might have the following block: ```js...

Using the same GraphEntry model for different graphs

I've got two models and am trying to have two different graphs using the same GraphEntry model with a different graph type. Any way to do this? ```ts model House { id Int @id @default(autoincrement())...

findMany - query table for all values not in another

hey, just trying to sort out a minor problem with a program of mine i'm trying to query a table, Track, and only return the records from the table if TrackID is not in another table, TrackToPlaylist in postgres, syntax for this would be similar to the following: ```sql...

Error when npx prisma migrate dev

Im getting a Oops, an unexpected error occurred! Error in Schema engine. Reason: [D:\a\prisma-engines\prisma-engines\schema-engine\sql-schema-describer\src\walkers\column.rs:74:61] called Option::unwrap() on a None value...

Schema Visualizer

Has there been any thoughts about a schema visualizer in your PDP account? Something similar to Prismalizer but built right into your control plane? I'd love a feature like that, especially if it would automatically consolidate split schemas. (ignore the off-topic tags, there wasn't a relevant option)...

Issue with migrations

Hi! I've been trying to apply a change to my schema but been facing some errors and im not sure what im doing wrong, do you think you can help me please? I tried to add a new table to my prisma schema, but every time i try to apply the migration with npx prisma migrate dev --name sample_name i get a message saying that a foreign key on one of the tables i had already on the schema was removed and then added again. Im not sure where this change comes from or if it could be a bug. That same message asks me to restart my database and that all data will be lost. I dont want my data to be lost, so i tried to do a baselining. As the documentation states y moved my migration folder and followed the steps, when i tried to do the migration again i got an error saying that all of the migration folders were missing on my folder, so i restored it....

Bulk relations

I have a Property entity that has a photos relationship (1:many). I am trying to bulk insert 100 properties, and then relate their photos in bulk as well. Is this possible with prisma/sql? Or do I need to loop over the properties after and do it 1 by 1?

Prisma query tracing

Hello! Is there any update on this issue? Would be super useful to be able to add route of the original query that can be inspected in eg. GCP Query Insights (: https://github.com/prisma/prisma/issues/10746...

RawSQL Caching support

Will Prisma Accelerate ever support caching for complete rawSQL? Is there pros and cons of this?...

Deleting db entries doesn't seem to free up the space?

I've added a buuuuunch of data recently that added up to about 50mb and today I cleared it. However, I found that the amount of storage space taken by my .db has not went down even a little bit! It went up from ~30mb to ~80mb, and it remains 80mb+ after clearing the table that caused the size to go up. Any idea what's the cause of this, and how I could clear it?...