help creating a prisma query for an api route
Unanswered
Bully Kutta posted this in #help-forum
Bully KuttaOP
ok so
this is my schema
is there a way i can write a query so that it only selects builds if the email is activated in my accounts table?
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
model accounts {
id Int @id @default(autoincrement()) @unique
email String @unique
password String
activated Boolean @default(false)
lifespan Int
activation_code String @unique
}
model builds {
id Int @id @default(autoincrement()) @unique
email String @unique
handler String
name String
date_created Int
data String
}this is my schema
is there a way i can write a query so that it only selects builds if the email is activated in my accounts table?
2 Replies
you need to create relations