How to use coalesce in a join
I'm selecting disparate object types, and then looking up details in per-type lookup tables, then I want to join on another table based on an ID in the type tables, so I need to coalesce the ID columns. Currently I'm just doing a cast to make it work:
Is there a better way to express this?
13 Replies
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Something like this. Didn't try to run it.
By the way @igalk that
JoinBuilder
is kinda useless right now. We could probably just drop it and pass an expression builder to the first callback
We might later have some join-specific crap thoughUnknown User•11mo ago
Message Not Public
Sign In & Join Server To View
yep
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
@koskimas thanks! Your example was missing an
onRef
but this works:
Shouldn't need
onRef
there
that's the error your code gives me
eb
doesn't even have onRef
method
Which Kysely version are you using?0.25.0
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
oh I see, it's deprecated
and already removed in 0.26.0
We move fast 😅