Skip to content

Comments#56

Merged
stereosteve merged 6 commits intomainfrom
sp-comments
Apr 29, 2025
Merged

Comments#56
stereosteve merged 6 commits intomainfrom
sp-comments

Conversation

@stereosteve
Copy link
Copy Markdown
Contributor

@stereosteve stereosteve commented Apr 29, 2025

  • implements users/:id/comments and tracks/:id/comments
  • implements unclaimed_id endpoints
image

@stereosteve stereosteve marked this pull request as ready for review April 29, 2025 16:35
@@ -0,0 +1,3 @@
comment_id,user_id,entity_id,text
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Comment thread api/v1_tracks_comments.go
func (app *ApiServer) v1TracksComments(c *fiber.Ctx) error {

sql := `
SELECT comment_id as id
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not a sqlc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah few reasons:

  • Started in pgx land anyway so already had the code.
  • sqlc doesn't seem to support type overrides for ad-hoc columns. So for things like mentions you are stuck with json.RawMessage.
  • there are a few fields like IsDeleted and ReplyIds that aren't in the json output. It's easy to add json:"-" for those fields, which is easier than doing other struct embedding stuff.

In many ways it's similar to what sqlc does... but I just did it by hand. And there are some benefits to that.

Comment thread static/apidiff.html
}

const oldHost = "https://discoveryprovider.audius.co";
const oldHost = "https://discoveryprovider2.audius.co";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DN1 was down atm.

@stereosteve stereosteve merged commit d5357d0 into main Apr 29, 2025
2 checks passed
@stereosteve stereosteve deleted the sp-comments branch April 29, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants