How can i define a model that queries from a function? #616
-
For PostgreSQL select * from some_function(); |
Beta Was this translation helpful? Give feedback.
Answered by
vmihailenco
Jul 16, 2022
Replies: 1 comment 1 reply
-
You can use a raw query and scan into a struct type Model struct {...}
dest := new(Model)
db.Raw("select * from some_function()").Scan(ctx, dest) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nicerobot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use a raw query and scan into a struct