StringContains return a predicate for checking that a JSON string value (returned by the path) contains the given substring
(column string, sub string, opts ...Option)
| 223 | // StringContains return a predicate for checking that a JSON string value |
| 224 | // (returned by the path) contains the given substring |
| 225 | func StringContains(column string, sub string, opts ...Option) *sql.Predicate { |
| 226 | return sql.P(func(b *sql.Builder) { |
| 227 | opts = append([]Option{Unquote(true)}, opts...) |
| 228 | valuePath(b, column, opts...) |
| 229 | b.Join(sql.Contains("", sub)) |
| 230 | }) |
| 231 | } |
| 232 | |
| 233 | // ValueIn return a predicate for checking that a JSON value |
| 234 | // (returned by the path) is IN the given arguments. |