Prisma

P

Prisma

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

Join

Docker error Can't reach database server at localhost:5432

I'm using docker compose and my server api depends on a postgres server in the same container. During the build I run
prisma migrate deploy
prisma migrate deploy
and get this error. I also tried replacing localhost with 0.0.0.0 and db (my database's docker service name) but it does not work. Strangely from my dev machine I'm able to run
prisma migrate dev --name init
prisma migrate dev --name init
without issue using this same DATABASE_URL variable. ``DATABASE_URL="postgresql://freeauth:freeauth@localhost:5432/freeauth?schema=public"...

Why doesn't the generated client use the .env file specified by dotenv?

package.json ```json { "scripts": { "migrate:dev": "dotenv -e .env.development -- npx prisma migrate dev"...

Prisma seed data erased during testing in single test file run

Hello all, I've been using prisma for a couple years now so I'm relatively familiar with the ORM and I'm a big fan . However I'm having this problem. I've searched online and haven't found a solution. Here's the situation: * I have a postgres test db running in docker....

Learning Prisma from 0

Hi all, I am following the Prisma docs and I am running into an error message. This is an exisiting project so it is not from scratch but I was wondering if someone could point me out in the right direction? Thanks!! https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-typescript-postgresql...
No description

Does Raw Queries Hit Read Replica ?

Hey folks There are places where we use raw sql queries which are unavoidable , we have a read replica setup as well we did that as suggested in the documentation with prisma/extension-read-replicas package My question is when using raw queries will the query hit Master DB or read replica....

TS Type Issue on Nested Selects

Error, console logs, model and query are below. Query returns data as expected. Thanks.
userData?.cart?.cartItems // Property 'cartItems' does not exist on type '{ id: string; userId: string | null; expiresAt: Date | null; createdAt: Date; updatedAt: Date; }'.ts(2339)
userData?.cart?.cartItems // Property 'cartItems' does not exist on type '{ id: string; userId: string | null; expiresAt: Date | null; createdAt: Date; updatedAt: Date; }'.ts(2339)
...

stuck with prisma and supabase using nextjs14 when i want to npx prisma db push/ migrate / reset etc

Environment variables loaded from .env It is almost 24h since i have been stuck in it using nextjs14 I tried to reset supabase server multiple times and recreater the server and clone the repo still i am stuck in the new repo as well ...

Issue with permissions for setting up replication for prisma pulse

Hi all, I am trying to use a Azure hosted postgres db and I am running into issues running through the steps for setting up the data replication that is required for pulse to work (ref: https://www.prisma.io/docs/pulse/database-setup/general-database-instructions). I was wondering if anyone has found a work around to this issue? The error that I am getting is lack of permissions I am using the user that I create when I create the database in Azure.

Is it possible to use prisma pulse if your database is behind a VPN?

Need to know for our GCP postgres implementation.

Get type of `create` with `connect`?

```ts db.course.create({ data: { title: 'New course', tutor: {...

Can't reach database server error

I was working on a project for a while and then suddenly I got this error. Something that confuses even more is that the same code works fine on my production build with the same env. I am stuck with this error. What am I missing?
No description

Error: @prisma/client did not initialize yet.

Hello everybody! I'm working on a small nextjs project and ran into this error, after entering my info and going to my dashboard page: Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again. export const client = globalThis.prisma || new PrismaClient() ...
Solution:
I had a similar issue, and I think I solved it by setting up a separate Prisma client file that looks like this ``` import { PrismaClient } from "@prisma/client"; ...

I'm trying to use prisma prisma in remix (ERR_RESOLVE_PACKAGE_ENTRY_FAIL)

I tried this code to see if I saw the changes. ``` import db from "./db" // import your extended Prisma Client instance async function main() {...

Error bubbling in $transaction client

We've written a helper decorator to wrap certain functions in a transaction. ``` return ((this as DbClass).db as PrismaClient).$transaction( async (txn) => { (this as DbClass).db = txn;...

Updating user info in db using forms

I have a basic user model ```model User { id String @id @default(cuid()) name String? email String? @unique...

Own local Caching?

Hey, does prisma also have a localcaching or something? except the prisma accelerate. i would like to have something local because the internet is getting worse and worse in germany 😦 Does anyone know anything current? e.g. an NPM package?...

Import Enum from my TS to the schema

Hey, Wanted to know if it's possible to import an enum inside my schema.prisma file instead of defining it inside ? Because all my types used by both front & back are located to a dedicated package, and it actually force me to define my enum in 2 distinct places, where I would like to only have it in my types package....

reset db and migrate changes

greetings! I am starting with Prisma ORM, I am having difficulty restarting the database and migrating changes made in my project in an automated way. Could someone show me an example? I speak Spanish, but I use Google translate

Unable to run db push because of introspected inconsistencies with supabase

Hi, I'm working with a postgres database on supabase. After running db pull with a multischema setup (public+auth), I ultimately reverted back to a simple public access and removed all the introspected tables from my schema.prisma. Currently my schema contains a single table unrelated to supabase. I'm trying to db push it but I get an error as follows: ``` Error: P4002 ...