Prisma

P

Prisma

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

Join

Prisma studio not great for business people. Any alternatives?

Is there a better prisma database GUI? Prisma studio is very hard to use and not really end-user friendly.

VSCode Intellisense completely breaks when adding a relation

Hi all. I've just started using Prisma with Supabase for the first time on a new Next.js project. All was going swimmingly until I added a basic relation to one of my two extremely simple models. Since adding that relation and running npx prisma generate VSCode Intellisense has completely broken, and hovering over anything that used to give me instant Intellisense just pops up "Loading…" that never seems to resolve. This includes non-Prisma related code like basic React components. Removing the relation and re-generating fixes it. Is there something obvious that I'm missing? ```...

mongodb compressors

How to add compressors to mongodb connection string?

strictUndefinedChecks undesired behavior

hey, I am really happy to see the new preview feature strictUndefinedChecks . However, I did run into some confusion testing. When using it I notice that errors are thrown during create and update operations, specifically when an undefined value is used in the data object of the query. ...

Queries hanging indefinitely

I am experiencing a weird issue. If I enable PrismaInstrumentation a small subset of queries in a large application begin to hang. The promises remain permanently unsettled. Enabling debug logging does not reveal much about what’s happening, just that the query never runs. It shows that the last query is DEALLOCATE, which usually runs right before a query does. I have confirmed that no query is ever sent to the database despite a connection being established when this happens. Disabling PrismaInstrumentation by commenting out “new PrismaInstrumentation()” fixes the issue. Disabling any other code does not fix the issue....

Initializing a specific connection string for Prisma Pulse

I'm currently using Prisma + Neon w/ tRPC hosted on Vercel. My Prisma is initialized using the DATABASE_URL connection string, which is a pooled connection. Pulse requires a direct connection. Do I need to initialize a separate prisma instance for it to work, or will it work if I add a DIRECT_URL env variable to my deployment that contains the direct connection string (unpooled)?...

Migration from 5 to 6 for serverless project

Hello, I'm currently migrating from Prisma 5 to Prisma 6, and I have a serverless Lambda project that uses layers. My binaries were previously in the layer for Prisma 5, but now I'm wondering if I need to do any updates to that; does Prisma 6 still use binaries? Specifically this libquery_engine-rhel-openssl-1.0.x.so.node...

Prisma extension stopped working in Cursor

hey, recently noticed the syntax highlighting broke for the Prisma extension on vscode/cursor - i've tried uninstalling and reinstalling. not sure what could be causing this. happens with schema.prisma file, as well as in the schema folder...
No description

Billing support? Billing error

Hi, we were pro users until a couple hours ago. We downgraded and got charged 90USD for a monthly usage. However we downgraded before our billing cycle ended and a few weeks ago we paid the pro monthly suscription. To the best of my knowledge our usage was "covered" with the payment we made a few weeks ago. We want a refund and to close the account but our billing support cases get closed automatically since we are no longer pro users. What can we do?...

Optimize not showing any queries

For some reason when I click on record it won't show any queries done but the accelerate works. (pnpm dev) ```ts import { PrismaClient } from '@prisma/client/edge' import { withOptimize } from '@prisma/extension-optimize'...

prisma validation

what's the best approach for validating data before creation if prisma currently can't validate nested writes?

Easiest way to investigate a slow Prisma D1 query?

I have an instance of Prisma that I'm using to run a query. The code consistently takes 200 - 250ms to run. On the D1 dashboard the query time is 0.4ms. I would like to understand where that extra time is coming from (serializing the result, waiting on the d1 api, etc) ...
Solution:
ah, I found the issue. Each query is taking 70ms and prisma is generating 3 queries and sending them in series! https://github.com/prisma/prisma/issues/23348...

Custom Migrations

What's the recommended way to customize migrations that aren't supported by Prisma Schema directly? More specifically, if I wanted to add Partial Indexes, Collations, Computed fields, etc..., I recognize we'd likely need to update the generated migration file. That ends up defeating the purpose of Prisma Schema (a snapshot of your DB schema) as there is info not represented. Are comments the only solution here or is there some (undocumented) way to develop custom annotations that affect the migration?...

Auto orderBy

Is there a way to auto orderBy in Prisma without having to do it in every query?

vercel Prisma Client could not locate the Query Engine

Hey, I'm currently trying to deploy the development version of my website on vercel and I have started getting this error after updating to version 6.4.1 (previously was on 5.4). ```ts Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x"....

how to prevent duplicate rows in my friends table

i am working on adding friends feature in my application i am using mysql database , with prisma orm i have a friends table and a users table as the name implies the user table stores the users , friends stores friend records the schema of both tables are as follows ```model Users { id
username
email ...

Prisma Postgres Using psycopg2

Hello everyone, I urgently need assistance with an implementation issue. As a beginner working with Prisma and PostgreSQL, I am currently experimenting with various approaches. I am unclear whether it is possible to integrate Prisma with the psycopg2 Python library for interacting with a PostgreSQL database hosted on Prisma Postgres. Could someone please provide guidance or point me toward relevant documentation? Thank you for your help....

Custom user type vs database type

I usually use the Prisma generated types throughout my app. But in my current project, I'm getting into problems. Example: Since it's a multi-tenant app, a user can belong to multiple organizations:...

CUID Not Auto-Generating

I'm trying to write a seed script to populate my database with mock data, but for whatever reason, I'm getting a null constraint error for the primary key ('_id'), even though my schema is set to autogenerate this. It generates them just fine within my actual app, but it's not for my seed script for whatever reason. Any ideas? (Snippets in thread.)...

Trying to create simple POST function (Expected double-quoted property name)

```ts import prisma from '@/lib/prisma'; import { NextRequest, NextResponse } from 'next/server'; export async function POST(req: NextRequest) {...