abstracted out gamer activity repo sql queries using sqlc#41
Conversation
|
My one concern is that the per activity error handling has been lost |
why did we lose this? |
| return nil, fmt.Errorf("failed to scan activity: %w", err) | ||
| } | ||
| activities = append(activities, activity) | ||
| } |
There was a problem hiding this comment.
@Woe4 do you mean that we lost the error handling here? I don't think we did? In the old version we had to scan every row since we were getting a SQL result from go and had to put it into the models ourselves. If you look in the sqlc files that were generated, it does that for loop scan check for us.
There was a problem hiding this comment.
I see that sqlc does check row by row. I guess I was concerned with how the error is returned (different error messages) but letting sqlc handle the different errors and returning the errors in row, err := queries.(Get...) makes more sense than having three different error checks.
Migrating
gamer_activitylike #37