Prisma

P

Prisma

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

Join

[MongoDB] dup key: { itemId: null }, labels: {}

``` Error: MongoDB error Kind: Command failed: Error code 11000 (DuplicateKey): Index build failed: 83c54d6a-ffb6-44a5-8c6e-4ada6aa59ad6: Collection db.Collection ( 3fb85909-5e6c-4151-9a94-d99bdc225628 ) :: caused by :: E11000 duplicate key error collection: db.Collection index: Collection_itemId_key dup key: { itemId: null }, labels: {} 0: schema_core::state::SchemaPush at schema-engine/core/src/state.rs:433...

Prisma not working on middleware even tho the app is being ran on a server.

Hi guys, I keep getting this error when using Prisma with Next.js 14 app, I plan to run my app on a server in a docker container so not edge runtime will be used, but I keep getting this: ``` [Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware. In order to run Prisma Client on edge runtime, either: - Use Prisma Accelerate: https://pris.ly/d/accelerate...

DB Connection String: connection_limit which side does it control exactly?

so I'm kinda of confused from the docs, does connection_limit specify how many active connections does Accelerate pooler open against the DB, or the connection_limit for each client to the Accelerate pool itself?
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: 21)
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: 21)
...

Neovim hightlight isn't working

I already installed prisma-language-server and it's working, but hightlights not started yet What i need to do?...
No description

Problem with first connection to database

Hi i created cront task app in js and i use prisma in in to save some data and log to database, and i have problem with first connection to database, i set my app to retry tast so i know that when i run same task second time it works fine without error... i added to my connection string ...
Solution:
```js if (updatedProductsData.length !== 0) { for (let product of updatedProductsData) { promises.push( prisma.Product.updateMany({...
No description

How to execute postgres function in node js?

I have a postgres function and want to execute in node.js. Please help to do it

optionally adding an $extends clause to prisma export

how can I accomplish the following fuctionality: basically I want to be able to access db replicas only in my production instance and not in any other environment. what I'm trying to do export default process.env.DB_REPLICA_URL_1 && process.env.DB_REPLICA_URL_2...

Extends result relations

Hi, I have 3 different objects: ```typescript model User { id String @id @default(uuid())...

How to create Prisma triggers ?

How to create Prisma triggers ?

Best practices for updating column type when there are existing records

I'm seeking some guidance on updating a column type when there are existing records in my database. Here's the scenario: Original Model: ...

Error validating datasource `db`: the URL must start with the protocol `prisma://`

Hello everyone! Im currently getting this problem that i descriped in the title. where when i try to run Prisma on cloudflare workers i tried the soultion from here "https://www.prisma.io/docs/orm/reference/prisma-client-reference#programmatically-override-a-datasource-url" but cant seem to get it to work...

Many to many on the same model, multi directional?

I have a fairly simple question and have been struggling long enough that I thought it warranted a question. I have a simple concept: one model is an Artist and I want to have a “related artist” array. I am familiar with the many to many and relations attribute to set up and have both models populate. I have a RelatedArtist model that houses both an artist and a related artist on it. It works fine and I’m able to join the records using this model. ...

How to type $allModels result extension

I have the following simple example of a result extension: ``` $allModels:{ $toJson:{ compute(data){...

Is it possible to have workspaces transferred from one user to another?

I lost access and since let the only other person who has access (a contractor) go 😦

offset-based pagination in a field with a relation

```js let item = await prisma.item.findFirstOrThrow({ where: { id: req.params.id },...

is there any way we could get in touch with someone from the accelerate team?

someone in the sales/management team? our product shat the bed spectacularly today and we're about to lose one of our major customers because accelerate couldn't scale to handl 100 connections. we're ready to throw money at the problem but this is super urgent and we've been locked into the ecosystem and can't switch out right now

prisma accelerate + custom directory

I need help with prisma acellerate + custom directory the withAccelerate method imported from @prisma/extension-acellerate import from the @prisma/client directory and not the custom directory, which then fails as the module does not exist. How do I change this?...

Custom database_url from command line?

Hey is it possible to run "npx prisma migrate deploy" with a custom database_url? I want to deploy my migrations from my azure pipeline but i dont want to use my .env for my prod database_url...

can I use prisma with Mongodb for real time data fetching ?

I am creating ad feature like google ads, wants to run ads in queue 1 by 1 after each 2 minutes. But with Next.js 14 serverless api and Mongodb I don't think its possible. Can we build this using prisma. Like all users will see same advertisement in real time in queue...

Filtering time

I am using mysql db with prisma this are the fields in my schema ``` time_from DateTime @db.Time(0)...