github.com/crowdsecurity/crowdsec@v1.6.1/pkg/database/ent/meta/where.go (about) 1 // Code generated by ent, DO NOT EDIT. 2 3 package meta 4 5 import ( 6 "time" 7 8 "entgo.io/ent/dialect/sql" 9 "entgo.io/ent/dialect/sql/sqlgraph" 10 "github.com/crowdsecurity/crowdsec/pkg/database/ent/predicate" 11 ) 12 13 // ID filters vertices based on their ID field. 14 func ID(id int) predicate.Meta { 15 return predicate.Meta(sql.FieldEQ(FieldID, id)) 16 } 17 18 // IDEQ applies the EQ predicate on the ID field. 19 func IDEQ(id int) predicate.Meta { 20 return predicate.Meta(sql.FieldEQ(FieldID, id)) 21 } 22 23 // IDNEQ applies the NEQ predicate on the ID field. 24 func IDNEQ(id int) predicate.Meta { 25 return predicate.Meta(sql.FieldNEQ(FieldID, id)) 26 } 27 28 // IDIn applies the In predicate on the ID field. 29 func IDIn(ids ...int) predicate.Meta { 30 return predicate.Meta(sql.FieldIn(FieldID, ids...)) 31 } 32 33 // IDNotIn applies the NotIn predicate on the ID field. 34 func IDNotIn(ids ...int) predicate.Meta { 35 return predicate.Meta(sql.FieldNotIn(FieldID, ids...)) 36 } 37 38 // IDGT applies the GT predicate on the ID field. 39 func IDGT(id int) predicate.Meta { 40 return predicate.Meta(sql.FieldGT(FieldID, id)) 41 } 42 43 // IDGTE applies the GTE predicate on the ID field. 44 func IDGTE(id int) predicate.Meta { 45 return predicate.Meta(sql.FieldGTE(FieldID, id)) 46 } 47 48 // IDLT applies the LT predicate on the ID field. 49 func IDLT(id int) predicate.Meta { 50 return predicate.Meta(sql.FieldLT(FieldID, id)) 51 } 52 53 // IDLTE applies the LTE predicate on the ID field. 54 func IDLTE(id int) predicate.Meta { 55 return predicate.Meta(sql.FieldLTE(FieldID, id)) 56 } 57 58 // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. 59 func CreatedAt(v time.Time) predicate.Meta { 60 return predicate.Meta(sql.FieldEQ(FieldCreatedAt, v)) 61 } 62 63 // UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. 64 func UpdatedAt(v time.Time) predicate.Meta { 65 return predicate.Meta(sql.FieldEQ(FieldUpdatedAt, v)) 66 } 67 68 // Key applies equality check predicate on the "key" field. It's identical to KeyEQ. 69 func Key(v string) predicate.Meta { 70 return predicate.Meta(sql.FieldEQ(FieldKey, v)) 71 } 72 73 // Value applies equality check predicate on the "value" field. It's identical to ValueEQ. 74 func Value(v string) predicate.Meta { 75 return predicate.Meta(sql.FieldEQ(FieldValue, v)) 76 } 77 78 // AlertMetas applies equality check predicate on the "alert_metas" field. It's identical to AlertMetasEQ. 79 func AlertMetas(v int) predicate.Meta { 80 return predicate.Meta(sql.FieldEQ(FieldAlertMetas, v)) 81 } 82 83 // CreatedAtEQ applies the EQ predicate on the "created_at" field. 84 func CreatedAtEQ(v time.Time) predicate.Meta { 85 return predicate.Meta(sql.FieldEQ(FieldCreatedAt, v)) 86 } 87 88 // CreatedAtNEQ applies the NEQ predicate on the "created_at" field. 89 func CreatedAtNEQ(v time.Time) predicate.Meta { 90 return predicate.Meta(sql.FieldNEQ(FieldCreatedAt, v)) 91 } 92 93 // CreatedAtIn applies the In predicate on the "created_at" field. 94 func CreatedAtIn(vs ...time.Time) predicate.Meta { 95 return predicate.Meta(sql.FieldIn(FieldCreatedAt, vs...)) 96 } 97 98 // CreatedAtNotIn applies the NotIn predicate on the "created_at" field. 99 func CreatedAtNotIn(vs ...time.Time) predicate.Meta { 100 return predicate.Meta(sql.FieldNotIn(FieldCreatedAt, vs...)) 101 } 102 103 // CreatedAtGT applies the GT predicate on the "created_at" field. 104 func CreatedAtGT(v time.Time) predicate.Meta { 105 return predicate.Meta(sql.FieldGT(FieldCreatedAt, v)) 106 } 107 108 // CreatedAtGTE applies the GTE predicate on the "created_at" field. 109 func CreatedAtGTE(v time.Time) predicate.Meta { 110 return predicate.Meta(sql.FieldGTE(FieldCreatedAt, v)) 111 } 112 113 // CreatedAtLT applies the LT predicate on the "created_at" field. 114 func CreatedAtLT(v time.Time) predicate.Meta { 115 return predicate.Meta(sql.FieldLT(FieldCreatedAt, v)) 116 } 117 118 // CreatedAtLTE applies the LTE predicate on the "created_at" field. 119 func CreatedAtLTE(v time.Time) predicate.Meta { 120 return predicate.Meta(sql.FieldLTE(FieldCreatedAt, v)) 121 } 122 123 // CreatedAtIsNil applies the IsNil predicate on the "created_at" field. 124 func CreatedAtIsNil() predicate.Meta { 125 return predicate.Meta(sql.FieldIsNull(FieldCreatedAt)) 126 } 127 128 // CreatedAtNotNil applies the NotNil predicate on the "created_at" field. 129 func CreatedAtNotNil() predicate.Meta { 130 return predicate.Meta(sql.FieldNotNull(FieldCreatedAt)) 131 } 132 133 // UpdatedAtEQ applies the EQ predicate on the "updated_at" field. 134 func UpdatedAtEQ(v time.Time) predicate.Meta { 135 return predicate.Meta(sql.FieldEQ(FieldUpdatedAt, v)) 136 } 137 138 // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. 139 func UpdatedAtNEQ(v time.Time) predicate.Meta { 140 return predicate.Meta(sql.FieldNEQ(FieldUpdatedAt, v)) 141 } 142 143 // UpdatedAtIn applies the In predicate on the "updated_at" field. 144 func UpdatedAtIn(vs ...time.Time) predicate.Meta { 145 return predicate.Meta(sql.FieldIn(FieldUpdatedAt, vs...)) 146 } 147 148 // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. 149 func UpdatedAtNotIn(vs ...time.Time) predicate.Meta { 150 return predicate.Meta(sql.FieldNotIn(FieldUpdatedAt, vs...)) 151 } 152 153 // UpdatedAtGT applies the GT predicate on the "updated_at" field. 154 func UpdatedAtGT(v time.Time) predicate.Meta { 155 return predicate.Meta(sql.FieldGT(FieldUpdatedAt, v)) 156 } 157 158 // UpdatedAtGTE applies the GTE predicate on the "updated_at" field. 159 func UpdatedAtGTE(v time.Time) predicate.Meta { 160 return predicate.Meta(sql.FieldGTE(FieldUpdatedAt, v)) 161 } 162 163 // UpdatedAtLT applies the LT predicate on the "updated_at" field. 164 func UpdatedAtLT(v time.Time) predicate.Meta { 165 return predicate.Meta(sql.FieldLT(FieldUpdatedAt, v)) 166 } 167 168 // UpdatedAtLTE applies the LTE predicate on the "updated_at" field. 169 func UpdatedAtLTE(v time.Time) predicate.Meta { 170 return predicate.Meta(sql.FieldLTE(FieldUpdatedAt, v)) 171 } 172 173 // UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. 174 func UpdatedAtIsNil() predicate.Meta { 175 return predicate.Meta(sql.FieldIsNull(FieldUpdatedAt)) 176 } 177 178 // UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. 179 func UpdatedAtNotNil() predicate.Meta { 180 return predicate.Meta(sql.FieldNotNull(FieldUpdatedAt)) 181 } 182 183 // KeyEQ applies the EQ predicate on the "key" field. 184 func KeyEQ(v string) predicate.Meta { 185 return predicate.Meta(sql.FieldEQ(FieldKey, v)) 186 } 187 188 // KeyNEQ applies the NEQ predicate on the "key" field. 189 func KeyNEQ(v string) predicate.Meta { 190 return predicate.Meta(sql.FieldNEQ(FieldKey, v)) 191 } 192 193 // KeyIn applies the In predicate on the "key" field. 194 func KeyIn(vs ...string) predicate.Meta { 195 return predicate.Meta(sql.FieldIn(FieldKey, vs...)) 196 } 197 198 // KeyNotIn applies the NotIn predicate on the "key" field. 199 func KeyNotIn(vs ...string) predicate.Meta { 200 return predicate.Meta(sql.FieldNotIn(FieldKey, vs...)) 201 } 202 203 // KeyGT applies the GT predicate on the "key" field. 204 func KeyGT(v string) predicate.Meta { 205 return predicate.Meta(sql.FieldGT(FieldKey, v)) 206 } 207 208 // KeyGTE applies the GTE predicate on the "key" field. 209 func KeyGTE(v string) predicate.Meta { 210 return predicate.Meta(sql.FieldGTE(FieldKey, v)) 211 } 212 213 // KeyLT applies the LT predicate on the "key" field. 214 func KeyLT(v string) predicate.Meta { 215 return predicate.Meta(sql.FieldLT(FieldKey, v)) 216 } 217 218 // KeyLTE applies the LTE predicate on the "key" field. 219 func KeyLTE(v string) predicate.Meta { 220 return predicate.Meta(sql.FieldLTE(FieldKey, v)) 221 } 222 223 // KeyContains applies the Contains predicate on the "key" field. 224 func KeyContains(v string) predicate.Meta { 225 return predicate.Meta(sql.FieldContains(FieldKey, v)) 226 } 227 228 // KeyHasPrefix applies the HasPrefix predicate on the "key" field. 229 func KeyHasPrefix(v string) predicate.Meta { 230 return predicate.Meta(sql.FieldHasPrefix(FieldKey, v)) 231 } 232 233 // KeyHasSuffix applies the HasSuffix predicate on the "key" field. 234 func KeyHasSuffix(v string) predicate.Meta { 235 return predicate.Meta(sql.FieldHasSuffix(FieldKey, v)) 236 } 237 238 // KeyEqualFold applies the EqualFold predicate on the "key" field. 239 func KeyEqualFold(v string) predicate.Meta { 240 return predicate.Meta(sql.FieldEqualFold(FieldKey, v)) 241 } 242 243 // KeyContainsFold applies the ContainsFold predicate on the "key" field. 244 func KeyContainsFold(v string) predicate.Meta { 245 return predicate.Meta(sql.FieldContainsFold(FieldKey, v)) 246 } 247 248 // ValueEQ applies the EQ predicate on the "value" field. 249 func ValueEQ(v string) predicate.Meta { 250 return predicate.Meta(sql.FieldEQ(FieldValue, v)) 251 } 252 253 // ValueNEQ applies the NEQ predicate on the "value" field. 254 func ValueNEQ(v string) predicate.Meta { 255 return predicate.Meta(sql.FieldNEQ(FieldValue, v)) 256 } 257 258 // ValueIn applies the In predicate on the "value" field. 259 func ValueIn(vs ...string) predicate.Meta { 260 return predicate.Meta(sql.FieldIn(FieldValue, vs...)) 261 } 262 263 // ValueNotIn applies the NotIn predicate on the "value" field. 264 func ValueNotIn(vs ...string) predicate.Meta { 265 return predicate.Meta(sql.FieldNotIn(FieldValue, vs...)) 266 } 267 268 // ValueGT applies the GT predicate on the "value" field. 269 func ValueGT(v string) predicate.Meta { 270 return predicate.Meta(sql.FieldGT(FieldValue, v)) 271 } 272 273 // ValueGTE applies the GTE predicate on the "value" field. 274 func ValueGTE(v string) predicate.Meta { 275 return predicate.Meta(sql.FieldGTE(FieldValue, v)) 276 } 277 278 // ValueLT applies the LT predicate on the "value" field. 279 func ValueLT(v string) predicate.Meta { 280 return predicate.Meta(sql.FieldLT(FieldValue, v)) 281 } 282 283 // ValueLTE applies the LTE predicate on the "value" field. 284 func ValueLTE(v string) predicate.Meta { 285 return predicate.Meta(sql.FieldLTE(FieldValue, v)) 286 } 287 288 // ValueContains applies the Contains predicate on the "value" field. 289 func ValueContains(v string) predicate.Meta { 290 return predicate.Meta(sql.FieldContains(FieldValue, v)) 291 } 292 293 // ValueHasPrefix applies the HasPrefix predicate on the "value" field. 294 func ValueHasPrefix(v string) predicate.Meta { 295 return predicate.Meta(sql.FieldHasPrefix(FieldValue, v)) 296 } 297 298 // ValueHasSuffix applies the HasSuffix predicate on the "value" field. 299 func ValueHasSuffix(v string) predicate.Meta { 300 return predicate.Meta(sql.FieldHasSuffix(FieldValue, v)) 301 } 302 303 // ValueEqualFold applies the EqualFold predicate on the "value" field. 304 func ValueEqualFold(v string) predicate.Meta { 305 return predicate.Meta(sql.FieldEqualFold(FieldValue, v)) 306 } 307 308 // ValueContainsFold applies the ContainsFold predicate on the "value" field. 309 func ValueContainsFold(v string) predicate.Meta { 310 return predicate.Meta(sql.FieldContainsFold(FieldValue, v)) 311 } 312 313 // AlertMetasEQ applies the EQ predicate on the "alert_metas" field. 314 func AlertMetasEQ(v int) predicate.Meta { 315 return predicate.Meta(sql.FieldEQ(FieldAlertMetas, v)) 316 } 317 318 // AlertMetasNEQ applies the NEQ predicate on the "alert_metas" field. 319 func AlertMetasNEQ(v int) predicate.Meta { 320 return predicate.Meta(sql.FieldNEQ(FieldAlertMetas, v)) 321 } 322 323 // AlertMetasIn applies the In predicate on the "alert_metas" field. 324 func AlertMetasIn(vs ...int) predicate.Meta { 325 return predicate.Meta(sql.FieldIn(FieldAlertMetas, vs...)) 326 } 327 328 // AlertMetasNotIn applies the NotIn predicate on the "alert_metas" field. 329 func AlertMetasNotIn(vs ...int) predicate.Meta { 330 return predicate.Meta(sql.FieldNotIn(FieldAlertMetas, vs...)) 331 } 332 333 // AlertMetasIsNil applies the IsNil predicate on the "alert_metas" field. 334 func AlertMetasIsNil() predicate.Meta { 335 return predicate.Meta(sql.FieldIsNull(FieldAlertMetas)) 336 } 337 338 // AlertMetasNotNil applies the NotNil predicate on the "alert_metas" field. 339 func AlertMetasNotNil() predicate.Meta { 340 return predicate.Meta(sql.FieldNotNull(FieldAlertMetas)) 341 } 342 343 // HasOwner applies the HasEdge predicate on the "owner" edge. 344 func HasOwner() predicate.Meta { 345 return predicate.Meta(func(s *sql.Selector) { 346 step := sqlgraph.NewStep( 347 sqlgraph.From(Table, FieldID), 348 sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), 349 ) 350 sqlgraph.HasNeighbors(s, step) 351 }) 352 } 353 354 // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). 355 func HasOwnerWith(preds ...predicate.Alert) predicate.Meta { 356 return predicate.Meta(func(s *sql.Selector) { 357 step := newOwnerStep() 358 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 359 for _, p := range preds { 360 p(s) 361 } 362 }) 363 }) 364 } 365 366 // And groups predicates with the AND operator between them. 367 func And(predicates ...predicate.Meta) predicate.Meta { 368 return predicate.Meta(sql.AndPredicates(predicates...)) 369 } 370 371 // Or groups predicates with the OR operator between them. 372 func Or(predicates ...predicate.Meta) predicate.Meta { 373 return predicate.Meta(sql.OrPredicates(predicates...)) 374 } 375 376 // Not applies the not operator on the given predicate. 377 func Not(p predicate.Meta) predicate.Meta { 378 return predicate.Meta(sql.NotPredicates(p)) 379 }