This is a problem in any database binding that retrieves stuff as an array of values rather than as key-value pairs. This is the default behavior for many, many things, although itβs generally a sign of micro-optimization when itβs being used. (There are definitely systems where it makes a real performance difference though!)
For the reason of stories like these, I feel that doing positional row access is a mistake and you should always use key-value retrieval instead. Even if everything goes right in a migration you donβt really want to be relying on the order of columns in a table. (Which is another reason to avoid SELECT * as well.)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sounds like Go. Is there any other language that complains about mismatched columns-structs?
This is a problem in any database binding that retrieves stuff as an array of values rather than as key-value pairs. This is the default behavior for many, many things, although itβs generally a sign of micro-optimization when itβs being used. (There are definitely systems where it makes a real performance difference though!)
For the reason of stories like these, I feel that doing positional row access is a mistake and you should always use key-value retrieval instead. Even if everything goes right in a migration you donβt really want to be relying on the order of columns in a table. (Which is another reason to avoid
SELECT *
as well.)