Prisma

P

Prisma

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

Join

Upgrade from 6.0.1 -> 6.5.0 broke migrate dev

I recently upgraded from 6.0.1 to 6.5.0, and didn't change any migrations or schema files. But when I run migrate reset and then run migrate dev I am now receiving an exit code of 130 whereas previously I could generate migrations without issue. This happens regardless of if I modify a schema file or not. The output of the command looks like this: ``` Drift detected: Your database schema is not in sync with your migration history....

Prisma PostgresProvisioning stuck?

Hello. Im quite new to prisma, but when I set up a new environment, it just states "Provisioning" and under setup "Almost there! Your database will be ready shortly."Anyone that knows what can cause this? I have 6 environments available in my plan, so that should not be the issue. Thanks!...

Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x"

Hello. I have been using Prisma for years and love it. However, I am having an issue with a new project when deploying to vercel. It's seems this is a fairly common issue, as there is an entire github post about it here:https://github.com/prisma/prisma/discussions/19498. In the last two weeks, it seems 3-4 other people have had the same issue, yet none of these have been responded to. I was wondering if there is a known solution/if this is currently being worked on?

Module build failed: UnhandledSchemeError: Reading from "node:async_hooks" is not handled by plugins

I'm on a Next.js 14 app and just switched from 6.5.0 to 6.6.0, but now I'm seeing the error Module build failed: UnhandledSchemeError: Reading from "node:async_hooks" is not handled by plugins (Unhandled scheme). Webpack supports "data:" and "file:" URIs by default. You may need an additional plugin to handle "node:" URIs....

Migrating from MongoDB to PostgreSQL: How to handle embedded types/objects?

I'm an intermediate developer working with Next.js, Node.js, and React. I'm currently using Prisma with MongoDB for my project, but I'm considering migrating to PostgreSQL. One of my biggest challenges is figuring out how to handle embedded types/objects that I use extensively in my MongoDB schema. For example, I have structures like: ```typescript...

How to make a library/package that expects a Prisma client with a certain schema?

Hi, I'm currently trying to make it so I have my Prisma Schema as a private GitHub package that I can consume in various environments and projects, using the new prisma-client generator, which expects an output path. I have my package called @blabla/prisma-client, which exports all Prisma types from the generated client (e.g ./generated/client), after having been built with tsc, to output .d.ts files, which are all I really care about, to use in different projects. I import that package into my modules which accept a Prisma Client on initialization, to use its types, and then I export my functions and classes for consumption in a different project....
No description

[email protected] type error when prismaClient generated at specific folder with "cjs" module type

@Prisma @Prisma AI Help I've been trying to use prisma v6.6.0 with nestjs app and generated to cjs module format but I kept getting type error at runtime...

Running "prisma db push" leads to migration failure

It works if I run yarn prisma db push for the first time on a new database. Run that again, I get error: ``` Error: ERROR: type "TriggerType" already exists 0: sql_schema_connector::apply_migration::migration_step...

Synchronous functions

I need to query a DB from a synchronous function. Unfortunately making it async isn't possible because it implements an interface that I can't touch. I also can't just ignore the promise because the said sync function actually processes the data returned from the query. Is there any solution?

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";...