Review the NewTagQuery
helper and TagQuery
struct that lives in links/helpers.go
. I am not sure why it's needed and why there was a decision to use subqueries here. This feels very inefficient and as the database continues to grow, I think this will just get slower and slower.
There are probably a few things to review and see the best way to change it. I think first things first is simply adding sq.Eq{"t.slug": tags}
and sq.NoEq...
The joins are already present on most cases. Maybe it's fine for listings and shorts but I think even there the main "Get" helper functions can simply be adjusted with a join and query change.