Prisma

P

Prisma

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

Join

prisma decimal and react router 7

yow guys, since React Router v 7 is released today, is there any plans that Prisma.Decimal is configurable due turbostream? The only problem i got left in my application is prisma.Decimal not being perfectly transfered to the client as an instance i guess or any workarounds for this`?

TypedSql generating wrong types from the query

* DESCRIPTION My query returns the chests from the chest table and add to it the numOfKeys the user has for those chests by joining the chestKeys table, while returning the chests , if the user does not have a chestKey record I am explicitly falling back to 0 instead of null * ISSUE TypedSql is returning numOfKeys as number | null ...
No description

Bug in TypedSQL in version 5.22

Here is my schema postgres latest ```ts generator client { provider = "prisma-client-js"...

Postgis verstion update

Hello, How can I update from version 3.2.4 postgis to 3.2.6. 3.2.4 is currently in my database and that version is not existing anywhere now. So if I want to deploy my migrations on staging environment i have a problem ```...

Building the schema

I want to archive the content for a scholar who writes a series of posts related to a single subject, this series will have different shape for it's posts than other serieses. for example a series of posts have a verseId, chapterId, point_1, point_2, point_3. another series posts may look like this: characterName, content. And there will be a serieses created in the future I need some help and ideas on how to achieve that....

ORM for Expo, Android Build. Error: Unable to resolve module .prisma/client/react-native

Hey everyone. I'm trying to run an Android expo build on a project with the react-native-prisma. Here is my branch for reference: https://github.com/luketurnbull/todo-native-app/tree/lukes-local-first-todo I'm getting the following error in the Run gradlew step....

Delay when navigating between pages

Delay when navigating between pages using next/link despite utilizing loading.js, caching for fetch, or even static pages.

Problem with Stream on Pulse

GM, It was working in the past then we got some problem with NeonDB that have been fixed by Neon themselve Currently I'm unable to use stream() and it look like we don't have any event stored, we have activated event persistance like in the past ...
No description

rawQuery compilation

After switching from mssql to Prisma ORM, I noticed that the rawQuery calls are much slower than they were on mssql. Do they get precompiled and cached and if not, is there any way to? I have a pretty big query that takes about 520ms to complete while it used to be about 20ms. I also cannot use TypedSQL as I'm using SQL Server as database....
Solution:
Hey @PlanetTeamSpeak πŸ‘‹ There is some overhead involved even while using Raw Queries with Prisma as raw queries still need to be processed via the query engines, so at the moment it won't be as fast as a native mssql driver. We are working on a new prototype which should make queries alot faster. I don't have a timeline yet which I can share with you....

TypeError: The "payload" argument must be of type object. Received null

There's an ongoing issue in our codebase where Prisma queries that fail give the error in the title, which isn't the typical error we see in other projects. Our project is using NextJS 15.0.2 and Prisma (with neon serverless adapter) 5.22.0. Here is the client: `import { Pool } from "@neondatabase/serverless";...

Migrations hang on Prisma Postgres

Hi, out of seemingly no where, I can no longer migrate the DB. When I run the command I get this ```bash $ bunx prisma migrate dev --name updateembeds Environment variables loaded from .env Prisma schema loaded from prisma\schema.prisma...

nextjs + prisma: rawQuery breaking if using globalThis

Hi! I'm currently working on a nextjs (14.x) project, where I also want to use prisma (5.22). I have encountered an issue with nextjs always generating new clients in dev mode, so I followed the documentation and only generate the client, if it does not yet exist on globalThis. This seems to work when I use the client directly, but rawQueries only work on the first rendered route. As soon as a route has to be re-rendered (which happens very often in dev mode), the parameters no longer get properly resolved. Here is a simple example, queried with a freshly created client:...
Solution:
its a bit different, as I need multiple client instances due to a multi tenant setup. ```js import { PrismaClient as PrismaClientTenant } from './client' ...

FindUnique/Update using unique index on sub field

Hi, I need some help with generating a schema where I can query indexed sub fields. I've looked for solutions but I couldn't really find a thread matching my problem. Let me sketch an example. (I'm working with Prisma ORM with MongoDB)...
Solution:
Hi Raphael, Thanks for your fast reply. I've tinkered with this some more and found out it actually can be done. However the subfield should have a name that is not inside the model. ...

Concurrent request (Prisma)

Hello, I have a problem with Prisma on PostgreSQL. I don't know how to fix it
Context...

TypedSQL for SQL Server?

Are there any plans of adding support for SQL Server in TypedSQL? Seems like it wasn't even mentioned in the announcement nor was its lack of support mentioned. Only found out when I tried to use it.
Solution:
Hello @PlanetTeamSpeak πŸ‘‹ We do have a feature request for adding support of SQL server for TypedSQL here: https://github.com/prisma/prisma/issues/25215 ...

Connecting to MySQL server in production.

Hosted by DreamHost, my MySQL server in phpmyadmin cannot be connected by my NextJS application on DigitalOcean's app platform. I am faced with this error:
Error querying the database: Unknown authentication plugin `sha256_password'.
Error querying the database: Unknown authentication plugin `sha256_password'.
However, in localhost, it connects to the database perfectly. The environment variables are exactly the same....

Two Schemas but only one will stay generated at a time

Title is pretty explanatory. I have two schemas for different databases but I can run generate for one schema and then the other schema starts to have error lines in vscode, then generating the other schema swaps the errors to the first schema. Any way to fix this it’s pretty annoying.

Broken JsDoc on prisma Upgrade from 4 to 5.22

I just upgraded the Prisma version from 4 to 5.22 and noticed that my IDE no longer recognizes some typedefs I was using. I used to create a Typedef file to use the Prisma types in JSdoc. - Prisma version: 5.22 - NodeJs 20...

Optimize not showing recommendations for a finished recording (+ feature requests)

I've just started using Prisma Optimize and wanted to flag one bug and a couple of feature requests. 1. I'm not seeing any recommendations for either of the finished recordings 2. It would be super helpful to be able to sort the queries/groups tables by the columns, otherwise it's very inefficient to go through it to identify slowest ones (this might be less pressing depending on what the recommendations tab looks like when working. 3. Ability to name recordings would help to organize things...
No description

Best way to look for text in a deeply nested JSON?

I have a JSON field in a table. Which holds the metadata for the row. So what will be in the JSON is kind of unpredictable. Because it'll store tiptap editor json, other json etc., Here are the few examples Example 1:...
Solution:
Okay, I did this. `` const postsWithMeta = await db.$queryRaw<Posts[]> SELECT p.* FROM "Posts" p...