Prisma

P

Prisma

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

Join

Own local Caching?

Hey, does prisma also have a localcaching or something? except the prisma accelerate. i would like to have something local because the internet is getting worse and worse in germany 😦 Does anyone know anything current? e.g. an NPM package?...

Import Enum from my TS to the schema

Hey, Wanted to know if it's possible to import an enum inside my schema.prisma file instead of defining it inside ? Because all my types used by both front & back are located to a dedicated package, and it actually force me to define my enum in 2 distinct places, where I would like to only have it in my types package....

reset db and migrate changes

greetings! I am starting with Prisma ORM, I am having difficulty restarting the database and migrating changes made in my project in an automated way. Could someone show me an example? I speak Spanish, but I use Google translate

Unable to run db push because of introspected inconsistencies with supabase

Hi, I'm working with a postgres database on supabase. After running db pull with a multischema setup (public+auth), I ultimately reverted back to a simple public access and removed all the introspected tables from my schema.prisma. Currently my schema contains a single table unrelated to supabase. I'm trying to db push it but I get an error as follows: ``` Error: P4002 ...

i am unable to run prisma migrate

cannot able to run prisma migrate with supabase ?

Ordering of createMany items

When you use the create method and include a createMany, does Prisma guarantee the ordering of the items created? Or can they get created out of order? Eg. given the following: ```...

Error: cannot find module ‘.prisma/client/index’

Im having literally the same issue as this https://github.com/prisma/prisma/discussions/21422 Im running node 18, prisma 5.6.0 The only difference is that Im not using Vercel, but rather a self hosted kubernetes using rancher....

Export client types in custom package

Hi, Actually I have a project in a monorepo, with a app/ folder and api/ folder. My API folder contain a node project that runs a web server, and also contains my prisma install. Now that i'm setting up the front, I would like to use the sames types as my back, but can't see a good solution to to that....

typescript server not working after installing @prisma/client

``` { "name": "next-template", "version": "0.0.2", "private": true,...

Tips on designing this recursive database model

In my Twitter clone, a post sometimes needs to be displayed by itself, and sometimes together with its parent post. I do this by including the replyToPost in the query. But every post can also be a repost of another post, so both the post and the ´replyToPost need to include a potential repostOfPost`....
No description

how to make fields selection mandatory?

Currently, both select and include are optional fields, more of that it's possible to pass just true, without specifying every field: ``` prisma.post.create({ data: ... include: {...

Hosting Typescript Express Server with Prisma on Vercel

I have hosted Express Server (Javascript) with Prisma on Vercel and it is working perfectly. Now I have a app on Typescript. As Vercel only works with Js files I have used build file. So, My question is how to include the prism generate file inside the /dist folder as when building with

rimraf dist && tsc

rimraf dist && tsc
...

Connection Pooling issues with Azure SQL

I continue to see issues in our error logs in production with prisma using Azure SQL:
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
...

PrismaClientInitializationError

Hi everyone, I am running a Prisma app with Docker and getting this error when the container runs: ``` PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "linux-musl-openssl-3.0.x". This happened because Prisma Client was generated for "darwin", but the actual deployment required "linux-musl-openssl-3.0.x"....

How to add new schema with multiSchema feature without database reset

When adding a new empty schema to out prisma.schema migration detects a drift and asks us to drop the database even though nothing else has changed. How can I add a new empty schema without dropping all the data? ``` generator client { provider = "prisma-client-js"...

Setting up SafeQL for Prisma

I need help in setting up SafeQL for Prisma. I can't correctly configure my eslint.config and tsconfig. This is my eslint.config.mjs right now: ```js import tseslint from 'typescript-eslint'; import safeql from '@ts-safeql/eslint-plugin/config'; ...

too many db connections on Prisma Accelerate

Hello! hope you are all well. I am using prisma accelerate to avoid this issue, but funny enough im running into it now im using accelerate (wasnt before i switch to prisma accelerate, (all just dev, not production yet)) ...
No description

Failing to write raw query

Hi, I have a (working) raw query that I want to run with prisma but I can't find how to do so and I'm a bit confused as to how I can approach this. For simplicity's sake, my query can be reduced to: ...

Is there an option to turn off the dataloader query optimization?

We recently ran into an issue where the dataloader (described here: https://www.prisma.io/docs/orm/prisma-client/queries/query-optimization-performance) caused queries to be constructed in a way that were extremely inefficient, when combined with a count of a relation. Is there any way to turn this functionality off?

Update column type without losing data

I have a column of type int and I need to migrate that to bigint. If i change the column type in the prisma schema and run npx prisma migrate dev --name change-type it wants to reset the public schema. I don't want to lose all the data so what's the proper way of doing this?