Jakesdoc
Jakesdoc
Explore posts from servers
DTDrizzle Team
Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
Well, hopefully they just expose an actual type in the future. For now though your solution works, so thank you lol
16 replies
DTDrizzle Team
Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
Plus, who knows if either of these will work after the next update.
16 replies
DTDrizzle Team
Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
While this does work for me, it's obviously not how we should be getting the type. It seems crazy to me that this isn't something exposed by the library. Is it really that uncommon to need the type of a transaction? Do you know if they are planning on adding this at any point to the library itself?
16 replies
DTDrizzle Team
Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
Yea I used to be able to just do typeof db and that was good enough but now the new update has changed the types. It doesn't seem there has ever been a proper way to represent that type, just work arounds.
16 replies
DTDrizzle Team
Created by Jakesdoc on 4/22/2024 in #help
Select parent rows where child exists
That worked, thank you very much!
6 replies
DTDrizzle Team
Created by Jakesdoc on 4/22/2024 in #help
Select parent rows where child exists
@Sillvva Maybe I'm just missing something, but it doesn't appear to do what I want.
const users = await db.query.users.findMany({
where: exists(
db.select({id: post.id}).from(post).innerJoin(post, eq(post.userId, user.id))
)
})
const users = await db.query.users.findMany({
where: exists(
db.select({id: post.id}).from(post).innerJoin(post, eq(post.userId, user.id))
)
})
Does that look right? Because that still just returns every user.
6 replies