I need to retrieve all data from a table using Prisma. How can I achieve this? (SELECT * FROM application)
const applications = prisma.application.findMany({
// Retrieves all fields for the user
include: {
posts: {
select: {
age: true,
about_section: true,
user_id: true
},
},
},
})
console.log(applications.age)
This is the structure of my schema:
model application {
application_id Int @id @default(autoincrement())
age String? @db.VarChar(255)
about_section String? @db.VarChar(255)
user_id Int?
users users? @relation(fields: [user_id], references: [user_id], onDelete: Restrict, onUpdate: Restrict, map: "application_ibfk_1")
@@index([user_id], map: "user_id")
}