jmoiron / sqlx

general purpose extensions to golang's database/sql
http://jmoiron.github.io/sqlx/
MIT License
16.27k stars 1.09k forks source link

I think there is a problem with StructScan design #786

Open LukLau opened 3 years ago

LukLau commented 3 years ago

When I use this method, I want to convert a DB row to Struct Object. I found a mistake in it. I would like to know why you are considering using missingFields. If the number of DB row columns exceeds that of struct columns, Why do you have to make missing field mandatory? As a business client I really don't understand.

derekperkins commented 2 years ago

I think that's exactly the right design. If there's nowhere for the data to go, change your query to only return fields that you care about