Prisma

P

Prisma

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

Join

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?...

up down migration creation

I have started creating down migrations with npx prisma migrate diff and up with npx prisma migrate dev --name ${name} --create-only I want to have the up and down migration in the same folder but it puts the down one in the root of my project. Anyone got a nice solution or alternative?...

inconsistant use of id field and relation create

why is this createMany in relation somehow is using siteId instead of site: connect? ```const oldChat = await prisma.chat.create({data: { token: generateRandomString(), module: {...

Help with Prisma schema

Im working on a NextJS project with Prisma and mangoDB I have an Activity model that has a relationship with Member when first creating an Activity it dosn't have members only and owner but i still want to set the default value to an empty array. when I try to do so with a post request and set members: [] to an empty array i get this error: ...
No description

ERROR P1001: Can't reach database server

Hi everyone, I'm getting the error message that my database server ist not reachable. But the server is running I can connect to the database with DataGrip.
No description

How to partition a database

Is there a way to partition a PostgreSQL database using Prisma? Or is it planned in the roadmap? It might be very useful for handling large amounts of data....

SessionTokenError & PrismaClient is not configured to run in Vercel Edge Functions/Edge Middleware

PrismaClient fails to initialize in an Edge Runtime environment (Next.js middleware) despite using the recommended configuration with driver adapters and Neon's pooled connections. The error persists even after following the official documentation for Edge compatibility. you can consult the issue I posted on github 👀 https://github.com/prisma/prisma/issues/25234...
No description

`prisma generate --sql` always hangs on vercel deployment.

I was just starting to incorporate typedSQL into my codebase ( love it btw ), but it's always hanging on the generate step, it's working fine on local.
Solution:
the related question here mentions the exact solution https://discord.com/channels/937751382725886062/1278064453375492230

nested raw query errors

WHERE
"postId" = ${postId} AND
${rootCommentId ? `"id" = ${rootCommentId}` : '"parentCommentId" IS NULL'}
WHERE
"postId" = ${postId} AND
${rootCommentId ? `"id" = ${rootCommentId}` : '"parentCommentId" IS NULL'}
...
Solution:
What version of Prisma ORM are you using? Have you tried TypedSQL? https://www.prisma.io/blog/announcing-typedsql-make-your-raw-sql-queries-type-safe-with-prisma-orm

Engine Not Found using Prisma with AWS Lambda.

Hello, I get the error: ``` "errorType": "PrismaClientInitializationError",...

schema "extensions" does not exist' error in shadow DB during initial migration on Neon

When running 'prisma migrate dev', I get this error on my first migration: 'Migration 0_init failed to apply cleanly to the shadow database. Error: ERROR: schema "extensions" does not exist' ...

Lazy load query engine in Cloudflare Workers

Hi! When using previewFeatures = ["driverAdapters"] deploying to most free plans fail due to the bundle size limit of 1mb. This is caused by the added bundle size of the query engine wasm. Wouldnt it be possible to lazy load the wasm when the worker is executed? ...

Pulse hosting

Hi there I want to use Prisma Pulse for our supabase/nextJS project. The app is hosted in vercel so I guess I will need to find another host for the backend stream-- what is recommended? Cloudflare workers? Is there a simple deployment guide? Thanks...

Prisma Interactive transactions not waiting on await statement

Prisma version: 5.19.1 Database Engine: Postgres I am running the following code structure inside an interactive transaction ```...

caprover can't connect via prisma

`` Prisma schema loaded from prisma/schema.prisma Datasource "db": PostgreSQL database "everpresent", schema "public" at "srv-captain--everpresent-postgres" Error: P1001: Can't reach database server at srv-captain--everpresent-postgres:5432`...

How to run prisma in nextjs middleware

I get this message, despite following the first guide
No description

Error when trying to connect to create PrismaClient

`` thread '<unnamed>' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\napi-sys-2.3.0\src\functions.rs:7:3: Must load N-API bindings stack backtrace: note: Some details are omitted, run with RUST_BACKTRACE=full` for a verbose backtrace....
Solution:
Using the binary engine fixed it

update enum on production

how to change the itemStatus to itemTaskStatus along with the enum without deleting the existing data. i want to use the expand and contract method but i keep on getting p3006 error. ```js model ItemTasks { //other value itemStatus ItemStatus @default(unpaid)...

How to get meta object (duration, row_read, row_written) in D1 + Prisma query?

How to get meta object (duration, row_read, row_written) in D1 + Prisma query?

Using the same schema on different projects

Hello! I have different projects that use the same prisma.schema. Every time i change something on my schema i have to update the file on all of the other projects. I wanted to ask if there's a way to sync them so all of my projects can point to a single schema and every time i wanna make a change i only have to worry for a single file. ...