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
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 though@koskimas the one with
on
? yeahyep
the extra nesting is ugly and not intuitive
the examples should call the callback argument
on
once we change it@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
if you can't upgrade to 0.26.x, use
eb.cmpr
oh I see, it's deprecated
and already removed in 0.26.0
We move fast 😅