Prisma

P

Prisma

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

Join

Mocking prisma client with javascript

How can I mock prisma client with javascript? The guides I found are heavily depended on typescript...
Solution:
Hi @Osamu Can you take a look at this repo ? I created a mock example in Javascript using Prisma....

Declaring a PrismaClient with conditional logging

Hi folks! I'm trying to instantiate a PrismaClient in a TypeScript project. I'm using v6.0.1, and have the following code: ```typescript export class DatabaseClient { private _prismaClient;...

How to correctly deploy prisma into production?

So Im a bit clueless here, am I supposed to run prisma generate in my Dockerfile? Im using prisma with nextjs dockerfile and doing: ```docker ARG DATABASE_URL ENV DATABASE_URL=${DATABASE_URL} RUN yarn prisma generate...

Type Issues with Client Extension in Nest JS

Hello, I am trying client extension with my nestjs application. But I am facing some type issues, can you help me. here is my code. ```ts import { Logger } from '@nestjs/common';...

Issues with shared library libssl.so.1.1

I tried installing it manually but it did not resolve the issue as the library was not found, i tried updating my docker version to a previous one that did not work either, and my pipeline has not changed since the morning where the issue had not been present but now suddenly is.
No description

Studio is not working with multifile schemas

I have created a folder schema and added the following code to the schema.prisma file ```js datasource db { provider = "sqlite"...

node:20-alpine OpenSsl deployment issue

Hi all! I have been having the openssl issue with my node:20-alpine Dockerfile. Here is the Dockerfile: ``` FROM node:20-alpine AS builder ENV TURBO_TEAM=...

default data using prisma

const specialities = await this.prisma.speciality.findMany({ include: { specialityLabel: { where: { language: 'fr'}}...

Error @prisma/client did not initialize yet. Please run "prisma generate" on gitlab-ci.yml

hello im using bun.sh and prisma on my project , when im create ci/cd for deploy to my server i got an error Error @prisma/client did not initialize yet. Please run "prisma generate" `# Stage 2: Build application build: stage:...

ERROR: could not determine data type of parameter $5

Hi, I'm trying out the TypedSQL feature, but I'm receiving an error when trying to generate prisma with --sql. Can anyone spot what I'm doing incorrectly? ```sql -- @param {Int} $1:userId -- @param {Int} $2:parentEntryId -- @param {Int} $3:pageSize...

Use statically linked prisma binary (linux-static-x64)

I want to use a staticailly linked binary (linux-static-x64) but it doesn't work as I'm getting this error:
45.22 Error: Failed to fetch sha256 checksum at https://binaries.prisma.sh/all_commits/5dbef10bdbfb579e07d35cc85fb1518d357cb99e/linux-static-x64/libquery_engine.so.node.gz.sha256 - 404 Not Found
45.22 Error: Failed to fetch sha256 checksum at https://binaries.prisma.sh/all_commits/5dbef10bdbfb579e07d35cc85fb1518d357cb99e/linux-static-x64/libquery_engine.so.node.gz.sha256 - 404 Not Found
...

db Pull not pulling schemas

When I am doing a prisma db pull in a file that I have about 10 schemas defined in the schema file ```js datasource db { provider = "sqlserver"...

Prisma using repository pattern

What do you think about using prisma with a repository pattern to encapsulate the logic?

React Native Prisma TurboModuleRegistry error

I am trying to create an app with React Native using Prisma. When I try to open the application on my Android phone I get an
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'Prisma' could not be found. Verify that a module by this name is registered in the native binary.
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'Prisma' could not be found. Verify that a module by this name is registered in the native binary.
...

Recommended pgbouncer usage for pgbouncer version > 1.21.0

Hi, I am using Prisma with Azure Postgres - Flexible Server. As my app is deployed on Vercel, I want to use pgbouncer. However, I seem to be encountering some issues. As per the docs, I have not set pgbouncer=true since the default version on Azure is 1.22.1 I am currently using DATABASE_URL and DIRECT_URL with the only difference between the connection strings being the port number (6432, 5432) respectively (no &pgbouncer=true)...
No description

Performance problem

Hi all! We have a problem with performance. We use prisma 5.21 and I measure time for a call where we get a batch of 50 objects and the response is about 800kb. Currently it takes about 1.9s to get the response from prisma. Does that sound reasonable? Any ideas on where I should start troubleshooting? My code below: const recruitments = await prisma.recruitment.findMany({...

"upsertMany" with transaction timing out

I'm trying to build a database containing stock for different products from our suppliers. The stock can be fetched as a csv file from an FTP server. What I want to do is to periodically (every day) run a script that gets the csv file, parses it, and insert the values to a database. It should also save the previous history of the stock. This is the code that I have currently. ```ts...
Solution:
I switched to postgresql and now everything works as intended and a lot quicker!

field reference help

hello I have models like this ``` model Player { team Int[]...

Many-to-many relationship not showing in prisma studio?

This is my prisma schema: ```prisma model Track { album Album @relation(fields: [album_id], references: [id]) artists Artist[]...
No description

types from @prisma/client

model User { id String @id @default(cuid()) username String @unique password String createdAt DateTime @default(now())...
Next