-
Notifications
You must be signed in to change notification settings - Fork 867
JSON_AGG is not automatically inferenced for type generation #2658
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
Comments
I hope the author can support intermediate state columns |
@topazur if i do as you specified, won't wherever I query any aggregated data becomes |
#145 |
sqlc does not support unmarshalling JSON into Go types. I'm tracking this issue here: #2794 |
Actually tracking here #2761 |
Version
1.20.0
What happened?
I am using Golang for my backend and sqlc to generate types for the queries. I have a query like the following:
i am querying all posts of a subreddit and within each post i want the author of the post, votes and comments of the post to be embedded.
expected generated type:
instead what i am getting is:
Votes and Comments are getting typed as
json.RawMessage
. Is there a way to safely type them like in the expected output? I tried to usesqlc.embed()
here. but it seems to be working only for one-to-one relations.Relevant log output
No response
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/a4d72d72ec6333625752527286b88f5254731465c5d77047ebc93cb2dcfcf0df
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: