Trending and tests#17
Merged
raymondjacobson merged 4 commits intomainfrom Apr 11, 2025
Merged
Conversation
stereosteve
approved these changes
Apr 11, 2025
Contributor
stereosteve
left a comment
There was a problem hiding this comment.
Looks nice. Couple of notes.
| sql := ` | ||
| SELECT track_trending_scores.track_id | ||
| FROM track_trending_scores | ||
| LEFT JOIN tracks |
Contributor
There was a problem hiding this comment.
shouldn't this be a full join?
Member
Author
There was a problem hiding this comment.
i dont think so. if there's no scores for a track, we probably don't care about it
Comment on lines
+43
to
+55
| type trackTrendingRow struct { | ||
| TrackId int32 `json:"track_id"` | ||
| } | ||
|
|
||
| trackTrendingRows, err := pgx.CollectRows(rows, pgx.RowToStructByName[trackTrendingRow]) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| trackIds := []int32{} | ||
| for _, t := range trackTrendingRows { | ||
| trackIds = append(trackIds, t.TrackId) | ||
| } |
Contributor
There was a problem hiding this comment.
if just selecting one column scalar value, you can simplify this to:
trackIds, err := pgx.CollectRows(rows, pgx.RowTo[int32])
if err != nil {
return err
}
see:
https://pkg.go.dev/github.com/jackc/pgx/v5#hdr-Query_Interface
| "created_at": time.Now(), | ||
| } | ||
|
|
||
| connectedWalletsBaseRow = map[string]any{ |
Contributor
There was a problem hiding this comment.
this indentation looks off... you have gofmt setup to run on save?
Member
Author
There was a problem hiding this comment.
fixed, bad rebase thing
bf82f1d to
6bce26f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
very simple, still some diffs to consider
