Prisma

P

Prisma

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

Join

PrismaModule as globle in neatjs with prisma service and dburl

How to #parametrize db url if i want to always pass this url from my request. I want like db per tanant model......

npx prisma migrate dev doesnt update @relation

`model Todo { id String @id @default(cuid()) customer String title String address String?...

Prisma postgres db not returning any records

I am getting this error with my prisma postgres instance. It was working just fine a few days ago
This request could not be understood by the server: {"type":"UnknownJsonError","body":{"code":"P6008","message":"Accelerate was not able to connect to your database. The underlying error is: Can't reach database server at `01jdpa97nkkn55vzfx27krp3n1.ewr1.db.prisma-data.net:5432`\n\nPlease make sure your database server is running at `01jdpa97nkkn55vzfx27krp3n1.ewr1.db.prisma-data.net:5432`."}} (The request id was: 8fd070b3cc01124f)
This request could not be understood by the server: {"type":"UnknownJsonError","body":{"code":"P6008","message":"Accelerate was not able to connect to your database. The underlying error is: Can't reach database server at `01jdpa97nkkn55vzfx27krp3n1.ewr1.db.prisma-data.net:5432`\n\nPlease make sure your database server is running at `01jdpa97nkkn55vzfx27krp3n1.ewr1.db.prisma-data.net:5432`."}} (The request id was: 8fd070b3cc01124f)
...

Yarn monorepo, vite, tanstack router: ERROR: Could not resolve ".prisma/client/index-browser"

``` Node.js v22.12.0 ✘ [ERROR] Could not resolve ".prisma/client/index-browser" ../../node_modules/@prisma/client/index-browser.js:1:23:...
Solution:
I tried this: https://github.com/prisma/prisma/discussions/20200 and adding to vite config: ``` alias: {...

How to find DIRECT_URL link?

Dear Prisma team, I am trying to connect my Prisma database with a direct url, but when activating Accelerate I can not seem to find it anywhere. How do I set up my database with username and password, and get the Direct url to connect my app to the database? Thank you.
No description

Type of client extended with dynamic extensions

Hi! In Prisma docs they say that to get type of extended client we can use factory function and ReturnType utility as follows: ``` function getExtendedClient() { return new PrismaClient().$extends({...

Prisma schema folder

I'm running v6. Is [schema folders] still in preview. I'm getting: ```...
Solution:
Running prisma format resolved the issue. What it did. I have no idea 🤷‍♂️

Prisma Optimize - small feedback

I've been using the Prisma Optimize on a paid starter. Currently I have no idea how many recommendations I have left + I don't even know the limit because the website states $5 for 100 but the payment page says 5$ for 6+ recommendation There are also many repeated recommendations that I basically got scammed on. Why should I eat a recommendation cost for the exact same recommendation just on a separate recording? (I don't mean the type of recommendation, I mean the actual table and column it is referencing)...

FreeBSD 14 - Help!

```[Davenk@s2]:<~/domains/firetickets.davenk.serv00.net/public_nodejs/public>$ npx prisma generate Need to install the following packages: [email protected] Ok to proceed? (y) y ...

Dependency-dependents relations

I am having difficulty understanding whether my schema is correct, even if it reports no errors. It's basically that I'm trying to express a package registry as part of a package manager, and am having difficulty specifying dependencies and dependents relations as part of the PackageVersion model. ```prisma model PackageVersion { id BigInt @id @default(autoincrement())...

Does Prisma Postgres support logical replication to work with Electric SQL?

Hi guys , does Prisma Postgres support logical replication? I am trying to use Electric SQL with Prisma Postgres. Any ideas if that is possible or not at this stage?

Sveltekit not receiving real-time data

Hello devs , i was trying to add real time events in my sveltekit app and with the release of prisma pulse and prisma postgreSQL so i added these features to my app but i had problem with prisma pulse , when i create a new DB i receive events when a change happens only in a short period of time and it stops working and i'm not having any error , in my pluse dashboard it says Replication slot status Unavailable idk if it means something , and this is my code , it will be nice of you if you take a look maybe i was doing things not in the right way ``` //api/+server.js import { prisma } from "$lib/index.js";...

Nestjs Prisma extension

Hi everyone I'm trying to fill the code field with a custom nanoid() with only uppercase letters and numbers, but when I do the $extends with my logic, I have two problems: - I think my custom nanoid() isn't working - Typescript is complaining because I didn't fill the code on the .create ...

nixos and prisma

There doesn't seem to be any support. is the correct way to go about it to compile manually for nixos?

how to return the number of pages when doing pagination?

If I'm taking 20 results for each page, how do you also return the total of pages in the same query? Repeating the query without pagination? 🧐...

prisma generate --sql and seeding

Hi, How can I use raw SQL to seed my database in Prisma? I would like to use the new SQL feature, but it seems to not work well with nested folders. ( prisma > sql > [version] > seed > [file].sql ) Also, I tried to read the content of SQL files, but I don't know why, when they are read, they aren't syntactically correct anymore to be called in executeRawUnsafe....

About recommended connection pool size

vm cpu: 15 prisma: 6.1.0 mysql 8.0.18 mysql max_connections: 4030 ...

Handle auto filter base on status of model (prisma and nestjs)

In my project, I have some roles, they are Student, Lecture, and Admin. I also have some model with status. Status = enum(Public, Private, Archive) Role= enum(Student, Private,Public) ...

Join a column with multiple tables.

I want to store all media in the system in a central table. Now the associated resource of the media can be anything, like chat, project, ticket, etc. So I have a Media model like this ``` model Media { id String @id ...