Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to select from functions #71

Closed
intolerable opened this issue Jun 22, 2021 · 4 comments
Closed

Unable to select from functions #71

intolerable opened this issue Jun 22, 2021 · 4 comments

Comments

@intolerable
Copy link

intolerable commented Jun 22, 2021

As mentioned by @ocharles here, it's not yet possible to select from a function result. This is something that will be fairly critical for constructing more complex JSON-related queries.

@shane-circuithub
Copy link
Contributor

I think this is actually possible in Opaleye, we need to use the RepExpr constructor of PrimQuery.

@ocharles
Copy link
Contributor

Yea, I think I mentioned that in private on Slack - but I'm not even sure if Opaleye uses that constructor! Maybe just left-over from forking from HaskellDB :) Either way, that looks like the right tool.

@tomjaguarpaw
Copy link
Contributor

tomjaguarpaw commented Jun 25, 2021

relExpr postdates HaskellDB and is supposed to work but I'm not sure if anyone uses it in practice.

@ghost
Copy link

ghost commented Jul 6, 2021

I've just run into this issue too, I was wondering if it's possible to treat a field which is JSONBEncoded as something I can query into and treat fields as expressions themselves. It looks like Opaleye has support for dealing with JSON(B) encoded columns and pulling out data, but I'm not sure how to tap into the underlying structure.

Does anyone have any example code for haw you might be able to do that?

This would be a killer app for us if we could use it, we have a lot of tables with the same schema where each table has some metadata columns and a payload column as JSONB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants