You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/03/26 20:46:33 UTC

[GitHub] [trafficcontrol] moltzaum commented on issue #3429: Added ScanIntoItems and ScanIntoItem functions

moltzaum commented on issue #3429: Added ScanIntoItems and ScanIntoItem functions
URL: https://github.com/apache/trafficcontrol/pull/3429#issuecomment-476844301
 
 
   Update:
   As I've written it now, `ScanIntoItems` uses `sql.Rows`, but an update or create should use `QueryRow`, instead of `NamedQuery` or `Query`.
   
   The generic create uses `NamedQuery` only because it allows us to map fields from an interface using their names. Note: is possible to have a simple `NamedQueryRow` function (https://github.com/jmoiron/sqlx/issues/102), or to make a function that uses reflection to read from the struct in a linear fashion (instead of using names). Both of these solutions would eliminate the need for `ScanIntoIItems`
   
   TL;DR:
   I don't think `ScanIntoItems` should be used as it currently exists, so I'm closing this PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services