Nurul
Nurul
PPrisma
Created by Senshi on 11/6/2024 in #help-and-questions
Prisma Sentry Tracing
Hi, thanks for the ping and apologies for the delay. I am out of office at the moment. My colleague @RaphaelEtim should be able to help you out. Raph - can you check with ORM team if they have any insights?
6 replies
PPrisma
Created by kimb0x on 11/5/2024 in #help-and-questions
Can't delete records from Prisma Postgres in Studio
@RaphaelEtim When you are back, can you try to reproduce this issue?
20 replies
PPrisma
Created by samuelcole on 9/10/2024 in #help-and-questions
Optimize is not showing queries
What happens if you test without the readReplicas?
43 replies
PPrisma
Created by Virgile on 10/7/2024 in #help-and-questions
Still unable to get Optimize working in my NestJS app.
@Virgile Thank you so much for taking the time to share the repository and the loom recording with us. I am sharing it with our Optimize team to get insights on why queries are not showing up in a monorepo setup 🙏
16 replies
PPrisma
Created by Juanma 🐼 on 11/7/2024 in #help-and-questions
Dockerize Svelte with Prisma
Hi @Juanma 🐼 👋 Can you try including prisma generate command in your production step?
# Stage 1: Builder
FROM node:22-alpine AS builder
WORKDIR /app

# Install dependencies
COPY package*.json ./
RUN npm install -g pnpm
RUN pnpm install

# Copy project files
COPY . .

# Generate Prisma client
RUN pnpx prisma generate

# Build Svelte app
RUN pnpm run build

# Prune dev dependencies to reduce final image size
RUN pnpm prune --prod

# Stage 2: Production
FROM node:22-alpine
WORKDIR /app

# Copy necessary files and folders from the builder
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY --from=builder /app/prisma prisma/
COPY package.json .

# Generate Prisma client in production environment
RUN pnpx prisma generate

# Set environment variables and expose port
EXPOSE 3000
ENV NODE_ENV=production

# Run the application
CMD ["node", "build"]
# Stage 1: Builder
FROM node:22-alpine AS builder
WORKDIR /app

# Install dependencies
COPY package*.json ./
RUN npm install -g pnpm
RUN pnpm install

# Copy project files
COPY . .

# Generate Prisma client
RUN pnpx prisma generate

# Build Svelte app
RUN pnpm run build

# Prune dev dependencies to reduce final image size
RUN pnpm prune --prod

# Stage 2: Production
FROM node:22-alpine
WORKDIR /app

# Copy necessary files and folders from the builder
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY --from=builder /app/prisma prisma/
COPY package.json .

# Generate Prisma client in production environment
RUN pnpx prisma generate

# Set environment variables and expose port
EXPOSE 3000
ENV NODE_ENV=production

# Run the application
CMD ["node", "build"]
3 replies
PPrisma
Created by al on 11/7/2024 in #help-and-questions
new optional field failing
Is npx prisma generate a part of your build script? I assue you go this error on your deployed app.
7 replies
PPrisma
Created by stryche. on 11/7/2024 in #help-and-questions
enum @map value
Thanks for linking the PR. It will be accepted as the PR is from our ORM engineering team 🙂 At the moment, the behaviour you are observing is intentional. Considering this is a breaking change, the plan is to have it in next major Prisma release i.e. Prisma 6
11 replies
PPrisma
Created by Pyro Byrns on 11/6/2024 in #help-and-questions
Seeking Work
Hello @Pyro Byrns 👋 Have you applied for any suitable roles via our careers page? https://www.prisma.io/careers
2 replies
PPrisma
Created by zaloster on 11/5/2024 in #help-and-questions
Migrations taking too long
Can you run this command and share the time you are observing?
DEBUG="prisma:migrate*" npx prisma migrate dev --skip-generate
DEBUG="prisma:migrate*" npx prisma migrate dev --skip-generate
10 replies
PPrisma
Created by zaloster on 11/5/2024 in #help-and-questions
Migrations taking too long
I was able to find a related GitHub Issue: https://github.com/prisma/prisma/issues/22092 I believe you are reporting the same behaviour
10 replies
PPrisma
Created by zaloster on 11/5/2024 in #help-and-questions
Migrations taking too long
Oh! I thought you had a long list of migrations which might be causing this delay.
10 replies
PPrisma
Created by zaloster on 11/5/2024 in #help-and-questions
Migrations taking too long
Hello @zaloster 👋 Have you tried squashing your migrations? It should be helpful in reducing the time taken for generating a new migration https://www.prisma.io/docs/orm/prisma-migrate/workflows/squashing-migrations#creating-a-clean-history-in-a-production-environment
10 replies
PPrisma
Created by Senshi on 11/6/2024 in #help-and-questions
Prisma Sentry Tracing
Hi @Senshi 👋 Are you referring to this integration? https://docs.sentry.io/platforms/javascript/guides/express/configuration/integrations/prisma/ At the moment, I am not sure where that HTTP request comes from. I'll need to check with team internally
6 replies
PPrisma
Created by Faiz Khatri on 11/5/2024 in #help-and-questions
Migration creates Implicit relational tables in database for an explicit M-N relationship
No worries! Happy to help! 🙂
5 replies
PPrisma
Created by kimb0x on 11/5/2024 in #help-and-questions
Can't delete records from Prisma Postgres in Studio
Hi @kimb0x Thank you for sharing the error message. What happens if you try to delete a single record via Prisma Studio?
20 replies
PPrisma
Created by TJ on 11/5/2024 in #help-and-questions
How to derive a type from types generated by Prisma?
Hello @TJ 👋 Have you seen this section of our docs? https://www.prisma.io/docs/orm/prisma-client/type-safety/operating-against-partial-structures-of-model-types I believe this should be helpful
2 replies
PPrisma
Created by Aliza on 11/5/2024 in #help-and-questions
Creating Custom Thumbnails: Overcoming Background Skin Upload Challenges
It looks like you are in wrong Discord. This discord is for Prisma ORM: https://www.prisma.io/
4 replies
PPrisma
Created by Faiz Khatri on 11/5/2024 in #help-and-questions
Migration creates Implicit relational tables in database for an explicit M-N relationship
Hi @Faiz Khatri 👋 In your schema, you have defined an explicit many-to-many relationship using the ParametersToTests model. However, you've also defined an implicit many-to-many relationship by including Parameters Parameter[] in the Test model and Tests Test[] in the Parameter model. To avoid creating the additional _ParameterToTest table, you need to remove these implicit relation fields and rely solely on your explicit relationship through the ParametersToTests model. Something like this should work
model Test {
id String @id @default(uuid())
name String
description String
price Float
current_price Float
created_at DateTime
updated_at DateTime
order_id String?
TestsOfMembersInOrder TestsOfMembersInOrder[]
ParametersToTests ParametersToTests[]

@@map("tests")
@@schema("public")
}

model Parameter {
id String @id @default(uuid())
name String
Parameter_category Parameter_category? @relation(fields: [categoryId], references: [id])
categoryId String
ParametersToTests ParametersToTests[]

@@map("parameters")
@@schema("public")
}

model ParametersToTests {
test_id String
Test Test @relation(fields: [test_id], references: [id])
parameter_id String
Parameter Parameter @relation(fields: [parameter_id], references: [id])

@@id([test_id, parameter_id])
@@map("parameter_test")
@@schema("public")
}
model Test {
id String @id @default(uuid())
name String
description String
price Float
current_price Float
created_at DateTime
updated_at DateTime
order_id String?
TestsOfMembersInOrder TestsOfMembersInOrder[]
ParametersToTests ParametersToTests[]

@@map("tests")
@@schema("public")
}

model Parameter {
id String @id @default(uuid())
name String
Parameter_category Parameter_category? @relation(fields: [categoryId], references: [id])
categoryId String
ParametersToTests ParametersToTests[]

@@map("parameters")
@@schema("public")
}

model ParametersToTests {
test_id String
Test Test @relation(fields: [test_id], references: [id])
parameter_id String
Parameter Parameter @relation(fields: [parameter_id], references: [id])

@@id([test_id, parameter_id])
@@map("parameter_test")
@@schema("public")
}
5 replies
PPrisma
Created by derek-coveai on 10/31/2024 in #help-and-questions
Is there a delay in cache invalidation taking effect?
No worries 🙂
7 replies
PPrisma
Created by SoxZz5 on 11/2/2024 in #help-and-questions
Optimize + NestJS not working
@SoxZz5 To confirm, you cloned the code from this example and it didn't work for you? https://github.com/nurul3101/Optimize-NestJS/tree/main One other user reported the same intially, but it worked for them eventually. https://github.com/nurul3101/Optimize-NestJS/issues/2
7 replies