You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yield two different queries which, however, return the same struct, Author in first case and a slice []Author in the second case.
I've encountered an odd behaviour where instead two different structs are generated, below the examples in the playground, from what I noticed, if I specify the fields the generation is not as expected, while using the jolly * selector gives the expected generation.
The generated functions correctly return a Job and a slice of []Job
I've not been able to reproduce the issue using the default playground setup with the Authors and I can't see any reason why this issue rises with my code.
The text was updated successfully, but these errors were encountered:
maxiride
changed the title
Struct generated are different when specifying all the columns vs using the jolly selector. MWE provided.
Struct generated are different when specifying all the columns vs using the * jolly selector. MWE provided.
Feb 22, 2021
The playground demonstrates that:
-- name: GetAuthor :one
-- name: ListAuthors :many
Yield two different queries which, however, return the same struct,
Author
in first case and a slice[]Author
in the second case.I've encountered an odd behaviour where instead two different structs are generated, below the examples in the playground, from what I noticed, if I specify the fields the generation is not as expected, while using the jolly
*
selector gives the expected generation.Playground with different structs: https://play.sqlc.dev/p/6b9b2aaa7d2f3abd63d3a80226a6d52f56d291b5d9d0fb582939d1d3fd163942
GetJobRow
and[]ListJobsRow
Playground with the same (as expected) struct: https://play.sqlc.dev/p/3d906556fe50e4335ffa4c8e9de72ca8a3811a9f9946150b3885aafb500bc599
Job
and a slice of[]Job
I've not been able to reproduce the issue using the default playground setup with the Authors and I can't see any reason why this issue rises with my code.
The text was updated successfully, but these errors were encountered: