I need to extract the type of eb in the query chain
I have a complex query (more than 800 lines). Its mostly json formatting. Is there a way I can extract out the type of eb so for each nested json object I build, I can create a helper method. Or is this not possible.
Also, is it an anti pattern to do the json formatting in the query iteself ?
5 Replies
Hey 👋
Provide a kyse.link. Can't help you otherwise.
Hello,
https://kyse.link/SBDmw
Here is the link
in the query you see various json objects being constructed. What I would like to do is extract each of that into a separate helper function but for that I need the type of eb to maintain type-safety and I can't seem to find a way for that
Seems like
jsonObjectFrom
would simplify this a lot.Okay, looking into this
I'm still a bit confused. Wouldn't the
jsonObjectFrom
method still require eb
Would be very helpful if you can share a sample snippetit'd remove a bunch of left joins. instead you'll have a base query that's slimmer. and the related json stuff will be contained in the select.
allowing you to extract it.
under the hood the database's optimizer might still perform left joins.