Prisma

P

Prisma

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

Join

Advisory lock errors in CI suddenly ocurring very frequently

I have a newish (about 2 months old) next.js app with prisma deployed on Vercel. Lately I'm getting Error: P1002 on about 75% of my builds, even when there are minutes between builds.
Context: Timed out trying to acquire a postgres advisory lock (SELECT pg_advisory_lock(72707369)). Elapsed: 10000ms. See https://pris.ly/d/migrate-advisory-locking for details.
Context: Timed out trying to acquire a postgres advisory lock (SELECT pg_advisory_lock(72707369)). Elapsed: 10000ms. See https://pris.ly/d/migrate-advisory-locking for details.
...

Drift detected after migration reset

Hi, I'm having trouble with adding changes to our db because of Drift detected issue, event after. I did the ff migration reset --force ``` ...

Supabase with Pulse and Accelerate

Hi! I am setting op Supabase in combination with Fly, Pulse and Accelerate. I received two URLS: A connection pooler URL A direct URL ...

Whenever you extend your PrismaClient with Pulse, you don't have access to $on anymore. Why?

Why is it possible to do this: ```ts const client = new PrismaClient({ log: [...
No description

deep nested create takes so much time to complete

PFA reproduction code ` npm install npx prisma generate npm run dev...

Return Type With Relations

Hello there, I have a quick question about return type with relation. If I have this sort of query: ```ts...

Why always encounter this error after few mins

Due to this im not able to able to work properly... PrismaClientUnknownRequestError: \nInvalid prisma.users.findUnique() invocation:\n\n\nError occurred during query execution:\nConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "42P05", message: "prepared statement \"s4\" already exists", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })...

Is SQlite supported any time soon? Pulse & Accelerate

Hi! Wondering if this is on the roadmap or not. Migrating my stack to Postgres is kind of a pain.
Solution:
Hi @DennisK πŸ‘‹ The support for SQLite in both Pulse and Accelerate is not currently on the roadmap....

Cursor based paging issue for multilevel relationships

I have this query. As you can see my paging field's like cursors are inside the select: works section. Question completes in the next post. ```typescript const works = await this.#client.follow.findMany({ select: { followed: {...

postgres db collation error

``` riginal error: ERROR: template database "template1" has a collation version mismatch DETAIL: The template database was created using collation version 2.39, but the operating system provides version 2.40. HINT: Rebuild all objects in the template database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version....

Prisma (with MongoDB) sort based on their related field

Hi! How can I retrieve all users from the User model in Prisma (with MongoDB), and sort them based on their total points from the related ShadePoints model? I am currently using Prisma with MongoDB, What is the best way to sort users by the sum of their related ShadePoints.points using Prisma? Is there an example using or an alternative approach? model User {...

accessing prisma generated enums on browser client

in my prisma schema I have an enum called Sizes with the values of s, m, l, xl i can access that enum in on the server by importing import { Sizes } from "@prisma/client"; but whenever I import the same thing in a svelte file, the Sizes become undefined I temporarily fixed it by copying the values of the prisma generated Sizes...
Solution:
fixed this by passing the values of Sizes from server to client

Prisma SQLite

how to insert data inside the a table in prisma sqlite for internal table which are used only for linking and the data never get's changed

Supabase postgres not working sometime

So I'm working on a project using next.js and a simple CMS. Now I wanted to use supabase as a Backend for the project (bacause it has a free tier). To use postgres I decided to go with Prisma. But for some reason the project automatically disconnects from the supabase postgres. Sometime it works sometime it doesnt. Now I know that this is not enough information. So I tried to find the answer by changing passwords. Restarting supabase project, but it still showing the same stuff after sometime. I followed the official guide by supabase but the problem still exists....

Deploy to vercel with supabase as database

I am trying to deploy a Sveltekit app to Vercel using Supabase as my database and I am getting an error saying that I need to use an adapter for edge runtime:
Error: PrismaClient is not configured to run in Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware). In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
Error: PrismaClient is not configured to run in Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware). In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
But reading the docs I can't understand which adapter I should use for Supabase. Does anyone know how do I configure Prisma for supabase on Vercel?...

Start Prisma Studio Programatically

Is there any way to run Prisma Studio programatically? So that I can wrap it with Auth middleware and protect?

Turborepo with Prisma throwing Error

We are encountering an issue with our Next.js application using a Turborepo setup, integrated with Prisma ORM and Neon Postgres as the database. Upon invoking prisma.job.findFirst(), the following error is thrown: β¨― PrismaClientKnownRequestError: Invalid prisma.job.findFirst() invocation: ...

`prefer_socket` doesn't work when connect OceanBase with prisma

The same issue is posted on https://github.com/prisma/prisma/issues/24010 and I supply two solutions. However, it's like a stone dropped into the sea and no response at all. So I post it on Discord to look forward to receiving official support. Thanks for any help!...

Cant Connect into Prisma Pulse

Hello Support Team, This is my connection Link : postgres://<user>:<password>@vinayakvispute-100xdevs-vinayakvispute4-1688.g.aivencloud.com:12527/multi-resolution-transcoder-pipeline-mux?sslmode=require ...
No description

Get my data from render to local Postgres DB

I don't know if I should ask my question here but I have my database hosted on render and now I want to download my data and have a local database , I have a docker container with my backend and postgres with pgAdmin I tried downloading the backup database from render but restoring the db to local isn't straightforward, if anyone has experienced that before I would like to know the strategy 🫑...