func AddEqualCriteria(conditions []*db.Criteria, column *db.Column, value interface{}) ([]*db.Criteria, bool) { if !IsNil(value) { conditions = append(conditions, column.Matches(value)) return conditions, true } return conditions, false }
func AddCriteria(conditions []*db.Criteria, column *db.Column, value *string) ([]*db.Criteria, bool) { if !IsEmpty(value) { var criteria *db.Criteria if HasWildcards(value) { criteria = column.Like(value) } else { criteria = column.Matches(value) } conditions = append(conditions, criteria) return conditions, true } return conditions, false }