Luke Morris
10/26/2021, 5:08 PMdb.User.Database.Some()
A user has many alerts. I've queried them with db.User.Alert.Some()
An alert has one notification. I've tried querying it with db.Alert.Notification.Some(), but Some isn't available here. If it's a "has one" relationship, should I be using another function instead?
users, err := prisma.User.FindMany(
db.User.Alert.Some(
db.Alert.Notification.Some(),
),
db.User.Database.Some(),
).Exec(ctx)Matt Mueller (Prisma Client PM)
Luca
10/26/2021, 5:17 PMWhere instead of SomeLuke Morris
10/26/2021, 5:17 PMusers, err := prisma.User.FindMany(
db.User.Alert.Some(
db.Alert.Notification.Where(),
),
db.User.Database.Some(),
).Exec(ctx)Luca
10/26/2021, 5:20 PMLuke Morris
10/26/2021, 5:21 PMLuke Morris
10/26/2021, 5:22 PM.Some() and .Where() execute an inner join? Or are these models stitched together under the hood with multiple sql queries?Luca
10/26/2021, 5:26 PMLuke Morris
10/26/2021, 5:44 PM.Some() and .Where(), is it required that all relations have records?Luca
10/27/2021, 4:50 AM