Prisma

P

Prisma

The official Discord server of Prisma! Find us online at prisma.io

Join

introspecting never loading

Hi, I have a freshly setup project and db with a couple simple tables in it, and when I pull my db with prisma, I just infinitely load on introspecting based on datasource defined in prisma/schema.prisma. How do I fix this and get past this? I made sure the configuration and DB url is correct. I am using supabase for a db
Solution:
I actually made a mistake, I needed direct URL and everything is working great! New to prisma so unaware of it.

JSON Filtering on object key value inside array example from doc doesn't work

model Test { id String @id @default(uuid()) @db.Uuid data Json }
await db.Test.create({data: {data: [{petName:"Claudine"}, {petName: "Sunny"}]}})...

.update return null when data is found using .findUnique using the same where clause (version 5.17.

How is this even possible ? my updatedUser is null, and no updated has been performed But the data exist since the user is found successfully no error is thrown by prisma just updatedUser being null...

Error when using accelerate (Local Development)

ref: https://www.prisma.io/docs/accelerate/local-development i did run prisma generate after updating DB URL. im using sveltekit and postgres db. ...

Any way to decrease prisma client size for Cloudflare D1?

I have a small schema with two models and running prisma generate takes the bundle size from 30kb to 860kb which is super unreasonable for a serverless project. Is this intended and is there anything I can do to decrease the size in production?
Solution:
This is intended, yes, and no there’s no improvements to be made beyond ensuring that you’re generating the minimum amount of code.

Property does not exist on type..but it clearly does.

```js
const lastIdResult = prisma.descriptionDiff.findFirst({ where: { packageId: thisPackage.id...
No description

How to kill idle connections properly in postgres

Prisma has been creating too many connections on my app. I have this: ```...

NestJs + Prisma Optimize

Hello everyone! I would like to ask if anyone has managed to integrate a NestJs server with the Optimize tool and how. I have tried this instantiation part in a few ways...

Prisma Accelerate Typescript

Hey, what are the typings for Prisma Accelerate? why is prismaClientSingleton = any? this make no sense ```ts import { PrismaClient } from "@prisma/client/edge";...

Nested orderBy

Here's my function. I have an edge table, CompanyAdmins, which bridges the Company table and Users table. ``` function getCompanyAdminsByCompanyIdList(idList) { return db.company.findMany({...

Cannot set up optimize

👋 I'm seeing the following error when trying to run withOptimize.
``` [optimize] HTTP 401 Unauthorized: TypeError: Body is unusable at specConsumeBody (node:internal/deps/undici/undici:5549:15)...

Question about interactive transactions

I'm reading the docs about interactive transactions and it mentionts to try to not do network requests inside of them. I am trying to create an entry in a playlist table which has a url to a thumbnail. I was going to name the thumbnail using a trigger so the file name can contain playlist Id. The actual thumbnail image is uploaded to S3 after getting the playlist id to name it. I don't want the entry in the database to be created if the image upload fails. Is there a better way to go about this if interactive transactions doc says this is a bad idea?...

Getting error on "npx prisma init"

Hi there, i want to use prisma on a new backend project i have, but the initialization step stays blocked here for several minutes (staying at 0%)
> Downloading Prisma engines for Node-API for debian-openssl-3.0.x [ ] 0%
> Downloading Prisma engines for Node-API for debian-openssl-3.0.x [ ] 0%
And then finally gives me the following error:...

Deleting User Account and All Related Data

I'm implementing a way for users to delete all their related data using Next.js 14 with App Router. This is my server action to handle data deletion after user confirmation: ```ts 'use server'; import { db } from '../lib/db'; import { S3Client, DeleteObjectCommand } from '@aws-sdk/client-s3';...

$use replacement for tracking prisma calls per request

Hey folks, I spotted that $use is getting deprecated, and wondered if anyone has an alternative method for keeping track of the number of prisma calls which happen in a single request?

Migration gets stuck

I started a SvelteKit project with Prisma and Supabase. When I try running the command: 'pnpx prisma migrate dev --name init' it never finishes My .env file has both: DATABASE_URL (port 6543) and DIRECT_URL (port 5432) correctly set. Please help! I'm stuck 😅...
No description

Application breaks when adding .$extends to prisma initialziation

when I add the following line .$extends(unitNameFormattingExtension()); to the file where I initilize prisma, the app breaks with the error PrismaClient is unable to run in this browser environment Here's the full code:...
No description

Prisma Accelerate + Prisma Studio

Hi there! I enabled Prisma Accelerate and now my Prisma Studio opens but doesn't show the recorded data. The application is working properly, it is just that I do not have an access to Prisma Studio. The error is: "prisma Client Error - Unable to run script". Details: Message: Error in Prisma Client request: Invalid p=e.match(BAt)?.[1]??"",g=e.match(UAt)?.[1]??null,v=e.match(GAt)?.[1]??null,{getPrismaClient:x,PrismaClientKnownRequestError:E,PrismaClientRustPanicError:D,PrismaClientInitializationError:P,PrismaClientValidationError:R}=require(${u.prismaClient}/runtime/${c}`),k=e ..... ...

concat two Prisma.sql queries.

I have two pretty complex queries which i created manually using ```ts const a = Prisma.sql(...) const b = Prisma.sql(...)...