MCPcopy
hub / github.com/harness/harness / listQuery

Method listQuery

app/store/database/pullreq.go:597–616  ·  view source on GitHub ↗
(opts *types.PullReqFilter)

Source from the content-addressed store, hash-verified

595}
596
597func (s *PullReqStore) listQuery(opts *types.PullReqFilter) squirrel.SelectBuilder {
598 var stmt squirrel.SelectBuilder
599
600 columns := pullReqColumns
601 if opts.ExcludeDescription {
602 columns = pullReqColumnsNoDescription
603 }
604
605 if len(opts.LabelID) > 0 || len(opts.ValueID) > 0 || opts.CommenterID > 0 || opts.MentionedID > 0 {
606 stmt = database.Builder.Select("DISTINCT " + columns)
607 } else {
608 stmt = database.Builder.Select(columns)
609 }
610
611 stmt = stmt.From("pullreqs")
612
613 s.applyFilter(&stmt, opts)
614
615 return stmt
616}
617
618//nolint:cyclop,gocognit,gocyclo
619func (s *PullReqStore) applyFilter(stmt *squirrel.SelectBuilder, opts *types.PullReqFilter) {

Callers 2

ListMethod · 0.95
StreamMethod · 0.95

Implementers 1

PullReqStoreapp/store/database/pullreq.go

Calls 1

applyFilterMethod · 0.95

Tested by

no test coverage detected