However, I don't see a way to build the second part of the expression (::<class_of_the_object) since there is support for infix and prefix functions, but not for postfix.
Is there something I'm missing or at least some hack that I can use (other than creating strings by hand) to achieve this functionality?
I tried using this function, but I don't think I have a good idea of how it supposed to work.
After some more duckduckgoing, I've stumbled across this issue on GitHub:
Basically, I use dplyr functions as normal and preprocess data (filtering, selecting, ...) up until the point where I need data from jsonb. I then run sql_render on resulting tbl and substitute text that selects jsonb column in SELECT ... <jsonb_field> ... with all the extractors that I prepare beforehand. Not sure if that's going to be a final solution, but it works for now.
For what it's worth, I've finally had an epiphany and wrote following small function that can be used for this and that I think is quite in line with dbplyr philosophy: