Prisma

P

Prisma

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

Join

Middleware error: PrismaClientKnownRequestError

On localhost it works all fine no error, nothing, but on vercel there is this issue "Middleware error: PrismaClientKnownRequestError: Invalid prisma.subdomain.findFirst() invocation: Error validating datasource db: the URL must start with the protocol prisma://" i dont know why, my env is...

In one of my migration i have

-- CreateExtension
CREATE EXTENSION IF NOT EXISTS "postgis" WITH VERSION "3.2.4";
-- CreateExtension
CREATE EXTENSION IF NOT EXISTS "postgis" WITH VERSION "3.2.4";
...

Does Prisma support MariaDB 10.6

https://www.prisma.io/docs/orm/reference/supported-databases mentioned MariaDB 10.0+ Does the + means 10.0.x or the versions from 10.0 (including 10.6)?...

Way to run migrations & seeding using the PrismaClient

Hi, is it possible to run the migrations and seedings for Prisma at runtime using the PrismaClient instance? Would prevent me from having to bundle all source files into my docker containers as well, since its all compiled down....

Is there a delay in cache invalidation taking effect?

We're on the Pro plan and have recently started using cache invalidation w/ our accelerate queries. We're seeing that queries immediately after cache invalidation are still getting the cached value - is this expected? Our use-case is that we're storing user data in the cache w/ a sanitized version of the user email as cache tag. When a new user signs-up, they'll originally have a null value in the cache. After we create the user in our DB, we invalidate the cache, but we see that queries still get the null value for 1-2 seconds after invalidation. What is the typical delay for invalidating the cache?...

Why is omit not available for this query?

I am using prisma 5.21.1. If I try this call omit is not available why? ```typescript client.profile.findFirst({ omit: { password: true,...

How to use set a relation and update in the same time rows

Hey ! I wanted to know if someone know how to achieve this : ```ts const data: Prisma.ModuleUpdateInput = { name: input.name, description: input.description,...

How risky is Prisma Postgres now ?

Hi people, I just read on Pirsma doc that Prisma Postgres contains a risk on total data loss. Yet they say it's because of the absence of automated backups only I'm still worried, can I use it for my hobby project or should I wait ?
Solution:
Hi @rj_franc0 👋 You can use it for your hobby project but you would be responsible for manually backing up your data to mitigate the risk. If the risk of losing data is acceptable and you don’t mind occasionally exporting your data manually, Prisma Postgres could work well for you....

Prisma Postgres Pricing

The pricing is unclear when comparing to pricing pages such as Supabase. I see on the starter/free plan it notes "...

prisma postgres

In the new prisma postgres serverless. Can i connect on it as usual? using postgresql://user:password@host:port/database format?

Need Help with CRUD operations

Hey devs, I have been facing this error where my component expects a user ID which was not provided. I need to refractor my backend and all so that my app doesn't need a user ID to make any CRUD operation. The more I am doing the changes, the more I am getting more errors. I am new to Prisma. Can someone help me out, please?

Fail first deployment with typesafe raw query

The prisma generate --sql needs the queried tables/models to exist in the database. So if it's the first time you deploy, this build command will fail. prisma generate --sql --no-engine && prisma migrate deploy && next build But without --sql it will also fail....

How do you approach local development with db changes?

Hi all, I'm using a standard next.js prisma setup. I was wondering how teams approach migrations on separate branches, and handling merging and undoing them. ie if i start a migration on my branch, but decide not to keep it, how do I undo those changes when I go back to my main branch? in traditional worlds I'd run a down migration on the branch before i switch to main, curious if a similar concept exists here in prisma....

Help. Prisma ORM is not loading environment variables

When I run db:deploy. It always errors saying DATABASE_URL was not found if the DATABASE_URL is not present on a .env file. I've run echo $DATABASE_URL it returns postgres://pos... (the correct DATABASE_URL). If this same DATABASE_URL is present on a .env file. It works correctly. I'm using the folder schemas, so I tried to make the schema path explicit like this:" "db:deploy": "prisma migrate deploy --schema ./prisma/schema"...

Checking Null or empty list

I have a field of type integer list in my DB. I want to add a filter if is empty or null, ```js { OR: [...

prisma migrate diff freezes

pnpm prisma migrate diff --from-migrations=migrations --to-schema-datamodel=schema.prisma --shadow-databa se-url=$DB_URL Running the above command shows no output for over 2 minutes. How can I know if it's doing something or just stuck? Is there a verbose option to see which db commands it's attempting?...

Live events with prisma pulse for games

Hello , My backend is a traditional transactional backend that serves multiple games at the same time . it stores balance , open chests , give rewards etc , but nothing like a "game server" for real time things , however recently for some games I want to implement real time events such as user is playing (think of it like subway surf) , he reaches some checkpoint/num of minutes , need to grab this event from the game and check if he matches the event requirements and then reward the user with keys , I already have this system with request/response , but now the key should actually directly be spanned into the game , so the game should have a direct instant reward would having web sockets between the game and my server + my server and prisma pulse solve that...

unit testing with @default() value, using jest-mock-extended

Hello :) I'm not sure this is the appropriate place to post this, but I hope I can get some help here. I'm currently working on a project and was looking into unit testing my prisma extended client with unit tests and jest.

pnpm install puts prisma generate in the wrong folder

this is my root pnpm-worspaces.yaml ``` packages: - 'database' - 'website'...