Prisma

P

Prisma

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

Join

Get "normal" database credentials from prisma.io Postgres db.

Hey! I want to connect my primsa postgres db to metabase. For this I need the "normal" postgres credentials, how can I get them?...

Update help

Hey, i want to apply a newer prisma schema to an older database (adding all new tables). The problem is, that it suggests me clearing the database but this isn't an option. It tells me something like "migration drift"

Why `prisma generate --sql` needs to have `DATABASE_URL`?

I'm getting this error when executing prisma generate --sql but not if executing prisma generate: ``` 4.679 api:build: > prisma generate --sql 4.679 api:build: ...

How to create a new database w/ schema from Node - not CLI?

Hey all, trying to figure a problem out. I'm building a desktop app (Electron, Node, React, Prisma, etc) that will run from user's computer. In my use case users can create multiple instances of the app - think a different savegame in a video game. For this, I would really like to have different databases for each instance - db1.db, db2.db, db3.db, etc. I know how to solve this with storing all the data in one Sqlite db and indexing etc, but would prefer totally different DBs I know how to do all of this from CLI with db push, migrate, and other commands. But can't figure out how to do it from Node itself What I would like to do is if a user creates a new instance, I build a filename and path, then create the new datbase file w/ schema at that location. And a PrismaClient instance is created for it. ...

Composing relation types

How do ya'll set up your relation types? I currently have one big type that includes all relations: ```typscript...

Any reason on why Prisma would allow a non-type safe query?

Hey, recently we refactored our schema.prisma by renaming some relations. We expected that some queries would stop working and that TypeScript would warn us about these issues. Fast forward to today, when we noticed part of our website wasn't functioning. After investigating the query, we discovered that Prisma/TypeScript wasn't warning us about a missing relation that no longer exists.
No description

Is my way the most optimal in this case ?

So based on my research previously if you wanted to delete an element from an array, you'd have to get the array first with a separate call then filter it with javascript, however I did notice new ways popping up but none of them seemed to work with me (I think because the array isn't an array of a certain model?). This is my model: `model Wishlist {...

Can't delete

Running prisma 6.4.1 with Planetscale I cannot seem to run any delete operation. Tried both from studio and from prisma client and neither run, no errors output either.

Prisma postgresql

Hello i have a problem with generate client Environment variables loaded from ../.env Prisma schema loaded from schema.prisma ...

Can't use a locally hosted postgresql database on Prisma.

It keeps throwing the error 'Error validating datasource db: the URL must start with the protocol prisma://', though I see many people using it all the time. My schema is ``` generator client {...

HELP WANTED! Prisma 4.16.2 with MongoDB 8.0

Hi, I'm in a bit of a bind. I'm currently using Prisma version 4.16.2 with MongoDB 6.0, but since MongoDB 6.0 is reaching its EOL in July, we need to upgrade. I was thinking of upgrading from 6.0 to 7.0, then to 8.0. However, I couldn't find much information online, and I came across something suggesting that Prisma 4.x might not be compatible with MongoDB 7 or 8. Has anyone faced a similar issue or can share any insights? Thanks for help!

"Something went wrong, please try again"

Trying to enable pulse leads to this error message. Not sure if ive been unknowingly ratelimited but I would love to know a fix.
No description

prisma generate hangs

Whenevery i run prisma generate, the process just hangs. I'm using the latest version (just installed it) in a deno monorepo. This is my schema: ``` generator client {...

How do you manage the Prisma Client in Express and NestJS, GraphQL (Not Next.js) ??

We are using GraphQL with Apollo Server and injecting the Prisma Client into the resolver’s context. However, this approach requires passing the Prisma Client to service classes within the resolver. As the depth increases, the need to pass Prisma throughout the application becomes more frequent. It seems better to use a singleton and import the Prisma Client directly in the service class, as described in the article below....

Auto no cache when using prisma postgres with better-auth

using prisma postgres with better-auth for user session and user management but getting this whenever refreshing! How to implement the caching? │ POST https://accelerate.prisma-data.net/6.4.1/sdfsdfsdfdsf4s64df35s4d1f5s4df5346sf6ds4f4/graphql 200 in 506ms (cache skip) │ │ Cache skipped reason: (auto no cache) ...

help contructing a filter query

I'm receiving filter query params as a prop to my server action, every filter param can either be an array of values or just a single value. I can't figure out how to go on creating this filter query

How to define types in Pothos that work with Prisma?

Hi. I am trying to migrate from nexus to Pothos. But I run in to some trouble when trying to define my input types. See image for example of my code. The Prisma delete function does not agree on my defined type. Can you see what I am missing? TS error below: ```...
No description

Connect to multiple db?

Hey guys is there a way to connect to different db on user selection? for example i have 3 databases 1 for each project and i want to select which app to use and then connect to this db to fetch data is it possible?...

Prisma Pulse discontinued - alternatives?

With prisma pulse being discontinued, does anyone have any recommended alternatives that provide similar functionality?

Best way to use typedSQL when deploying to multiple places

I have a project which has just enabled typed SQL. However when I deploy my project multiple containers, multiple databases and multiple sites are deployed/updated. Currently I build everything before running my database migrations to reduce downtime....
Next