Prisma

P

Prisma

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

Join

How to build TS application that uses prismaGenerated files

Whenever my typescript project is compiled and built, I've noticed that the application is not outputting my prismaGenerated originally in the src directory into the build directory e.g. dist/project folder, if someone can help me navigate how it's normally done in production that'd be great thank you

prisma 6.7.0 not working in vercel

I’m encountering an issue after upgrading to a new Prisma version. When calling prisma.form.create(), I get the following error: prisma:error Invalid prisma.form.create() invocation: ...

How to compile or get client generation result in memory?

```typescript const schema = await fs.promises.readFile("schema.prisma", "utf8"); const document = await getDMMF({ datamodel: schema }); const result = await compile(dmmf); ...

Recommendation for data migration with prisma and mongodb

Hello, for data migration with prisma and mongodb, do you recommend the “No breaking changes updates” method, where you put the new optional fields (but if you need to update values, it doesn't work because the value is null) or the “”All-at-once“ updates:” method, where you add the new fields with a default value. In the latter case, what is recommended for migration scripts? Are we supposed to have a migration script that will automatically create the value thanks to the script? What should this script look like? If prisma's migrate method doesn't work with mongodb, do you have to write it manually?
Would this work for exemple : // scripts/addNewFields.js import { PrismaClient } from '@prisma/client'; const prisma = new PrismaClient();...

Proper way to set connection_limit in Prisma Accelerate

Hi, I use Prisma Accelerate and it seems like it has a default connection_limit of 10. I'm at the point where I need to tune some of the configurations due to my load but I don't know how to do this within Prisma Accelerate. I am on the Pro plan already, so it looks like I'm allowed to set it up to 100. Can I just add ?connection_limit=100 to the accelerate string? Or to the underlying connection string?...

Problem with prisma-client generator on vercel with a monorepo

Speaking to you guys on twitter. i hvae been using the monorepo-plugin, and wanted to move away from it. The first step was to move to the new generator, which works perfectly locally, but is still throwing up errors on vercel due to it not locating 'Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".'
No description

renaming column names

Hello, In the past I've made some really bad naming decisions for my columns and I'm wanting to rename these now. current schema: ```ts...

Prisma Client v6.7.0 issue

Hi guys, I was setting up a Nodejs server using typescript. To query my postgresql database I'm using Prisma ORM, I setted up it following the documentation for relational databases step by step but when I stat Nodejs server it returns this error: ``` Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again....

What is the recommended way to use Prisma types on the front-end?

I'm mostly asking this because, while using Prisma.<Model>GetPayload and something like nitropack's SerializeObject type utility works fine, it feels cumbersome and more importantly, it seems to bring the performance of the editor's TypeScript language server down to a crawl, which impedes the pace of development massively. So I am wondering what's the best way to interface with Prisma types on the client, considering that the data received from the server will be serialized, meaning the generated types won't match as the returned output....

[6.7.0] Slow client generation and call to getDMMF()

We recently upgraded to 6.7.0 and noticed that generation of the new typescript prisma client is very slow as well as the call to getDMMF(). This is the output of running db push: ``` PS C:\git\FusionHub> pnpm prisma db push...

[6.7.0] prisma.config.ts - Painstakingly slow formatting & lint (on-save) in vscode

Ever since we updated to 6.7.0 and to use prisma.config.ts, attempting to change a schema file and save it takes MINUTES and it's completely unusable. We do have 24 prisma schema files with lots of model in these, but it was not at all slow before in 6.5.0. The output console of Prisma language server doesn't log anything in particular so I'm unsure how I can do something to make it better again. The prisma.config.ts file is not doing anything special:...

Prisma Client (v.5.10.2) in a Next.js project deployed in Vercel. Use or not the explicit disconnect

Hi! I'm using Prisma (v.5.10.2) in a Next.js project on Vercel. Our endpoint, triggered every 30 minutes by a cron job, interacts with a Neon serverless database. We've seen errors P1017 or P2024 in Vercel logs. The app retries operations up to four times with delays. Vercel support suggested explicitly disconnecting to prevent Prisma errors, referencing this: https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-management#calling-disconnect-explicitly. They recommended: ``` import { PrismaClient } from '@prisma/client'; ...

NextJs w/ Prisma

Do i need to include the generated prisma folder when pushing to github repo? Also when doing a linting I got issues in all files inside generate folder

prisma 6.7.0 working in production

prisma 6.7.0 only work in development but not in production after deploy to netlify

prisma 6.7.0 not working in production

i have router v7, prisma and neon application working well in development. i can login and out but when i deploy to netlify i got this error. schema: generator client {...
No description

VS Code imports PrismaClient from wrong folder

VS Code auto imports PrismaClient from @prisma/client/extension instead from the generated folder. I ran npx prisma generate in the console before that. I have Prisma extension installed. I get
import { PrismaClient } from "@prisma/client/extension"
import { PrismaClient } from "@prisma/client/extension"
...

[prisma-client]: Accessing SQLite database with a relative path reports [P2021] error

When I set the output path of the generator client to a directory inside prisma/*, the generated client files contain subtle differences: ```diff // ~/prisma/client/internal/class.ts ...

Combining raw and standard queries

Hi everyone. I'm developing an API which requires complex filtering. I traverse filters (arbitrary nesting depth) and create where clause. The problem is that I need to implement RegExp based filtering which is not supported natively. As far as I know the only way to make RegExp filtering is via raw queries. Is there a convenient workaround to combine standard query with raw regexp query?...

HI getting Issues in prisma vscode extension

its not giving any problems but just showing red marks in vscode due to new updates of vscode extensions..... i have two schema files working fine as per my intent befor some days now also working fine but showing those problems.......
No description

Generating client without a connection to DB

Hello, I want to generate the client as part of building my docker image. This building of the image will run inside a CI/CD pipeline. Just for generating the client Prisma wants to connect to the database which is not possible inside the pipeline. Is there a way to generate the client without the need of a running DBMS? Why is there the need to have a runnign DBMS in the first place? Greetings...