func AddWildCriteria(conditions []*db.Criteria, column *db.Column, value *string) ([]*db.Criteria, bool) { if !IsEmpty(value) { conditions = append(conditions, column.Like("%"+*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 }