Prisma

P

Prisma

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

Join

Help with queryRawUnsafe

Hey all, I have a query that previously worked that started to fail. Based off documentation, this is expected since the column names are dynamically generated when using query raw. Can I get help on converting it to a queryRawUnsafe? Here is a sampe query of what I am trying to convert:...

Prisma Schema not updating / working

I have created this schema for users ```js model users { id Int @id @default(autoincrement()) username String? @db.VarChar(255)...

Runtime Error on latest versions of Next, AuthJS, and Prisma when initializing prisma adapter

I'm running the most recent versions of everything (just building from scratch) as soon as I enable the prisma adapter in AuthJS I get a runtime error: I am running with Prisma Postgres which should be Edge compatible Error: Failed to load external module node:module: ReferenceError: Cannot access 'require' before initialization...

Hi Prisma Team 👋We're currently using a Prisma Accelerate database and ran into a critical issue.

Due to a misconfigured migration script, we accidentally deleted production data while trying to migrate to a new DB instance. Would it be possible to recover a backup from April 20, 2024 (or any time before April 21)? This is really important as the data loss has impacted our client. ...

Mysql Migration for prod via docker and github action (CI/CD)

hello sir, i am trying to deplogy my express app on production via github action to aws EC2 so when everver i am pushing or merging into prod i want to run the github pipeline and docker file which will deploy my express app on ec2 so what do i change in my docker file and github workflow file
...
No description

How can I perform batch updates unique entities in Prisma?

How can I perform batch updates in Prisma — akin to createMany — by passing an array or collection to a single operation? I’m working inside long-lived interactive transactions and need to update multiple records by their unique IDs. What’s the best approach? 1. Using Promise.all([ tx.model.update(…)*N ]) for each item 2. Writing a custom extension or helper with an SQL builder 3. Executing raw SQL via tx.$executeRaw...

Prisma generate with Turborepo never prompting for name

After following the instructions to setup Prisma with turborepo, when runnning pnpm turbo db:migrate, the terminal just hangs and never enters the interactive CLI. I have made sure to set the command as persistent ``` "db:migrate": {...

transferring project to another workspace

hey, am i able to transfer a project to another workspace i own?

Prisma with nuxt build blocking issues

Whenever I run any command like dev or build, the Prisma/Nuxt module prompts me with a question. This is blocking my build, and because of that, I can't even deploy it on Vercel. Is there a way to skip this prompt or handle it properly?...
No description

ReferenceError: __dirname is not defined in ES module scope

I am using Prisma Client with SvelteKit and I am getting this error on builds/preview. I have tried looking up solutions but I could not find a solution. I saw someone saying it should be fixed in Prisma 6.7. Is this true? This issue is preventing my application from working once it is built.

Problem creating a new user to my database

Hello so I'm using prisma and nodejs but I'm facing a little issue when I try to create a new user into my db. The error arises from here: ```js import prisma from "@/lib/prisma";...

Connecting from something like dbeaver

Hi there, I would like to connect to my Prisma postrgres db via dbeaver. How/ where can I get a connection string that has the normal postrgres structure like postgresql://postgres:[email protected]:5432 Thanks...

Anyone have Prisma ORM working with React Router 7? I get Internal server error

Following the documentation here https://www.prisma.io/docs/guides/react-router-7 except using my own postgres instance rather than hosted cloud version. But as soon as I use import prisma from "~/lib/prisma" in a route I get [vite] Internal server error: exports is not defined on ...app/generated/prisma/index-browser.js:4:23). RR 7.5.0. Prisma 6.6.0.

output in schema

the output = "app/generated/prisma/client" seems to be very wrongly placed in the project structure whenever I simply run the following command of pnpm dlx prisma generate and I have actually no clue to why it's doing this. Seems to me like this is a bit of an issue. Could someone please help me out here a little bit to furthermore understand exactly what's going on? I was used to just simply have this structure prior to v7 ```ts generator client {...
No description

Running into a strange issue

```→ λ api ── aws:apigateway:v2:post:/createWorkflow ─ Error creating workflow: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "darwin-arm64". This is likely caused by a bundler that has not copied "libquery_engine-darwin-arm64.dylib.node" next to the resulting bundle. Ensure that "libquery_engine-darwin-arm64.dylib.node" has been copied next to the bundle or in "node_modules/.prisma/client"....

Extremely strange behavior

I'm not sure what to call this. All addresses are stored in the address table. To distinguish mailing or physical addresses, their IDs are placed into the respective tables which are then reference by student. When a student has equivalent mailing and physical addresses, the function above in my NestJS application returns undefined for the address_physical within the Student object and I have no idea why. I suspect that because there are name similarities or the IDs to the mailing and physical addresses are the same causes Prisma to go haywire. The even weirder thing is that when I console.log the address_physical.address, it is very clearly defined (although the same as mailing_address, which is intended). I have checked my NestJS entity models and there are no issues there either....

Prisma Data Platform visualize data

anyone know how to use prisma studio on the Prisma data platform, it's just kinda blank for me. tables exist in the db and so does data tried to use an external dbms but the prisma accelerate connection string kinda blocks me from using anything else and I have no way of getting the direct connection string? any solutions for this?...
No description

Is there a way to differently parse DateTime and db.Date when reading from Postgres

Both DateTime and db.Date are being parsed into a full Date in js. This causes unwanted behavior since the Day will shift for negative Timezones and hand-picking the affected fields for differenting handling is not a viable solution for me. I'd like a generic way to apply a different parsing strategy for different Database types...

Prisma & Store Procedures

Hello everyone, Does Prisma support calls to stored procedures? If so, could someone explain how to do it or share a relevant link, article, or repository with guidance?. PD: I use Postgres...

Having trouble connecting Prisma to Aurora AWS

running into error ``✖ Introspecting based on datasource defined in prisma/schema.prisma Error: P1001 Can't reach database server at postgres:5432`...
Next