Prisma

P

Prisma

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

Join

P1001: Can't reach database server

Whenever I run this command: npx prisma migrate dev --name init, I end up getting this error: ``` Environment variables loaded from .env Prisma schema loaded from prisma\schema.prisma Datasource "db": PostgreSQL database "postgres", schema "public" at "db.nbcsqgnnbagzijwbrfsb.supabase.co:5432"...

Prisma Nuxt Turborepo: Cannot find module

I'm attempting to use Prisma client in a monorepo based off Prisma's official guide: https://www.prisma.io/docs/guides/turborepo. I'm running into issues trying to use the generated client in a Nuxt application located in the monorepo. When I import the client into one of my API routes I get a module not found error: cannot find module 'C:\packages\database\generated\client' When I examine the .nuxt/dev/index.mjs file in dev, it appears that the Prisma client is using a relative path instead of an absolute path...
No description

Prisma migrate

Hello, I have modified my Prisma schema and would like to apply the changes on my file . db without losing data, but it does not work, I lose them

PrismaPulseServerError: P6100 Prisma Pulse encountered an unexpected error

I'm finding that Prisma Pulse is flaky. If I let it run on a long-running process, it will eventually start failing. How can I get support here?

Seeding Prisma db with Excel File

Need some guidance on how to seed a prisma db using an excel file

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