StringHasPrefix return a predicate for checking that a JSON string value (returned by the path) has the given substring as prefix
(column string, prefix string, opts ...Option)
| 203 | // StringHasPrefix return a predicate for checking that a JSON string value |
| 204 | // (returned by the path) has the given substring as prefix |
| 205 | func StringHasPrefix(column string, prefix string, opts ...Option) *sql.Predicate { |
| 206 | return sql.P(func(b *sql.Builder) { |
| 207 | opts = append([]Option{Unquote(true)}, opts...) |
| 208 | valuePath(b, column, opts...) |
| 209 | b.Join(sql.HasPrefix("", prefix)) |
| 210 | }) |
| 211 | } |
| 212 | |
| 213 | // StringHasSuffix return a predicate for checking that a JSON string value |
| 214 | // (returned by the path) has the given substring as suffix |