[chore/performance] Remove remaining 'whereEmptyOrNull' funcs (#1946)

This commit is contained in:
tobi 2023-07-05 12:34:37 +02:00 committed by GitHub
commit d9c69f6ce0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 38 deletions

View file

@ -164,8 +164,10 @@ func (t *timelineDB) GetPublicTimeline(ctx context.Context, maxID string, sinceI
NewSelect().
TableExpr("? AS ?", bun.Ident("statuses"), bun.Ident("status")).
Column("status.id").
// Public only.
Where("? = ?", bun.Ident("status.visibility"), gtsmodel.VisibilityPublic).
WhereGroup(" AND ", whereEmptyOrNull("status.boost_of_id")).
// Ignore boosts.
Where("? IS NULL", bun.Ident("status.boost_of_id")).
Order("status.id DESC")
if maxID == "" {