Replies: 2 comments
-
You won't be able to change the return type of the function, but as the struct fields in foo := GetUserTimeLineRow{}
bar := GetTimeLineRow(foo) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you have two queries, that return the same struct of the same type is there way to coerce them into returning the same object? Or is the best way to use a go interface after the fact?
https://play.sqlc.dev/p/5633c21e64ed689afc5e86c84da8a5e03d9015c921677a3d480594cc9b43094c
As you can see in this example, I have one function that returns
and one that returns
Is there a way to coerce them into one shape for passing on to a
parseTimeLine()
function without having to use interfaces to a do a bit of a type dance?Or perhaps there is a better way to do it with my schema. I already have a trigger updating the counts so open to other ideas with views, triggers etc.
Thank you in advance
Beta Was this translation helpful? Give feedback.
All reactions