Stuffy
Stuffy
DTDrizzle Team
Created by Stuffy on 9/25/2024 in #help
Can't get relations from db.update
This is the code I use to retrieve a user:
const validUser = await db.query.user.findFirst({
with: {
buildings: true
},
where: eq(user.email, email)
});
const validUser = await db.query.user.findFirst({
with: {
buildings: true
},
where: eq(user.email, email)
});
The problem is when the user updates (db.update) I can not use the with: {} and return the users buildings. I can do another query after the update and use the data it gets, but it's yet another lookup. Any thoughts?
7 replies