Closed egor-spk closed 3 years ago
Hello and thanks for this issue!
Can you explain better the use case for that change? Because if you have an additional column in WHERE
you don't need to include it into SELECT
and scany won't find out about them at all.
While writing the example, I refactored my large query and did without additional fields. Sorry to take your time :(
The current implementation requires strict correspondence between the columns from the SELECT and the fields of the structure. Thus, additional columns cannot be used if they are not present in the target structure.
https://github.com/georgysavva/scany/blob/e037f9474e022887ad119d18abab10db523c0b56/dbscan/dbscan.go#L298-L303
Would you like to relax this rule? For example, this is useful when additional WHERE columns are needed, but they are not needed in the final structure.