MCPcopy Index your code
hub / github.com/Masterminds/structable / ExistsWhere

Method ExistsWhere

structable.go:364–371  ·  view source on GitHub ↗

ExistsWhere returns `true` if and only if there is at least one record that matches one (or multiple) conditions. Conditions are expressed in the form of predicates and expected values that together build a WHERE clause. See Squirrel's Where(pred, args)

(pred interface{}, args ...interface{})

Source from the content-addressed store, hash-verified

362// Conditions are expressed in the form of predicates and expected values
363// that together build a WHERE clause. See Squirrel's Where(pred, args)
364func (s *DbRecorder) ExistsWhere(pred interface{}, args ...interface{}) (bool, error) {
365 has := false
366
367 q := s.builder.Select("COUNT(*) > 0").From(s.table).Where(pred, args...)
368 err := q.QueryRow().Scan(&has)
369
370 return has, err
371}
372
373// Delete deletes the record from the underlying table.
374//

Callers

nothing calls this directly

Calls 2

ScanMethod · 0.80
QueryRowMethod · 0.80

Tested by

no test coverage detected