Prisma

P

Prisma

The official Discord for the Prisma ORM and Prisma Data Platform! Learn more at https://prisma.io

Join

Compilation error using prisma engines

I use Prisma for interacting with the database for my code and it worked fine. Coming back to my code I get these errors which is a bit confusing. It seems some of the error is coming from Quaint. I need help and an explanation, please ``` Value::Integer(i) => i.map(PrismaValue::Int).unwrap_or(PrismaValue::Null),...

Can I use Prisma ORM in a JavaScript project?

Is it recommended to use Prisma ORM with a TypeScript project only? I'm using JavaScript and Postgres in a NodeJS project so I think I won't need a tsconfig.json file. Is it considered best practice to only use Prisma ORM with a Typescript poject?

How can I fix the migration order (already applied in production)

While working in feature branches, it is difficult to maintain the order in which the migrations are applied. Let's say we delete a table in the migration and there's another migration that modifies the column of this table. The migration that deletes the table occurs first(created) but gets applied after the modification of the column takes places. While this works in production database, because edit column migration has already been applied at the time of applying deletio migration....

Prisma.DbNull doesn't work with Prisma Accelerate

Prisma Accelerate doesn't seem to support Prisma.DbNull. This is unexpected and production-breaking for us since we enabled Accelerate. For example, if you use Accelerate: ``` import { PrismaClient } from "@prisma/client/edge"; import { withAccelerate } from "@prisma/extension-accelerate";...

Are Prisma queries parameterized to prevent SQL injections?

I was just reading about parameterized queries today and I was wondering does Prisma use parameterized queries under the hood to prevent SQL injections? I tried searching the docs for info about this, but could only find info about writing raw queries that are parameterized (which is not what I am trying to do)...
Solution:
Yes, if you turn logging on you can see the queries, it takes a touch more effort to see the parameter values, but it's doable.

Still unable to get Optimize working in my NestJS app.

Hi everyone. I would really like to try Optimize, and have been trying for some time. See similar discussion here https://discord.com/channels/937751382725886062/1270167207204356178/1275034014025121792 But it does not record anything. There is not a single log. No "errors" logs, no "success" logs. I don't know what's going on. Did Optimize initialize successfully ? Did it error ? Again, using NestJS. Here is current non-working code :...

sql Tagged Template Function

Hi everyone. Please help. Where can find the tagged template function called 'sql' in the code?

Hitting connection limits multiple times in a microservice environment

I run a bunch of AWS Fargate tasks and they all have their own prisma client connecting to the same database. Frequently, I come across the following error 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) ...

schema.prisma not found after changing the location

Hello, I'm new in NuxtJS and I'm trying to add Prisma to my NuxtJS environment. So I followed the steps https://nuxt.com/modules/prisma. When I do that, prisma auto create : - A ./lib folder with prisma.ts file inside...
No description

MongoDB DataType Code

Is it possible to use the "Code" data type with Prisma in MongoDB? If so, how?

Seeding New SqliteDB in Epic Stack

am trying to create a new Epic Stack application on a old Windows 10 laptop. When I try to run the setup it seems to break while trying to seed. Environment variables loaded from .env Running seed command tsx prisma/seed.ts ... šŸŒ± Seeding......

Hello, is it possible to bulk import data from a CSV into my postgres DB using prisma

I have a CSV file which I want to copy into my DB using SQL functions, I can currently do it with pgpooler (copy from stream) but I want to use prisma to do this. How can I do this?

Prisma pulse TS error.

I installed prisma pulse extension in a new Next.js project. However, I am trying to set my prisma.ts file ```import { PrismaClient } from "@prisma/client"; import { withPulse } from "@prisma/extension-pulse"; ...

Sorting by Relations

Hello, I am trying to introduce infinite scrolling im my application but I am running into an issue. I am using Prisma ORM with sqlite through Turso here is what I curently have ...

Help Needed: Error with Postgres Schema, OpenAI Embedding and Prisma

I'm currently working on saving OpenAI embeddings in a Postgres schema, and I'm encountering a TypeScript error. Below is the schema I'm using: model SentenceEmbedding { id String @id @default(cuid()) voiceNoteId String voiceNote VoiceNote @relation(fields: [voiceNoteId], references: [id], onDelete: Cascade)...
No description

How to extends the client for adding soft delete features currently this is not working how to fix ?

import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common'; import { PrismaClient } from '@prisma/client'; import { prismaExtendedClient } from './extension'; @Injectable()...

How to do operations on multiple columns

Hi, let's say I have the following table structure: A | B | C which are all ints I would like to be able to find all rows such that a*a + b - 30 = c I assume I would start like this:...

Problem fetching relations where where-clause have same field name

I want to fetch a User object by username with all relevant followers and their user objects. Just one level, something like: { name, email, username,...

Unexpected message from server

Hi all, we see this error pretty randomly
error in connector: error querying the database: unexpected message from server
I try to replicate with the same query, but the error persists. Is this the kind of error wherein it makes sense to implement some kind of retry logic?...

NextJS + Prisma + Docker | "can't reach db server"

I will supply all of my files in comments because of the character limit. The first issue is that when I run my docker compose up, it generates the prisma client, then it runs npm build. On the build, it cannot connect to the database server (shown on the included image) For context, I am using this as a reference: https://github.com/99lalo/nextjs-prisma-docker...
No description