Skip to content

Commit

Permalink
api/v1/attribute_list_params: add a few comments to describe the SQL …
Browse files Browse the repository at this point in the history
…query modifiers
  • Loading branch information
joelrebel committed Aug 14, 2023
1 parent a008189 commit accfa6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/api/v1/attribute_list_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,15 @@ func (p *AttributeListParams) queryMods(tblName string) qm.QueryMod {

where, values := p.setJSONBWhereClause(tblName, jsonPath, values)

// namespace AND JSONB query as a query mod
queryMods := []qm.QueryMod{nsMod, qm.And(where, values...)}

// OR ( namespace AND JSONB query )
if p.AttributeOperator == AttributeLogicalOR {
return qm.Or2(qm.Expr(queryMods...))
}

// AND ( namespace AND JSONB query )
return qm.Expr(queryMods...)
}

Expand Down

0 comments on commit accfa6f

Please sign in to comment.