Category "prisma"

Prisma: make boolean so only one can be true at the same time

Is it possible to make a boolean "unique" in Prisma? I want only one row to be 'true' at the same time. @Unique doesn't work because there can be multiple 'fals

I want to use Prisma to store nested comments (like on reddit). How can I retrieve all the nested comments?

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? @

Prisma SQLite List

I'm trying to add a List to a model using String[] but it it gives me this error: Field "stats" in model "Player" can't be a list. The current connector does no

How to resolve 'getUserByAccount is not a function' in next-auth?

I've updated Nextjs to it's newest version and also updated next-auth and the prisma adapter as specified by the docs. However, when I try to authenticate in th

get Forbidden resource even when the requested user is admin

Middleware is used to protect the resolver. The middleware checks the role of user and despite the right role of the requested user I cannot access listUser que

Nextjs Api unit test - difficult to mock prisma client

I am stuck since long as it is kind of difficult to mock DB calls in unit testing in Nextjs. I have used @prisma/client for database communication. I have studi

How do I write a Prisma findFirst where clause that OR's two AND's -- or how does prisma treat undefined's?

I am using Prisma I have a postgres table I want to search, finding only the record that matches where (id and accessKey) or (id and ownerId) It keeps finding w

Make a change to the database with Prisma.js without having to reset the whole thing

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-mak

Prisma.js: We found changes that cannot be executed

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

prisma - getting environment variable not found error message when running graphql query

I am getting this error message from prisma when I am running the GraphQL query. Environment variable not found: DATABASE_URL.\n --> schema.prisma:6\n |

Apollo Client useMutation data always returns undefined

I have the following code that runs a mutation to update a post to "published" the mutation works great! It updates the data as expected. However, the data prop

How to configure NextJS Server API GraphQL Subscription

currently i'm learning how to develop an application using graphql. I'm facing the error of implementing the subscription inside my application resolver.js cons

typegraphql-prisma: Unable to infer GraphQL type from TypeScript reflection system

I've got an application (remix-run) with prisma and mongodb. I would like to use typescript-prisma to generate graphql resolvers. In my schema.prisma, I have cr

How to run CLI migrations in a Continous Integration pipeline on a private database on AWS RDS

I am currently using a tool that allows you to apply database migrations only using a CLI (Prisma). My database is in a private network in AWS. To do it manuall

Dockerize NextJS Application with Prisma

I have created a NextJS application, to connect to the database I use Prisma. When I start the application on my computer everything works. Unfortunately, I get

Prisma Schema not updating properly after adding new fields

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())

Mimic COALESCE behaviour using groups of conditions when querying with Prisma client

I'm trying to replace a SQL query (Postgres) with a Prisma client query, and I'm struggling to implement this COALESCE logic: COALESCE(date_1, date_2,'1970-01-0

How to use next-auth using ldap and prisma

i am using next-auth with ldap to authenticate user name and password. i am able to log/authenticate the user using username and password. but when i can't crea

Timestamp with timezone column in Prisma

I am evaluating Prisma and I am a complete noob... I am using Postgresql I have the following model definition model Sth { id Int @defau

Error connecting server to DigitalOcean Postgresql droplet

I am aware that I can connect to a pre-configured Digital Ocean PostgreSQL database cluster and that's what I'm actually connected to right now, but I'd like to