gaurav1998
gaurav1998
Explore posts from servers
PPrisma
Created by gaurav1998 on 6/3/2024 in #help-and-questions
Field excluded when running prisma query to supabase
Wow. Fixed: just had to close and open vs code
6 replies
PPrisma
Created by gaurav1998 on 6/3/2024 in #help-and-questions
Field excluded when running prisma query to supabase
6 replies
PPrisma
Created by charley on 6/2/2024 in #help-and-questions
Why can't I access profile in user? (ORM) (Postgres)
@charley I am getting the same exact issue as well. Are you using supabase by any chance?
7 replies
PPrisma
Created by gaurav1998 on 6/3/2024 in #help-and-questions
Field excluded when running prisma query to supabase
For more context, I have the following schema:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

generator client {
provider = "prisma-client-js"
}

model Service {
id Int @id @default(autoincrement())
html String
editor_state String
created_at DateTime @default(now())
updated_at DateTime @updatedAt
name String
slug String
card_title String
card_description String
}

model User {
id Int @id @default(autoincrement())
email String @unique
password String @default("$2a$10$cQEFiUaWpFvVVO5AcV3QN.7ohJXxxOPouTxORiZP.mUhupwEpDnUy")
created_at DateTime @default(now())
updated_at DateTime @default(now()) @updatedAt
name String
}
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

generator client {
provider = "prisma-client-js"
}

model Service {
id Int @id @default(autoincrement())
html String
editor_state String
created_at DateTime @default(now())
updated_at DateTime @updatedAt
name String
slug String
card_title String
card_description String
}

model User {
id Int @id @default(autoincrement())
email String @unique
password String @default("$2a$10$cQEFiUaWpFvVVO5AcV3QN.7ohJXxxOPouTxORiZP.mUhupwEpDnUy")
created_at DateTime @default(now())
updated_at DateTime @default(now()) @updatedAt
name String
}
6 replies
PPrisma
Created by gaurav1998 on 6/3/2024 in #help-and-questions
Field excluded when running prisma query to supabase
Interestingly enough, when I drop the example column and then push, and then run this:
const user = await prisma.user.findFirst({
where: { email: email },
select: {
id: true,
email: true,
password: true,
},
});
const user = await prisma.user.findFirst({
where: { email: email },
select: {
id: true,
email: true,
password: true,
},
});
I get the following:
Failed to fetch user: PrismaClientValidationError:
Invalid `prisma.user.findFirst()` invocation:

{
where: {
email: "user@nextmail.com"
},
select: {
id: true,
email: true,
password: true,
~~~~~~~~
? name?: true,
? example?: true
}
}
Failed to fetch user: PrismaClientValidationError:
Invalid `prisma.user.findFirst()` invocation:

{
where: {
email: "user@nextmail.com"
},
select: {
id: true,
email: true,
password: true,
~~~~~~~~
? name?: true,
? example?: true
}
}
Which means it's still expecting the example field. Why could that be?
6 replies
PPrisma
Created by gaurav1998 on 5/29/2024 in #help-and-questions
npx prisma migrate dev --name init from tutorial not working
Hey @Nurul that solution works! So does this mean I won't be using the connection pooler?
8 replies