prisma2 Questions
5
Solved
How can make a change to the database with Prisma.js without having to reset the whole thing?
if I have used this command
npx prisma migrate dev --name role-makeOptional-NormalizedName
I will lose...
4
Solved
consider following Prisma schema:
model Conversation {
id Int @id @default(autoincrement())
createdAt DateTime @db.Timestamp(6)
messages ConversationMessage[]
}
model ConversationMessage {
id ...
Timms asked 11/6, 2021 at 3:41
5
I'm confused about how Prisma code generation in production works. The Prisma CLI is supposed to be installed in devDependencies, yet the npx prisma generate command needs to be available in produc...
5
Currently on my first NestJS project. I am using Prisma 2, and would like to log the queries to the console in debug mode, to learn and inspect and avoid n+1 etc!
I have created the prisma.service....
Octogenarian asked 12/5, 2021 at 18:29
11
As the title states, I am using Prisma 2 in a Next JS app. I have a very simple schema:
model User {
id Int @id @default(autoincrement())
firstName String
middleName String?
firstLastname Stri...
Godfry asked 11/1, 2021 at 8:8
14
Solved
I'm working on ReactJS project with NextJS Framework and Prisma to manage connection and queries to the DB.
On my local project the Support model is found and when I use it in my API and build my p...
Sailer asked 21/9, 2021 at 19:22
3
Solved
I would like to know how can I remove all items in table with Prisma2 and Jest ?
I read the CRUD documentation and I try with this :
user.test.js
....
import { PrismaClient } from "@prisma/c...
Supper asked 18/6, 2020 at 18:44
5
Solved
I've used prisma.js as an ORM in my project.
After executing the npx prisma migrate dev --name rename_and_add_some_columns,
I got this error:
We found changes that cannot be executed
Error Detail...
3
How can I upsert many fields in prisma ORM with one query?
I don't want to use upsert fields one by one. Can I upsert all of them with one query?
Hays asked 23/1, 2022 at 11:19
5
Solved
I ran into an issue where I need to check if a user exists by his username and email since both are unique fields in the database, but I got an error.
Argument where of type UserWhereUniqueInput ne...
Galsworthy asked 1/2, 2021 at 19:6
2
Solved
I have a database with multiple tables that frequently need to be queried with LEFT JOIN so that results contain aggregated data from other tables. Snippet from my Prisma schema:
model posts {
id ...
2
Given the following schema. How would I query for the latest commit on each repository using the prisma2 client?
model Commit {
id String @default(uuid()) @id
date DateTime @default(now())
}
mod...
3
Solved
I have these 3 prisma models,
model user {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
courses userOnCourse[]
}
model course {
id Stri...
Exclude asked 8/6, 2021 at 21:34
3
I'm currently working on a project that we are using Prisma 2 and postgreSQL as database support. From my understanding, whenever I made changes to the schema.prisma file and I want to migrate the ...
2
Solved
Does prisma support the ability to fetch data from multiple schemas from within a single database?
Siddra asked 22/1, 2021 at 6:50
5
Solved
In my Prisma schema, I have a many-to-many relationship between posts and categories. I've added @map options to match the Postgres snake_case naming convention:
model Post {
id Int @id @default(a...
Natalianatalie asked 29/1, 2021 at 7:33
3
As in this document of Prisma, set can be used to override the value of a relation.
const user = await prisma.user.update({
where: { email: '[email protected]' },
data: {
posts: {
set: [{ ...
Scintillometer asked 2/11, 2021 at 2:5
3
I can't use apollo Studio. After migration for Graphql playground. When I try to run in localhost and redirect me to apollo studio sanbox https://studio.apollographql.com/sandbox?endpoint=http%3A%2...
Tish asked 16/7, 2021 at 14:23
1
Solved
I have made a query below that search user using two columns. But it seems not working properly, I assume it is querying the where clause in each column instead of both columns.
Is there a way we c...
1
I want to model nested comments, like on reddit. I'm using a one-to-many self relation like this:
model Comment {
[...]
parentId String?
parent Comment? @relation("ParentChildren", fie...
1
Solved
I use nestjs and postgresql with prisma. I have 2 tables in relation, I want to create a where clause in order to fetch the records if count of the records in the second table is less than -let's s...
1
I am using Prisma & PostgreSQL. Here I grab some stuff:
await prisma.items.findMany({
where: { itemId: itemId },
include: {
modules: {
include: {
lessons: true
}
}
}
});
I do not need...
Staten asked 27/10, 2021 at 12:15
1
I'm trying to implement a tinder-like simple app with Prisma where a user can swipe left and right to like or dislike another user, and after that, I was to be able to fetch the matches and the can...
Kirksey asked 28/8, 2021 at 12:37
1
Its my first time trying prisma and am stuck. So I have "products" and "filters" model.
I want the following query to work. The idea is, I want to fetch the products with dynami...
Birkle asked 10/7, 2021 at 10:49
1
Solved
I am creating a model using Prisma 2 and want to set a minimum and maximum length for one of the fields. I.e., something like this:
model Post {
...
title String @min(3) @max(240)
...
}
I just ...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.