StringHasSuffix return a predicate for checking that a JSON string value (returned by the path) has the given substring as suffix
(column string, suffix string, opts ...Option)
| 213 | // StringHasSuffix return a predicate for checking that a JSON string value |
| 214 | // (returned by the path) has the given substring as suffix |
| 215 | func StringHasSuffix(column string, suffix string, opts ...Option) *sql.Predicate { |
| 216 | return sql.P(func(b *sql.Builder) { |
| 217 | opts = append([]Option{Unquote(true)}, opts...) |
| 218 | valuePath(b, column, opts...) |
| 219 | b.Join(sql.HasSuffix("", suffix)) |
| 220 | }) |
| 221 | } |
| 222 | |
| 223 | // StringContains return a predicate for checking that a JSON string value |
| 224 | // (returned by the path) contains the given substring |