Prisma

P

Prisma

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

Join

getting data from prismaClient says field might be null when it literally isn't in the schema

i have this in my schema ```ts model products { id Int @id @default(autoincrement()) //some fields...
No description

Prisma Accelerate using >100 connections when configured to use 10

I have an application configured to use separate prisma accelerate and PostgreSQL clients. The PostgreSQL client connects to a Supavisor connection pooler. This is resulting in me running out of connections. Using select * from pg_stat_activity I see that there are >100 connections from Prisma Accelerate in state "idle" with wait_event "ClientRead". I have the connection limit set to 10 yet it is using 100 - not quite sure how that happens.

Prisma Studio Issues

Hello everyone! With the recent release of new Prisma Studio features (like the sidebar for editing rows) I found a few bugs related to the new features. I already created an issue in the prisma studio repository, but I thought it would be nice to also report it here (because apparently the studio's GitHub doesn't often respond to issues) P.S.: I really love Prisma ORM and everything related to it, but these bugs really hurt the experience of using the studio. But anyway, thank you for a great ORM ❤️!...

Generating a default form from Prisma

Hi, for now, I plan to use Prisma's Zod generator and then convert the Zod schema into a form using react-formgen. I’m not sure if there’s a more canonical and reliable way to do this. If anyone has encountered this issue before, feel free to share your insights!

Existing MySQL to Postgres

Hi everyone! I'm planning to migrate my old MySQL database to PostgreSQL. I used pgloader to transfer all the data—no issues there. I also adjusted my schema to be compatible since there were some differences. However, when I run prisma migrate, I keep getting errors. The only solution I’ve found so far is to reset my migrations, but that would wipe all my data. Is there any way to avoid that? What should I do?...

Prisma Python NO_PROXY not being honored?

I am facing issues with squid proxy blocking internal requests to the query engine with Prisma python client. I set NO_PROXY="localhost", however, it still sends it to the proxy. Only way to stop it from doing so is turn trust_env to false. Any help would be great.

Prisma with Turbo and Docker

Hey there, I'm currently "learning" Turbo and I came across the prisma guide. I wanted to ask if there is some best practice for Prisma and Docker within Turbo? Should I dockerize the package itself or is that bad? Technically I'm stuck at 1. Migrate your prisma.schema and generate types as I don't want to run PosgtreSQL locally, but on Docker. ...

Help with related filtering with some

With the following schema how do I search for all leases based on the size of a unit? ```ts model Unit { num String @id @unique building String...

TSOA generating from @prisma/client

This is my current workflow, i run tsoa spec-and-routes with OpenAPI to generate a swagger.json of my controllers. In my controllers, i use models from @prisma/client generated from schema.prisma. I fairly sure this is how it works. The issue is when i go into, for example, import {User} from @prisma/client, this is the definition... and i think TSOA does not understand this type ```/**...

Property '[PrivateResultType]' is missing in type 'TypedSql<Parameters, Result>'

Error:
Argument of type 'TypedSql<Parameters, Result>' is not assignable to parameter of type 'TypedSql<unknown[], Result>'.
Property '[PrivateResultType]' is missing in type 'TypedSql<Parameters, Result>' but required in type 'TypedSql<unknown[], Result>'.ts(2345)
Argument of type 'TypedSql<Parameters, Result>' is not assignable to parameter of type 'TypedSql<unknown[], Result>'.
Property '[PrivateResultType]' is missing in type 'TypedSql<Parameters, Result>' but required in type 'TypedSql<unknown[], Result>'.ts(2345)
...

Tips for dividing multiple schema files

It's amazing that Prisma now supports multiple schema files. But I have trouble splitting up my schemas and deciding what belongs together. For example, would you put all of these Auth.js related schemas into one file? Or would you make a separate file for each of them?...

Suddenly got P6008 out of nowhere

I've never had this issue before but now suddently lots of my requests to prisma are failing: PrismaClientKnownRequestError: Invalid prisma.user.findUnique() invocation: ...

Typing Prisma and how write "or" and a named type (prisma ORM/mongodb)

Hello i would like to know how can i write or typed that with Prisma (mongodb DB). I don't know how to write 'or' with Prisma or a named value/type. I know I can mark it as json then any in typescript but I'd like to know if it's possible to type something like this Do you have any ideas ? Thank you very much export interface Offer { id: string originalPrice: string...

Schema migration automation

Public schema is attached to my node.js app...i want to migrate schema of for y name schema to database.... I have prisma/public/public.schema folder structure and prisma/shema.prisma for schema db structure...so on api request i want to do migration how??? I have used excutesafe but its failed due to multiple commands.... Sql inside of it.......

Timeline for GAing the `driverAdapters` feature?

Hi, Is there a timeline for GAing the driverAdapters preview feature? And is there any other info about "re-hauling part of the prisma-engines architecture"? I saw a comment about this here on GitHub: https://github.com/prisma/prisma/issues/23930#issuecomment-2598462547...

Prisma DateTime

Does the Prisma DateTime type make the DB use more storage than just storing a unix time when using MongoDB? Since its stored as a full date string.

type-safely wrapping `findMany`

I am trying to wrap the findMany function in a separate function. Can someone help me to get this right: ```ts...

cuid2 length

What is the length of the generated cuid(2) ids? I'm looking to validate them via zod.

Modeling data

Can i make my model for a specific field be lowercased just like doing something like this model User { email String @unique @@lower }...

Intermittent Server Error with Prisma 6.2.1 with Node 22 on Linux Mint

I am building NextJS application with Prisma on Linux Mint and have recently starting getting intermittent errors when running the application on localhost. For example, if I change a file and spark a hot module replacement, SOMETIMES it will give me an error on the console saying : (see attached) ``` ⨯ [Error: [object Object]] { digest: '520418415' } GET / 500 in 2396ms...
No description