github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/entrepository/ent/setting/where.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package setting 4 5 import ( 6 "time" 7 8 "entgo.io/ent/dialect/sql" 9 "github.com/ngocphuongnb/tetua/packages/entrepository/ent/predicate" 10 ) 11 12 // ID filters vertices based on their ID field. 13 func ID(id int) predicate.Setting { 14 return predicate.Setting(func(s *sql.Selector) { 15 s.Where(sql.EQ(s.C(FieldID), id)) 16 }) 17 } 18 19 // IDEQ applies the EQ predicate on the ID field. 20 func IDEQ(id int) predicate.Setting { 21 return predicate.Setting(func(s *sql.Selector) { 22 s.Where(sql.EQ(s.C(FieldID), id)) 23 }) 24 } 25 26 // IDNEQ applies the NEQ predicate on the ID field. 27 func IDNEQ(id int) predicate.Setting { 28 return predicate.Setting(func(s *sql.Selector) { 29 s.Where(sql.NEQ(s.C(FieldID), id)) 30 }) 31 } 32 33 // IDIn applies the In predicate on the ID field. 34 func IDIn(ids ...int) predicate.Setting { 35 return predicate.Setting(func(s *sql.Selector) { 36 // if not arguments were provided, append the FALSE constants, 37 // since we can't apply "IN ()". This will make this predicate falsy. 38 if len(ids) == 0 { 39 s.Where(sql.False()) 40 return 41 } 42 v := make([]interface{}, len(ids)) 43 for i := range v { 44 v[i] = ids[i] 45 } 46 s.Where(sql.In(s.C(FieldID), v...)) 47 }) 48 } 49 50 // IDNotIn applies the NotIn predicate on the ID field. 51 func IDNotIn(ids ...int) predicate.Setting { 52 return predicate.Setting(func(s *sql.Selector) { 53 // if not arguments were provided, append the FALSE constants, 54 // since we can't apply "IN ()". This will make this predicate falsy. 55 if len(ids) == 0 { 56 s.Where(sql.False()) 57 return 58 } 59 v := make([]interface{}, len(ids)) 60 for i := range v { 61 v[i] = ids[i] 62 } 63 s.Where(sql.NotIn(s.C(FieldID), v...)) 64 }) 65 } 66 67 // IDGT applies the GT predicate on the ID field. 68 func IDGT(id int) predicate.Setting { 69 return predicate.Setting(func(s *sql.Selector) { 70 s.Where(sql.GT(s.C(FieldID), id)) 71 }) 72 } 73 74 // IDGTE applies the GTE predicate on the ID field. 75 func IDGTE(id int) predicate.Setting { 76 return predicate.Setting(func(s *sql.Selector) { 77 s.Where(sql.GTE(s.C(FieldID), id)) 78 }) 79 } 80 81 // IDLT applies the LT predicate on the ID field. 82 func IDLT(id int) predicate.Setting { 83 return predicate.Setting(func(s *sql.Selector) { 84 s.Where(sql.LT(s.C(FieldID), id)) 85 }) 86 } 87 88 // IDLTE applies the LTE predicate on the ID field. 89 func IDLTE(id int) predicate.Setting { 90 return predicate.Setting(func(s *sql.Selector) { 91 s.Where(sql.LTE(s.C(FieldID), id)) 92 }) 93 } 94 95 // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. 96 func CreatedAt(v time.Time) predicate.Setting { 97 return predicate.Setting(func(s *sql.Selector) { 98 s.Where(sql.EQ(s.C(FieldCreatedAt), v)) 99 }) 100 } 101 102 // UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. 103 func UpdatedAt(v time.Time) predicate.Setting { 104 return predicate.Setting(func(s *sql.Selector) { 105 s.Where(sql.EQ(s.C(FieldUpdatedAt), v)) 106 }) 107 } 108 109 // DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. 110 func DeletedAt(v time.Time) predicate.Setting { 111 return predicate.Setting(func(s *sql.Selector) { 112 s.Where(sql.EQ(s.C(FieldDeletedAt), v)) 113 }) 114 } 115 116 // Name applies equality check predicate on the "name" field. It's identical to NameEQ. 117 func Name(v string) predicate.Setting { 118 return predicate.Setting(func(s *sql.Selector) { 119 s.Where(sql.EQ(s.C(FieldName), v)) 120 }) 121 } 122 123 // Value applies equality check predicate on the "value" field. It's identical to ValueEQ. 124 func Value(v string) predicate.Setting { 125 return predicate.Setting(func(s *sql.Selector) { 126 s.Where(sql.EQ(s.C(FieldValue), v)) 127 }) 128 } 129 130 // Type applies equality check predicate on the "type" field. It's identical to TypeEQ. 131 func Type(v string) predicate.Setting { 132 return predicate.Setting(func(s *sql.Selector) { 133 s.Where(sql.EQ(s.C(FieldType), v)) 134 }) 135 } 136 137 // CreatedAtEQ applies the EQ predicate on the "created_at" field. 138 func CreatedAtEQ(v time.Time) predicate.Setting { 139 return predicate.Setting(func(s *sql.Selector) { 140 s.Where(sql.EQ(s.C(FieldCreatedAt), v)) 141 }) 142 } 143 144 // CreatedAtNEQ applies the NEQ predicate on the "created_at" field. 145 func CreatedAtNEQ(v time.Time) predicate.Setting { 146 return predicate.Setting(func(s *sql.Selector) { 147 s.Where(sql.NEQ(s.C(FieldCreatedAt), v)) 148 }) 149 } 150 151 // CreatedAtIn applies the In predicate on the "created_at" field. 152 func CreatedAtIn(vs ...time.Time) predicate.Setting { 153 v := make([]interface{}, len(vs)) 154 for i := range v { 155 v[i] = vs[i] 156 } 157 return predicate.Setting(func(s *sql.Selector) { 158 // if not arguments were provided, append the FALSE constants, 159 // since we can't apply "IN ()". This will make this predicate falsy. 160 if len(v) == 0 { 161 s.Where(sql.False()) 162 return 163 } 164 s.Where(sql.In(s.C(FieldCreatedAt), v...)) 165 }) 166 } 167 168 // CreatedAtNotIn applies the NotIn predicate on the "created_at" field. 169 func CreatedAtNotIn(vs ...time.Time) predicate.Setting { 170 v := make([]interface{}, len(vs)) 171 for i := range v { 172 v[i] = vs[i] 173 } 174 return predicate.Setting(func(s *sql.Selector) { 175 // if not arguments were provided, append the FALSE constants, 176 // since we can't apply "IN ()". This will make this predicate falsy. 177 if len(v) == 0 { 178 s.Where(sql.False()) 179 return 180 } 181 s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) 182 }) 183 } 184 185 // CreatedAtGT applies the GT predicate on the "created_at" field. 186 func CreatedAtGT(v time.Time) predicate.Setting { 187 return predicate.Setting(func(s *sql.Selector) { 188 s.Where(sql.GT(s.C(FieldCreatedAt), v)) 189 }) 190 } 191 192 // CreatedAtGTE applies the GTE predicate on the "created_at" field. 193 func CreatedAtGTE(v time.Time) predicate.Setting { 194 return predicate.Setting(func(s *sql.Selector) { 195 s.Where(sql.GTE(s.C(FieldCreatedAt), v)) 196 }) 197 } 198 199 // CreatedAtLT applies the LT predicate on the "created_at" field. 200 func CreatedAtLT(v time.Time) predicate.Setting { 201 return predicate.Setting(func(s *sql.Selector) { 202 s.Where(sql.LT(s.C(FieldCreatedAt), v)) 203 }) 204 } 205 206 // CreatedAtLTE applies the LTE predicate on the "created_at" field. 207 func CreatedAtLTE(v time.Time) predicate.Setting { 208 return predicate.Setting(func(s *sql.Selector) { 209 s.Where(sql.LTE(s.C(FieldCreatedAt), v)) 210 }) 211 } 212 213 // UpdatedAtEQ applies the EQ predicate on the "updated_at" field. 214 func UpdatedAtEQ(v time.Time) predicate.Setting { 215 return predicate.Setting(func(s *sql.Selector) { 216 s.Where(sql.EQ(s.C(FieldUpdatedAt), v)) 217 }) 218 } 219 220 // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. 221 func UpdatedAtNEQ(v time.Time) predicate.Setting { 222 return predicate.Setting(func(s *sql.Selector) { 223 s.Where(sql.NEQ(s.C(FieldUpdatedAt), v)) 224 }) 225 } 226 227 // UpdatedAtIn applies the In predicate on the "updated_at" field. 228 func UpdatedAtIn(vs ...time.Time) predicate.Setting { 229 v := make([]interface{}, len(vs)) 230 for i := range v { 231 v[i] = vs[i] 232 } 233 return predicate.Setting(func(s *sql.Selector) { 234 // if not arguments were provided, append the FALSE constants, 235 // since we can't apply "IN ()". This will make this predicate falsy. 236 if len(v) == 0 { 237 s.Where(sql.False()) 238 return 239 } 240 s.Where(sql.In(s.C(FieldUpdatedAt), v...)) 241 }) 242 } 243 244 // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. 245 func UpdatedAtNotIn(vs ...time.Time) predicate.Setting { 246 v := make([]interface{}, len(vs)) 247 for i := range v { 248 v[i] = vs[i] 249 } 250 return predicate.Setting(func(s *sql.Selector) { 251 // if not arguments were provided, append the FALSE constants, 252 // since we can't apply "IN ()". This will make this predicate falsy. 253 if len(v) == 0 { 254 s.Where(sql.False()) 255 return 256 } 257 s.Where(sql.NotIn(s.C(FieldUpdatedAt), v...)) 258 }) 259 } 260 261 // UpdatedAtGT applies the GT predicate on the "updated_at" field. 262 func UpdatedAtGT(v time.Time) predicate.Setting { 263 return predicate.Setting(func(s *sql.Selector) { 264 s.Where(sql.GT(s.C(FieldUpdatedAt), v)) 265 }) 266 } 267 268 // UpdatedAtGTE applies the GTE predicate on the "updated_at" field. 269 func UpdatedAtGTE(v time.Time) predicate.Setting { 270 return predicate.Setting(func(s *sql.Selector) { 271 s.Where(sql.GTE(s.C(FieldUpdatedAt), v)) 272 }) 273 } 274 275 // UpdatedAtLT applies the LT predicate on the "updated_at" field. 276 func UpdatedAtLT(v time.Time) predicate.Setting { 277 return predicate.Setting(func(s *sql.Selector) { 278 s.Where(sql.LT(s.C(FieldUpdatedAt), v)) 279 }) 280 } 281 282 // UpdatedAtLTE applies the LTE predicate on the "updated_at" field. 283 func UpdatedAtLTE(v time.Time) predicate.Setting { 284 return predicate.Setting(func(s *sql.Selector) { 285 s.Where(sql.LTE(s.C(FieldUpdatedAt), v)) 286 }) 287 } 288 289 // DeletedAtEQ applies the EQ predicate on the "deleted_at" field. 290 func DeletedAtEQ(v time.Time) predicate.Setting { 291 return predicate.Setting(func(s *sql.Selector) { 292 s.Where(sql.EQ(s.C(FieldDeletedAt), v)) 293 }) 294 } 295 296 // DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. 297 func DeletedAtNEQ(v time.Time) predicate.Setting { 298 return predicate.Setting(func(s *sql.Selector) { 299 s.Where(sql.NEQ(s.C(FieldDeletedAt), v)) 300 }) 301 } 302 303 // DeletedAtIn applies the In predicate on the "deleted_at" field. 304 func DeletedAtIn(vs ...time.Time) predicate.Setting { 305 v := make([]interface{}, len(vs)) 306 for i := range v { 307 v[i] = vs[i] 308 } 309 return predicate.Setting(func(s *sql.Selector) { 310 // if not arguments were provided, append the FALSE constants, 311 // since we can't apply "IN ()". This will make this predicate falsy. 312 if len(v) == 0 { 313 s.Where(sql.False()) 314 return 315 } 316 s.Where(sql.In(s.C(FieldDeletedAt), v...)) 317 }) 318 } 319 320 // DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. 321 func DeletedAtNotIn(vs ...time.Time) predicate.Setting { 322 v := make([]interface{}, len(vs)) 323 for i := range v { 324 v[i] = vs[i] 325 } 326 return predicate.Setting(func(s *sql.Selector) { 327 // if not arguments were provided, append the FALSE constants, 328 // since we can't apply "IN ()". This will make this predicate falsy. 329 if len(v) == 0 { 330 s.Where(sql.False()) 331 return 332 } 333 s.Where(sql.NotIn(s.C(FieldDeletedAt), v...)) 334 }) 335 } 336 337 // DeletedAtGT applies the GT predicate on the "deleted_at" field. 338 func DeletedAtGT(v time.Time) predicate.Setting { 339 return predicate.Setting(func(s *sql.Selector) { 340 s.Where(sql.GT(s.C(FieldDeletedAt), v)) 341 }) 342 } 343 344 // DeletedAtGTE applies the GTE predicate on the "deleted_at" field. 345 func DeletedAtGTE(v time.Time) predicate.Setting { 346 return predicate.Setting(func(s *sql.Selector) { 347 s.Where(sql.GTE(s.C(FieldDeletedAt), v)) 348 }) 349 } 350 351 // DeletedAtLT applies the LT predicate on the "deleted_at" field. 352 func DeletedAtLT(v time.Time) predicate.Setting { 353 return predicate.Setting(func(s *sql.Selector) { 354 s.Where(sql.LT(s.C(FieldDeletedAt), v)) 355 }) 356 } 357 358 // DeletedAtLTE applies the LTE predicate on the "deleted_at" field. 359 func DeletedAtLTE(v time.Time) predicate.Setting { 360 return predicate.Setting(func(s *sql.Selector) { 361 s.Where(sql.LTE(s.C(FieldDeletedAt), v)) 362 }) 363 } 364 365 // DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. 366 func DeletedAtIsNil() predicate.Setting { 367 return predicate.Setting(func(s *sql.Selector) { 368 s.Where(sql.IsNull(s.C(FieldDeletedAt))) 369 }) 370 } 371 372 // DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. 373 func DeletedAtNotNil() predicate.Setting { 374 return predicate.Setting(func(s *sql.Selector) { 375 s.Where(sql.NotNull(s.C(FieldDeletedAt))) 376 }) 377 } 378 379 // NameEQ applies the EQ predicate on the "name" field. 380 func NameEQ(v string) predicate.Setting { 381 return predicate.Setting(func(s *sql.Selector) { 382 s.Where(sql.EQ(s.C(FieldName), v)) 383 }) 384 } 385 386 // NameNEQ applies the NEQ predicate on the "name" field. 387 func NameNEQ(v string) predicate.Setting { 388 return predicate.Setting(func(s *sql.Selector) { 389 s.Where(sql.NEQ(s.C(FieldName), v)) 390 }) 391 } 392 393 // NameIn applies the In predicate on the "name" field. 394 func NameIn(vs ...string) predicate.Setting { 395 v := make([]interface{}, len(vs)) 396 for i := range v { 397 v[i] = vs[i] 398 } 399 return predicate.Setting(func(s *sql.Selector) { 400 // if not arguments were provided, append the FALSE constants, 401 // since we can't apply "IN ()". This will make this predicate falsy. 402 if len(v) == 0 { 403 s.Where(sql.False()) 404 return 405 } 406 s.Where(sql.In(s.C(FieldName), v...)) 407 }) 408 } 409 410 // NameNotIn applies the NotIn predicate on the "name" field. 411 func NameNotIn(vs ...string) predicate.Setting { 412 v := make([]interface{}, len(vs)) 413 for i := range v { 414 v[i] = vs[i] 415 } 416 return predicate.Setting(func(s *sql.Selector) { 417 // if not arguments were provided, append the FALSE constants, 418 // since we can't apply "IN ()". This will make this predicate falsy. 419 if len(v) == 0 { 420 s.Where(sql.False()) 421 return 422 } 423 s.Where(sql.NotIn(s.C(FieldName), v...)) 424 }) 425 } 426 427 // NameGT applies the GT predicate on the "name" field. 428 func NameGT(v string) predicate.Setting { 429 return predicate.Setting(func(s *sql.Selector) { 430 s.Where(sql.GT(s.C(FieldName), v)) 431 }) 432 } 433 434 // NameGTE applies the GTE predicate on the "name" field. 435 func NameGTE(v string) predicate.Setting { 436 return predicate.Setting(func(s *sql.Selector) { 437 s.Where(sql.GTE(s.C(FieldName), v)) 438 }) 439 } 440 441 // NameLT applies the LT predicate on the "name" field. 442 func NameLT(v string) predicate.Setting { 443 return predicate.Setting(func(s *sql.Selector) { 444 s.Where(sql.LT(s.C(FieldName), v)) 445 }) 446 } 447 448 // NameLTE applies the LTE predicate on the "name" field. 449 func NameLTE(v string) predicate.Setting { 450 return predicate.Setting(func(s *sql.Selector) { 451 s.Where(sql.LTE(s.C(FieldName), v)) 452 }) 453 } 454 455 // NameContains applies the Contains predicate on the "name" field. 456 func NameContains(v string) predicate.Setting { 457 return predicate.Setting(func(s *sql.Selector) { 458 s.Where(sql.Contains(s.C(FieldName), v)) 459 }) 460 } 461 462 // NameHasPrefix applies the HasPrefix predicate on the "name" field. 463 func NameHasPrefix(v string) predicate.Setting { 464 return predicate.Setting(func(s *sql.Selector) { 465 s.Where(sql.HasPrefix(s.C(FieldName), v)) 466 }) 467 } 468 469 // NameHasSuffix applies the HasSuffix predicate on the "name" field. 470 func NameHasSuffix(v string) predicate.Setting { 471 return predicate.Setting(func(s *sql.Selector) { 472 s.Where(sql.HasSuffix(s.C(FieldName), v)) 473 }) 474 } 475 476 // NameEqualFold applies the EqualFold predicate on the "name" field. 477 func NameEqualFold(v string) predicate.Setting { 478 return predicate.Setting(func(s *sql.Selector) { 479 s.Where(sql.EqualFold(s.C(FieldName), v)) 480 }) 481 } 482 483 // NameContainsFold applies the ContainsFold predicate on the "name" field. 484 func NameContainsFold(v string) predicate.Setting { 485 return predicate.Setting(func(s *sql.Selector) { 486 s.Where(sql.ContainsFold(s.C(FieldName), v)) 487 }) 488 } 489 490 // ValueEQ applies the EQ predicate on the "value" field. 491 func ValueEQ(v string) predicate.Setting { 492 return predicate.Setting(func(s *sql.Selector) { 493 s.Where(sql.EQ(s.C(FieldValue), v)) 494 }) 495 } 496 497 // ValueNEQ applies the NEQ predicate on the "value" field. 498 func ValueNEQ(v string) predicate.Setting { 499 return predicate.Setting(func(s *sql.Selector) { 500 s.Where(sql.NEQ(s.C(FieldValue), v)) 501 }) 502 } 503 504 // ValueIn applies the In predicate on the "value" field. 505 func ValueIn(vs ...string) predicate.Setting { 506 v := make([]interface{}, len(vs)) 507 for i := range v { 508 v[i] = vs[i] 509 } 510 return predicate.Setting(func(s *sql.Selector) { 511 // if not arguments were provided, append the FALSE constants, 512 // since we can't apply "IN ()". This will make this predicate falsy. 513 if len(v) == 0 { 514 s.Where(sql.False()) 515 return 516 } 517 s.Where(sql.In(s.C(FieldValue), v...)) 518 }) 519 } 520 521 // ValueNotIn applies the NotIn predicate on the "value" field. 522 func ValueNotIn(vs ...string) predicate.Setting { 523 v := make([]interface{}, len(vs)) 524 for i := range v { 525 v[i] = vs[i] 526 } 527 return predicate.Setting(func(s *sql.Selector) { 528 // if not arguments were provided, append the FALSE constants, 529 // since we can't apply "IN ()". This will make this predicate falsy. 530 if len(v) == 0 { 531 s.Where(sql.False()) 532 return 533 } 534 s.Where(sql.NotIn(s.C(FieldValue), v...)) 535 }) 536 } 537 538 // ValueGT applies the GT predicate on the "value" field. 539 func ValueGT(v string) predicate.Setting { 540 return predicate.Setting(func(s *sql.Selector) { 541 s.Where(sql.GT(s.C(FieldValue), v)) 542 }) 543 } 544 545 // ValueGTE applies the GTE predicate on the "value" field. 546 func ValueGTE(v string) predicate.Setting { 547 return predicate.Setting(func(s *sql.Selector) { 548 s.Where(sql.GTE(s.C(FieldValue), v)) 549 }) 550 } 551 552 // ValueLT applies the LT predicate on the "value" field. 553 func ValueLT(v string) predicate.Setting { 554 return predicate.Setting(func(s *sql.Selector) { 555 s.Where(sql.LT(s.C(FieldValue), v)) 556 }) 557 } 558 559 // ValueLTE applies the LTE predicate on the "value" field. 560 func ValueLTE(v string) predicate.Setting { 561 return predicate.Setting(func(s *sql.Selector) { 562 s.Where(sql.LTE(s.C(FieldValue), v)) 563 }) 564 } 565 566 // ValueContains applies the Contains predicate on the "value" field. 567 func ValueContains(v string) predicate.Setting { 568 return predicate.Setting(func(s *sql.Selector) { 569 s.Where(sql.Contains(s.C(FieldValue), v)) 570 }) 571 } 572 573 // ValueHasPrefix applies the HasPrefix predicate on the "value" field. 574 func ValueHasPrefix(v string) predicate.Setting { 575 return predicate.Setting(func(s *sql.Selector) { 576 s.Where(sql.HasPrefix(s.C(FieldValue), v)) 577 }) 578 } 579 580 // ValueHasSuffix applies the HasSuffix predicate on the "value" field. 581 func ValueHasSuffix(v string) predicate.Setting { 582 return predicate.Setting(func(s *sql.Selector) { 583 s.Where(sql.HasSuffix(s.C(FieldValue), v)) 584 }) 585 } 586 587 // ValueIsNil applies the IsNil predicate on the "value" field. 588 func ValueIsNil() predicate.Setting { 589 return predicate.Setting(func(s *sql.Selector) { 590 s.Where(sql.IsNull(s.C(FieldValue))) 591 }) 592 } 593 594 // ValueNotNil applies the NotNil predicate on the "value" field. 595 func ValueNotNil() predicate.Setting { 596 return predicate.Setting(func(s *sql.Selector) { 597 s.Where(sql.NotNull(s.C(FieldValue))) 598 }) 599 } 600 601 // ValueEqualFold applies the EqualFold predicate on the "value" field. 602 func ValueEqualFold(v string) predicate.Setting { 603 return predicate.Setting(func(s *sql.Selector) { 604 s.Where(sql.EqualFold(s.C(FieldValue), v)) 605 }) 606 } 607 608 // ValueContainsFold applies the ContainsFold predicate on the "value" field. 609 func ValueContainsFold(v string) predicate.Setting { 610 return predicate.Setting(func(s *sql.Selector) { 611 s.Where(sql.ContainsFold(s.C(FieldValue), v)) 612 }) 613 } 614 615 // TypeEQ applies the EQ predicate on the "type" field. 616 func TypeEQ(v string) predicate.Setting { 617 return predicate.Setting(func(s *sql.Selector) { 618 s.Where(sql.EQ(s.C(FieldType), v)) 619 }) 620 } 621 622 // TypeNEQ applies the NEQ predicate on the "type" field. 623 func TypeNEQ(v string) predicate.Setting { 624 return predicate.Setting(func(s *sql.Selector) { 625 s.Where(sql.NEQ(s.C(FieldType), v)) 626 }) 627 } 628 629 // TypeIn applies the In predicate on the "type" field. 630 func TypeIn(vs ...string) predicate.Setting { 631 v := make([]interface{}, len(vs)) 632 for i := range v { 633 v[i] = vs[i] 634 } 635 return predicate.Setting(func(s *sql.Selector) { 636 // if not arguments were provided, append the FALSE constants, 637 // since we can't apply "IN ()". This will make this predicate falsy. 638 if len(v) == 0 { 639 s.Where(sql.False()) 640 return 641 } 642 s.Where(sql.In(s.C(FieldType), v...)) 643 }) 644 } 645 646 // TypeNotIn applies the NotIn predicate on the "type" field. 647 func TypeNotIn(vs ...string) predicate.Setting { 648 v := make([]interface{}, len(vs)) 649 for i := range v { 650 v[i] = vs[i] 651 } 652 return predicate.Setting(func(s *sql.Selector) { 653 // if not arguments were provided, append the FALSE constants, 654 // since we can't apply "IN ()". This will make this predicate falsy. 655 if len(v) == 0 { 656 s.Where(sql.False()) 657 return 658 } 659 s.Where(sql.NotIn(s.C(FieldType), v...)) 660 }) 661 } 662 663 // TypeGT applies the GT predicate on the "type" field. 664 func TypeGT(v string) predicate.Setting { 665 return predicate.Setting(func(s *sql.Selector) { 666 s.Where(sql.GT(s.C(FieldType), v)) 667 }) 668 } 669 670 // TypeGTE applies the GTE predicate on the "type" field. 671 func TypeGTE(v string) predicate.Setting { 672 return predicate.Setting(func(s *sql.Selector) { 673 s.Where(sql.GTE(s.C(FieldType), v)) 674 }) 675 } 676 677 // TypeLT applies the LT predicate on the "type" field. 678 func TypeLT(v string) predicate.Setting { 679 return predicate.Setting(func(s *sql.Selector) { 680 s.Where(sql.LT(s.C(FieldType), v)) 681 }) 682 } 683 684 // TypeLTE applies the LTE predicate on the "type" field. 685 func TypeLTE(v string) predicate.Setting { 686 return predicate.Setting(func(s *sql.Selector) { 687 s.Where(sql.LTE(s.C(FieldType), v)) 688 }) 689 } 690 691 // TypeContains applies the Contains predicate on the "type" field. 692 func TypeContains(v string) predicate.Setting { 693 return predicate.Setting(func(s *sql.Selector) { 694 s.Where(sql.Contains(s.C(FieldType), v)) 695 }) 696 } 697 698 // TypeHasPrefix applies the HasPrefix predicate on the "type" field. 699 func TypeHasPrefix(v string) predicate.Setting { 700 return predicate.Setting(func(s *sql.Selector) { 701 s.Where(sql.HasPrefix(s.C(FieldType), v)) 702 }) 703 } 704 705 // TypeHasSuffix applies the HasSuffix predicate on the "type" field. 706 func TypeHasSuffix(v string) predicate.Setting { 707 return predicate.Setting(func(s *sql.Selector) { 708 s.Where(sql.HasSuffix(s.C(FieldType), v)) 709 }) 710 } 711 712 // TypeIsNil applies the IsNil predicate on the "type" field. 713 func TypeIsNil() predicate.Setting { 714 return predicate.Setting(func(s *sql.Selector) { 715 s.Where(sql.IsNull(s.C(FieldType))) 716 }) 717 } 718 719 // TypeNotNil applies the NotNil predicate on the "type" field. 720 func TypeNotNil() predicate.Setting { 721 return predicate.Setting(func(s *sql.Selector) { 722 s.Where(sql.NotNull(s.C(FieldType))) 723 }) 724 } 725 726 // TypeEqualFold applies the EqualFold predicate on the "type" field. 727 func TypeEqualFold(v string) predicate.Setting { 728 return predicate.Setting(func(s *sql.Selector) { 729 s.Where(sql.EqualFold(s.C(FieldType), v)) 730 }) 731 } 732 733 // TypeContainsFold applies the ContainsFold predicate on the "type" field. 734 func TypeContainsFold(v string) predicate.Setting { 735 return predicate.Setting(func(s *sql.Selector) { 736 s.Where(sql.ContainsFold(s.C(FieldType), v)) 737 }) 738 } 739 740 // And groups predicates with the AND operator between them. 741 func And(predicates ...predicate.Setting) predicate.Setting { 742 return predicate.Setting(func(s *sql.Selector) { 743 s1 := s.Clone().SetP(nil) 744 for _, p := range predicates { 745 p(s1) 746 } 747 s.Where(s1.P()) 748 }) 749 } 750 751 // Or groups predicates with the OR operator between them. 752 func Or(predicates ...predicate.Setting) predicate.Setting { 753 return predicate.Setting(func(s *sql.Selector) { 754 s1 := s.Clone().SetP(nil) 755 for i, p := range predicates { 756 if i > 0 { 757 s1.Or() 758 } 759 p(s1) 760 } 761 s.Where(s1.P()) 762 }) 763 } 764 765 // Not applies the not operator on the given predicate. 766 func Not(p predicate.Setting) predicate.Setting { 767 return predicate.Setting(func(s *sql.Selector) { 768 p(s.Not()) 769 }) 770 }