github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/entrepository/ent/post/where.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package post 4 5 import ( 6 "time" 7 8 "entgo.io/ent/dialect/sql" 9 "entgo.io/ent/dialect/sql/sqlgraph" 10 "github.com/ngocphuongnb/tetua/packages/entrepository/ent/predicate" 11 ) 12 13 // ID filters vertices based on their ID field. 14 func ID(id int) predicate.Post { 15 return predicate.Post(func(s *sql.Selector) { 16 s.Where(sql.EQ(s.C(FieldID), id)) 17 }) 18 } 19 20 // IDEQ applies the EQ predicate on the ID field. 21 func IDEQ(id int) predicate.Post { 22 return predicate.Post(func(s *sql.Selector) { 23 s.Where(sql.EQ(s.C(FieldID), id)) 24 }) 25 } 26 27 // IDNEQ applies the NEQ predicate on the ID field. 28 func IDNEQ(id int) predicate.Post { 29 return predicate.Post(func(s *sql.Selector) { 30 s.Where(sql.NEQ(s.C(FieldID), id)) 31 }) 32 } 33 34 // IDIn applies the In predicate on the ID field. 35 func IDIn(ids ...int) predicate.Post { 36 return predicate.Post(func(s *sql.Selector) { 37 // if not arguments were provided, append the FALSE constants, 38 // since we can't apply "IN ()". This will make this predicate falsy. 39 if len(ids) == 0 { 40 s.Where(sql.False()) 41 return 42 } 43 v := make([]interface{}, len(ids)) 44 for i := range v { 45 v[i] = ids[i] 46 } 47 s.Where(sql.In(s.C(FieldID), v...)) 48 }) 49 } 50 51 // IDNotIn applies the NotIn predicate on the ID field. 52 func IDNotIn(ids ...int) predicate.Post { 53 return predicate.Post(func(s *sql.Selector) { 54 // if not arguments were provided, append the FALSE constants, 55 // since we can't apply "IN ()". This will make this predicate falsy. 56 if len(ids) == 0 { 57 s.Where(sql.False()) 58 return 59 } 60 v := make([]interface{}, len(ids)) 61 for i := range v { 62 v[i] = ids[i] 63 } 64 s.Where(sql.NotIn(s.C(FieldID), v...)) 65 }) 66 } 67 68 // IDGT applies the GT predicate on the ID field. 69 func IDGT(id int) predicate.Post { 70 return predicate.Post(func(s *sql.Selector) { 71 s.Where(sql.GT(s.C(FieldID), id)) 72 }) 73 } 74 75 // IDGTE applies the GTE predicate on the ID field. 76 func IDGTE(id int) predicate.Post { 77 return predicate.Post(func(s *sql.Selector) { 78 s.Where(sql.GTE(s.C(FieldID), id)) 79 }) 80 } 81 82 // IDLT applies the LT predicate on the ID field. 83 func IDLT(id int) predicate.Post { 84 return predicate.Post(func(s *sql.Selector) { 85 s.Where(sql.LT(s.C(FieldID), id)) 86 }) 87 } 88 89 // IDLTE applies the LTE predicate on the ID field. 90 func IDLTE(id int) predicate.Post { 91 return predicate.Post(func(s *sql.Selector) { 92 s.Where(sql.LTE(s.C(FieldID), id)) 93 }) 94 } 95 96 // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. 97 func CreatedAt(v time.Time) predicate.Post { 98 return predicate.Post(func(s *sql.Selector) { 99 s.Where(sql.EQ(s.C(FieldCreatedAt), v)) 100 }) 101 } 102 103 // UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. 104 func UpdatedAt(v time.Time) predicate.Post { 105 return predicate.Post(func(s *sql.Selector) { 106 s.Where(sql.EQ(s.C(FieldUpdatedAt), v)) 107 }) 108 } 109 110 // DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. 111 func DeletedAt(v time.Time) predicate.Post { 112 return predicate.Post(func(s *sql.Selector) { 113 s.Where(sql.EQ(s.C(FieldDeletedAt), v)) 114 }) 115 } 116 117 // Name applies equality check predicate on the "name" field. It's identical to NameEQ. 118 func Name(v string) predicate.Post { 119 return predicate.Post(func(s *sql.Selector) { 120 s.Where(sql.EQ(s.C(FieldName), v)) 121 }) 122 } 123 124 // Slug applies equality check predicate on the "slug" field. It's identical to SlugEQ. 125 func Slug(v string) predicate.Post { 126 return predicate.Post(func(s *sql.Selector) { 127 s.Where(sql.EQ(s.C(FieldSlug), v)) 128 }) 129 } 130 131 // Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. 132 func Description(v string) predicate.Post { 133 return predicate.Post(func(s *sql.Selector) { 134 s.Where(sql.EQ(s.C(FieldDescription), v)) 135 }) 136 } 137 138 // Content applies equality check predicate on the "content" field. It's identical to ContentEQ. 139 func Content(v string) predicate.Post { 140 return predicate.Post(func(s *sql.Selector) { 141 s.Where(sql.EQ(s.C(FieldContent), v)) 142 }) 143 } 144 145 // ContentHTML applies equality check predicate on the "content_html" field. It's identical to ContentHTMLEQ. 146 func ContentHTML(v string) predicate.Post { 147 return predicate.Post(func(s *sql.Selector) { 148 s.Where(sql.EQ(s.C(FieldContentHTML), v)) 149 }) 150 } 151 152 // ViewCount applies equality check predicate on the "view_count" field. It's identical to ViewCountEQ. 153 func ViewCount(v int64) predicate.Post { 154 return predicate.Post(func(s *sql.Selector) { 155 s.Where(sql.EQ(s.C(FieldViewCount), v)) 156 }) 157 } 158 159 // CommentCount applies equality check predicate on the "comment_count" field. It's identical to CommentCountEQ. 160 func CommentCount(v int64) predicate.Post { 161 return predicate.Post(func(s *sql.Selector) { 162 s.Where(sql.EQ(s.C(FieldCommentCount), v)) 163 }) 164 } 165 166 // RatingCount applies equality check predicate on the "rating_count" field. It's identical to RatingCountEQ. 167 func RatingCount(v int64) predicate.Post { 168 return predicate.Post(func(s *sql.Selector) { 169 s.Where(sql.EQ(s.C(FieldRatingCount), v)) 170 }) 171 } 172 173 // RatingTotal applies equality check predicate on the "rating_total" field. It's identical to RatingTotalEQ. 174 func RatingTotal(v int64) predicate.Post { 175 return predicate.Post(func(s *sql.Selector) { 176 s.Where(sql.EQ(s.C(FieldRatingTotal), v)) 177 }) 178 } 179 180 // Draft applies equality check predicate on the "draft" field. It's identical to DraftEQ. 181 func Draft(v bool) predicate.Post { 182 return predicate.Post(func(s *sql.Selector) { 183 s.Where(sql.EQ(s.C(FieldDraft), v)) 184 }) 185 } 186 187 // Approved applies equality check predicate on the "approved" field. It's identical to ApprovedEQ. 188 func Approved(v bool) predicate.Post { 189 return predicate.Post(func(s *sql.Selector) { 190 s.Where(sql.EQ(s.C(FieldApproved), v)) 191 }) 192 } 193 194 // FeaturedImageID applies equality check predicate on the "featured_image_id" field. It's identical to FeaturedImageIDEQ. 195 func FeaturedImageID(v int) predicate.Post { 196 return predicate.Post(func(s *sql.Selector) { 197 s.Where(sql.EQ(s.C(FieldFeaturedImageID), v)) 198 }) 199 } 200 201 // UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ. 202 func UserID(v int) predicate.Post { 203 return predicate.Post(func(s *sql.Selector) { 204 s.Where(sql.EQ(s.C(FieldUserID), v)) 205 }) 206 } 207 208 // CreatedAtEQ applies the EQ predicate on the "created_at" field. 209 func CreatedAtEQ(v time.Time) predicate.Post { 210 return predicate.Post(func(s *sql.Selector) { 211 s.Where(sql.EQ(s.C(FieldCreatedAt), v)) 212 }) 213 } 214 215 // CreatedAtNEQ applies the NEQ predicate on the "created_at" field. 216 func CreatedAtNEQ(v time.Time) predicate.Post { 217 return predicate.Post(func(s *sql.Selector) { 218 s.Where(sql.NEQ(s.C(FieldCreatedAt), v)) 219 }) 220 } 221 222 // CreatedAtIn applies the In predicate on the "created_at" field. 223 func CreatedAtIn(vs ...time.Time) predicate.Post { 224 v := make([]interface{}, len(vs)) 225 for i := range v { 226 v[i] = vs[i] 227 } 228 return predicate.Post(func(s *sql.Selector) { 229 // if not arguments were provided, append the FALSE constants, 230 // since we can't apply "IN ()". This will make this predicate falsy. 231 if len(v) == 0 { 232 s.Where(sql.False()) 233 return 234 } 235 s.Where(sql.In(s.C(FieldCreatedAt), v...)) 236 }) 237 } 238 239 // CreatedAtNotIn applies the NotIn predicate on the "created_at" field. 240 func CreatedAtNotIn(vs ...time.Time) predicate.Post { 241 v := make([]interface{}, len(vs)) 242 for i := range v { 243 v[i] = vs[i] 244 } 245 return predicate.Post(func(s *sql.Selector) { 246 // if not arguments were provided, append the FALSE constants, 247 // since we can't apply "IN ()". This will make this predicate falsy. 248 if len(v) == 0 { 249 s.Where(sql.False()) 250 return 251 } 252 s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) 253 }) 254 } 255 256 // CreatedAtGT applies the GT predicate on the "created_at" field. 257 func CreatedAtGT(v time.Time) predicate.Post { 258 return predicate.Post(func(s *sql.Selector) { 259 s.Where(sql.GT(s.C(FieldCreatedAt), v)) 260 }) 261 } 262 263 // CreatedAtGTE applies the GTE predicate on the "created_at" field. 264 func CreatedAtGTE(v time.Time) predicate.Post { 265 return predicate.Post(func(s *sql.Selector) { 266 s.Where(sql.GTE(s.C(FieldCreatedAt), v)) 267 }) 268 } 269 270 // CreatedAtLT applies the LT predicate on the "created_at" field. 271 func CreatedAtLT(v time.Time) predicate.Post { 272 return predicate.Post(func(s *sql.Selector) { 273 s.Where(sql.LT(s.C(FieldCreatedAt), v)) 274 }) 275 } 276 277 // CreatedAtLTE applies the LTE predicate on the "created_at" field. 278 func CreatedAtLTE(v time.Time) predicate.Post { 279 return predicate.Post(func(s *sql.Selector) { 280 s.Where(sql.LTE(s.C(FieldCreatedAt), v)) 281 }) 282 } 283 284 // UpdatedAtEQ applies the EQ predicate on the "updated_at" field. 285 func UpdatedAtEQ(v time.Time) predicate.Post { 286 return predicate.Post(func(s *sql.Selector) { 287 s.Where(sql.EQ(s.C(FieldUpdatedAt), v)) 288 }) 289 } 290 291 // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. 292 func UpdatedAtNEQ(v time.Time) predicate.Post { 293 return predicate.Post(func(s *sql.Selector) { 294 s.Where(sql.NEQ(s.C(FieldUpdatedAt), v)) 295 }) 296 } 297 298 // UpdatedAtIn applies the In predicate on the "updated_at" field. 299 func UpdatedAtIn(vs ...time.Time) predicate.Post { 300 v := make([]interface{}, len(vs)) 301 for i := range v { 302 v[i] = vs[i] 303 } 304 return predicate.Post(func(s *sql.Selector) { 305 // if not arguments were provided, append the FALSE constants, 306 // since we can't apply "IN ()". This will make this predicate falsy. 307 if len(v) == 0 { 308 s.Where(sql.False()) 309 return 310 } 311 s.Where(sql.In(s.C(FieldUpdatedAt), v...)) 312 }) 313 } 314 315 // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. 316 func UpdatedAtNotIn(vs ...time.Time) predicate.Post { 317 v := make([]interface{}, len(vs)) 318 for i := range v { 319 v[i] = vs[i] 320 } 321 return predicate.Post(func(s *sql.Selector) { 322 // if not arguments were provided, append the FALSE constants, 323 // since we can't apply "IN ()". This will make this predicate falsy. 324 if len(v) == 0 { 325 s.Where(sql.False()) 326 return 327 } 328 s.Where(sql.NotIn(s.C(FieldUpdatedAt), v...)) 329 }) 330 } 331 332 // UpdatedAtGT applies the GT predicate on the "updated_at" field. 333 func UpdatedAtGT(v time.Time) predicate.Post { 334 return predicate.Post(func(s *sql.Selector) { 335 s.Where(sql.GT(s.C(FieldUpdatedAt), v)) 336 }) 337 } 338 339 // UpdatedAtGTE applies the GTE predicate on the "updated_at" field. 340 func UpdatedAtGTE(v time.Time) predicate.Post { 341 return predicate.Post(func(s *sql.Selector) { 342 s.Where(sql.GTE(s.C(FieldUpdatedAt), v)) 343 }) 344 } 345 346 // UpdatedAtLT applies the LT predicate on the "updated_at" field. 347 func UpdatedAtLT(v time.Time) predicate.Post { 348 return predicate.Post(func(s *sql.Selector) { 349 s.Where(sql.LT(s.C(FieldUpdatedAt), v)) 350 }) 351 } 352 353 // UpdatedAtLTE applies the LTE predicate on the "updated_at" field. 354 func UpdatedAtLTE(v time.Time) predicate.Post { 355 return predicate.Post(func(s *sql.Selector) { 356 s.Where(sql.LTE(s.C(FieldUpdatedAt), v)) 357 }) 358 } 359 360 // DeletedAtEQ applies the EQ predicate on the "deleted_at" field. 361 func DeletedAtEQ(v time.Time) predicate.Post { 362 return predicate.Post(func(s *sql.Selector) { 363 s.Where(sql.EQ(s.C(FieldDeletedAt), v)) 364 }) 365 } 366 367 // DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. 368 func DeletedAtNEQ(v time.Time) predicate.Post { 369 return predicate.Post(func(s *sql.Selector) { 370 s.Where(sql.NEQ(s.C(FieldDeletedAt), v)) 371 }) 372 } 373 374 // DeletedAtIn applies the In predicate on the "deleted_at" field. 375 func DeletedAtIn(vs ...time.Time) predicate.Post { 376 v := make([]interface{}, len(vs)) 377 for i := range v { 378 v[i] = vs[i] 379 } 380 return predicate.Post(func(s *sql.Selector) { 381 // if not arguments were provided, append the FALSE constants, 382 // since we can't apply "IN ()". This will make this predicate falsy. 383 if len(v) == 0 { 384 s.Where(sql.False()) 385 return 386 } 387 s.Where(sql.In(s.C(FieldDeletedAt), v...)) 388 }) 389 } 390 391 // DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. 392 func DeletedAtNotIn(vs ...time.Time) predicate.Post { 393 v := make([]interface{}, len(vs)) 394 for i := range v { 395 v[i] = vs[i] 396 } 397 return predicate.Post(func(s *sql.Selector) { 398 // if not arguments were provided, append the FALSE constants, 399 // since we can't apply "IN ()". This will make this predicate falsy. 400 if len(v) == 0 { 401 s.Where(sql.False()) 402 return 403 } 404 s.Where(sql.NotIn(s.C(FieldDeletedAt), v...)) 405 }) 406 } 407 408 // DeletedAtGT applies the GT predicate on the "deleted_at" field. 409 func DeletedAtGT(v time.Time) predicate.Post { 410 return predicate.Post(func(s *sql.Selector) { 411 s.Where(sql.GT(s.C(FieldDeletedAt), v)) 412 }) 413 } 414 415 // DeletedAtGTE applies the GTE predicate on the "deleted_at" field. 416 func DeletedAtGTE(v time.Time) predicate.Post { 417 return predicate.Post(func(s *sql.Selector) { 418 s.Where(sql.GTE(s.C(FieldDeletedAt), v)) 419 }) 420 } 421 422 // DeletedAtLT applies the LT predicate on the "deleted_at" field. 423 func DeletedAtLT(v time.Time) predicate.Post { 424 return predicate.Post(func(s *sql.Selector) { 425 s.Where(sql.LT(s.C(FieldDeletedAt), v)) 426 }) 427 } 428 429 // DeletedAtLTE applies the LTE predicate on the "deleted_at" field. 430 func DeletedAtLTE(v time.Time) predicate.Post { 431 return predicate.Post(func(s *sql.Selector) { 432 s.Where(sql.LTE(s.C(FieldDeletedAt), v)) 433 }) 434 } 435 436 // DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. 437 func DeletedAtIsNil() predicate.Post { 438 return predicate.Post(func(s *sql.Selector) { 439 s.Where(sql.IsNull(s.C(FieldDeletedAt))) 440 }) 441 } 442 443 // DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. 444 func DeletedAtNotNil() predicate.Post { 445 return predicate.Post(func(s *sql.Selector) { 446 s.Where(sql.NotNull(s.C(FieldDeletedAt))) 447 }) 448 } 449 450 // NameEQ applies the EQ predicate on the "name" field. 451 func NameEQ(v string) predicate.Post { 452 return predicate.Post(func(s *sql.Selector) { 453 s.Where(sql.EQ(s.C(FieldName), v)) 454 }) 455 } 456 457 // NameNEQ applies the NEQ predicate on the "name" field. 458 func NameNEQ(v string) predicate.Post { 459 return predicate.Post(func(s *sql.Selector) { 460 s.Where(sql.NEQ(s.C(FieldName), v)) 461 }) 462 } 463 464 // NameIn applies the In predicate on the "name" field. 465 func NameIn(vs ...string) predicate.Post { 466 v := make([]interface{}, len(vs)) 467 for i := range v { 468 v[i] = vs[i] 469 } 470 return predicate.Post(func(s *sql.Selector) { 471 // if not arguments were provided, append the FALSE constants, 472 // since we can't apply "IN ()". This will make this predicate falsy. 473 if len(v) == 0 { 474 s.Where(sql.False()) 475 return 476 } 477 s.Where(sql.In(s.C(FieldName), v...)) 478 }) 479 } 480 481 // NameNotIn applies the NotIn predicate on the "name" field. 482 func NameNotIn(vs ...string) predicate.Post { 483 v := make([]interface{}, len(vs)) 484 for i := range v { 485 v[i] = vs[i] 486 } 487 return predicate.Post(func(s *sql.Selector) { 488 // if not arguments were provided, append the FALSE constants, 489 // since we can't apply "IN ()". This will make this predicate falsy. 490 if len(v) == 0 { 491 s.Where(sql.False()) 492 return 493 } 494 s.Where(sql.NotIn(s.C(FieldName), v...)) 495 }) 496 } 497 498 // NameGT applies the GT predicate on the "name" field. 499 func NameGT(v string) predicate.Post { 500 return predicate.Post(func(s *sql.Selector) { 501 s.Where(sql.GT(s.C(FieldName), v)) 502 }) 503 } 504 505 // NameGTE applies the GTE predicate on the "name" field. 506 func NameGTE(v string) predicate.Post { 507 return predicate.Post(func(s *sql.Selector) { 508 s.Where(sql.GTE(s.C(FieldName), v)) 509 }) 510 } 511 512 // NameLT applies the LT predicate on the "name" field. 513 func NameLT(v string) predicate.Post { 514 return predicate.Post(func(s *sql.Selector) { 515 s.Where(sql.LT(s.C(FieldName), v)) 516 }) 517 } 518 519 // NameLTE applies the LTE predicate on the "name" field. 520 func NameLTE(v string) predicate.Post { 521 return predicate.Post(func(s *sql.Selector) { 522 s.Where(sql.LTE(s.C(FieldName), v)) 523 }) 524 } 525 526 // NameContains applies the Contains predicate on the "name" field. 527 func NameContains(v string) predicate.Post { 528 return predicate.Post(func(s *sql.Selector) { 529 s.Where(sql.Contains(s.C(FieldName), v)) 530 }) 531 } 532 533 // NameHasPrefix applies the HasPrefix predicate on the "name" field. 534 func NameHasPrefix(v string) predicate.Post { 535 return predicate.Post(func(s *sql.Selector) { 536 s.Where(sql.HasPrefix(s.C(FieldName), v)) 537 }) 538 } 539 540 // NameHasSuffix applies the HasSuffix predicate on the "name" field. 541 func NameHasSuffix(v string) predicate.Post { 542 return predicate.Post(func(s *sql.Selector) { 543 s.Where(sql.HasSuffix(s.C(FieldName), v)) 544 }) 545 } 546 547 // NameEqualFold applies the EqualFold predicate on the "name" field. 548 func NameEqualFold(v string) predicate.Post { 549 return predicate.Post(func(s *sql.Selector) { 550 s.Where(sql.EqualFold(s.C(FieldName), v)) 551 }) 552 } 553 554 // NameContainsFold applies the ContainsFold predicate on the "name" field. 555 func NameContainsFold(v string) predicate.Post { 556 return predicate.Post(func(s *sql.Selector) { 557 s.Where(sql.ContainsFold(s.C(FieldName), v)) 558 }) 559 } 560 561 // SlugEQ applies the EQ predicate on the "slug" field. 562 func SlugEQ(v string) predicate.Post { 563 return predicate.Post(func(s *sql.Selector) { 564 s.Where(sql.EQ(s.C(FieldSlug), v)) 565 }) 566 } 567 568 // SlugNEQ applies the NEQ predicate on the "slug" field. 569 func SlugNEQ(v string) predicate.Post { 570 return predicate.Post(func(s *sql.Selector) { 571 s.Where(sql.NEQ(s.C(FieldSlug), v)) 572 }) 573 } 574 575 // SlugIn applies the In predicate on the "slug" field. 576 func SlugIn(vs ...string) predicate.Post { 577 v := make([]interface{}, len(vs)) 578 for i := range v { 579 v[i] = vs[i] 580 } 581 return predicate.Post(func(s *sql.Selector) { 582 // if not arguments were provided, append the FALSE constants, 583 // since we can't apply "IN ()". This will make this predicate falsy. 584 if len(v) == 0 { 585 s.Where(sql.False()) 586 return 587 } 588 s.Where(sql.In(s.C(FieldSlug), v...)) 589 }) 590 } 591 592 // SlugNotIn applies the NotIn predicate on the "slug" field. 593 func SlugNotIn(vs ...string) predicate.Post { 594 v := make([]interface{}, len(vs)) 595 for i := range v { 596 v[i] = vs[i] 597 } 598 return predicate.Post(func(s *sql.Selector) { 599 // if not arguments were provided, append the FALSE constants, 600 // since we can't apply "IN ()". This will make this predicate falsy. 601 if len(v) == 0 { 602 s.Where(sql.False()) 603 return 604 } 605 s.Where(sql.NotIn(s.C(FieldSlug), v...)) 606 }) 607 } 608 609 // SlugGT applies the GT predicate on the "slug" field. 610 func SlugGT(v string) predicate.Post { 611 return predicate.Post(func(s *sql.Selector) { 612 s.Where(sql.GT(s.C(FieldSlug), v)) 613 }) 614 } 615 616 // SlugGTE applies the GTE predicate on the "slug" field. 617 func SlugGTE(v string) predicate.Post { 618 return predicate.Post(func(s *sql.Selector) { 619 s.Where(sql.GTE(s.C(FieldSlug), v)) 620 }) 621 } 622 623 // SlugLT applies the LT predicate on the "slug" field. 624 func SlugLT(v string) predicate.Post { 625 return predicate.Post(func(s *sql.Selector) { 626 s.Where(sql.LT(s.C(FieldSlug), v)) 627 }) 628 } 629 630 // SlugLTE applies the LTE predicate on the "slug" field. 631 func SlugLTE(v string) predicate.Post { 632 return predicate.Post(func(s *sql.Selector) { 633 s.Where(sql.LTE(s.C(FieldSlug), v)) 634 }) 635 } 636 637 // SlugContains applies the Contains predicate on the "slug" field. 638 func SlugContains(v string) predicate.Post { 639 return predicate.Post(func(s *sql.Selector) { 640 s.Where(sql.Contains(s.C(FieldSlug), v)) 641 }) 642 } 643 644 // SlugHasPrefix applies the HasPrefix predicate on the "slug" field. 645 func SlugHasPrefix(v string) predicate.Post { 646 return predicate.Post(func(s *sql.Selector) { 647 s.Where(sql.HasPrefix(s.C(FieldSlug), v)) 648 }) 649 } 650 651 // SlugHasSuffix applies the HasSuffix predicate on the "slug" field. 652 func SlugHasSuffix(v string) predicate.Post { 653 return predicate.Post(func(s *sql.Selector) { 654 s.Where(sql.HasSuffix(s.C(FieldSlug), v)) 655 }) 656 } 657 658 // SlugEqualFold applies the EqualFold predicate on the "slug" field. 659 func SlugEqualFold(v string) predicate.Post { 660 return predicate.Post(func(s *sql.Selector) { 661 s.Where(sql.EqualFold(s.C(FieldSlug), v)) 662 }) 663 } 664 665 // SlugContainsFold applies the ContainsFold predicate on the "slug" field. 666 func SlugContainsFold(v string) predicate.Post { 667 return predicate.Post(func(s *sql.Selector) { 668 s.Where(sql.ContainsFold(s.C(FieldSlug), v)) 669 }) 670 } 671 672 // DescriptionEQ applies the EQ predicate on the "description" field. 673 func DescriptionEQ(v string) predicate.Post { 674 return predicate.Post(func(s *sql.Selector) { 675 s.Where(sql.EQ(s.C(FieldDescription), v)) 676 }) 677 } 678 679 // DescriptionNEQ applies the NEQ predicate on the "description" field. 680 func DescriptionNEQ(v string) predicate.Post { 681 return predicate.Post(func(s *sql.Selector) { 682 s.Where(sql.NEQ(s.C(FieldDescription), v)) 683 }) 684 } 685 686 // DescriptionIn applies the In predicate on the "description" field. 687 func DescriptionIn(vs ...string) predicate.Post { 688 v := make([]interface{}, len(vs)) 689 for i := range v { 690 v[i] = vs[i] 691 } 692 return predicate.Post(func(s *sql.Selector) { 693 // if not arguments were provided, append the FALSE constants, 694 // since we can't apply "IN ()". This will make this predicate falsy. 695 if len(v) == 0 { 696 s.Where(sql.False()) 697 return 698 } 699 s.Where(sql.In(s.C(FieldDescription), v...)) 700 }) 701 } 702 703 // DescriptionNotIn applies the NotIn predicate on the "description" field. 704 func DescriptionNotIn(vs ...string) predicate.Post { 705 v := make([]interface{}, len(vs)) 706 for i := range v { 707 v[i] = vs[i] 708 } 709 return predicate.Post(func(s *sql.Selector) { 710 // if not arguments were provided, append the FALSE constants, 711 // since we can't apply "IN ()". This will make this predicate falsy. 712 if len(v) == 0 { 713 s.Where(sql.False()) 714 return 715 } 716 s.Where(sql.NotIn(s.C(FieldDescription), v...)) 717 }) 718 } 719 720 // DescriptionGT applies the GT predicate on the "description" field. 721 func DescriptionGT(v string) predicate.Post { 722 return predicate.Post(func(s *sql.Selector) { 723 s.Where(sql.GT(s.C(FieldDescription), v)) 724 }) 725 } 726 727 // DescriptionGTE applies the GTE predicate on the "description" field. 728 func DescriptionGTE(v string) predicate.Post { 729 return predicate.Post(func(s *sql.Selector) { 730 s.Where(sql.GTE(s.C(FieldDescription), v)) 731 }) 732 } 733 734 // DescriptionLT applies the LT predicate on the "description" field. 735 func DescriptionLT(v string) predicate.Post { 736 return predicate.Post(func(s *sql.Selector) { 737 s.Where(sql.LT(s.C(FieldDescription), v)) 738 }) 739 } 740 741 // DescriptionLTE applies the LTE predicate on the "description" field. 742 func DescriptionLTE(v string) predicate.Post { 743 return predicate.Post(func(s *sql.Selector) { 744 s.Where(sql.LTE(s.C(FieldDescription), v)) 745 }) 746 } 747 748 // DescriptionContains applies the Contains predicate on the "description" field. 749 func DescriptionContains(v string) predicate.Post { 750 return predicate.Post(func(s *sql.Selector) { 751 s.Where(sql.Contains(s.C(FieldDescription), v)) 752 }) 753 } 754 755 // DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. 756 func DescriptionHasPrefix(v string) predicate.Post { 757 return predicate.Post(func(s *sql.Selector) { 758 s.Where(sql.HasPrefix(s.C(FieldDescription), v)) 759 }) 760 } 761 762 // DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. 763 func DescriptionHasSuffix(v string) predicate.Post { 764 return predicate.Post(func(s *sql.Selector) { 765 s.Where(sql.HasSuffix(s.C(FieldDescription), v)) 766 }) 767 } 768 769 // DescriptionIsNil applies the IsNil predicate on the "description" field. 770 func DescriptionIsNil() predicate.Post { 771 return predicate.Post(func(s *sql.Selector) { 772 s.Where(sql.IsNull(s.C(FieldDescription))) 773 }) 774 } 775 776 // DescriptionNotNil applies the NotNil predicate on the "description" field. 777 func DescriptionNotNil() predicate.Post { 778 return predicate.Post(func(s *sql.Selector) { 779 s.Where(sql.NotNull(s.C(FieldDescription))) 780 }) 781 } 782 783 // DescriptionEqualFold applies the EqualFold predicate on the "description" field. 784 func DescriptionEqualFold(v string) predicate.Post { 785 return predicate.Post(func(s *sql.Selector) { 786 s.Where(sql.EqualFold(s.C(FieldDescription), v)) 787 }) 788 } 789 790 // DescriptionContainsFold applies the ContainsFold predicate on the "description" field. 791 func DescriptionContainsFold(v string) predicate.Post { 792 return predicate.Post(func(s *sql.Selector) { 793 s.Where(sql.ContainsFold(s.C(FieldDescription), v)) 794 }) 795 } 796 797 // ContentEQ applies the EQ predicate on the "content" field. 798 func ContentEQ(v string) predicate.Post { 799 return predicate.Post(func(s *sql.Selector) { 800 s.Where(sql.EQ(s.C(FieldContent), v)) 801 }) 802 } 803 804 // ContentNEQ applies the NEQ predicate on the "content" field. 805 func ContentNEQ(v string) predicate.Post { 806 return predicate.Post(func(s *sql.Selector) { 807 s.Where(sql.NEQ(s.C(FieldContent), v)) 808 }) 809 } 810 811 // ContentIn applies the In predicate on the "content" field. 812 func ContentIn(vs ...string) predicate.Post { 813 v := make([]interface{}, len(vs)) 814 for i := range v { 815 v[i] = vs[i] 816 } 817 return predicate.Post(func(s *sql.Selector) { 818 // if not arguments were provided, append the FALSE constants, 819 // since we can't apply "IN ()". This will make this predicate falsy. 820 if len(v) == 0 { 821 s.Where(sql.False()) 822 return 823 } 824 s.Where(sql.In(s.C(FieldContent), v...)) 825 }) 826 } 827 828 // ContentNotIn applies the NotIn predicate on the "content" field. 829 func ContentNotIn(vs ...string) predicate.Post { 830 v := make([]interface{}, len(vs)) 831 for i := range v { 832 v[i] = vs[i] 833 } 834 return predicate.Post(func(s *sql.Selector) { 835 // if not arguments were provided, append the FALSE constants, 836 // since we can't apply "IN ()". This will make this predicate falsy. 837 if len(v) == 0 { 838 s.Where(sql.False()) 839 return 840 } 841 s.Where(sql.NotIn(s.C(FieldContent), v...)) 842 }) 843 } 844 845 // ContentGT applies the GT predicate on the "content" field. 846 func ContentGT(v string) predicate.Post { 847 return predicate.Post(func(s *sql.Selector) { 848 s.Where(sql.GT(s.C(FieldContent), v)) 849 }) 850 } 851 852 // ContentGTE applies the GTE predicate on the "content" field. 853 func ContentGTE(v string) predicate.Post { 854 return predicate.Post(func(s *sql.Selector) { 855 s.Where(sql.GTE(s.C(FieldContent), v)) 856 }) 857 } 858 859 // ContentLT applies the LT predicate on the "content" field. 860 func ContentLT(v string) predicate.Post { 861 return predicate.Post(func(s *sql.Selector) { 862 s.Where(sql.LT(s.C(FieldContent), v)) 863 }) 864 } 865 866 // ContentLTE applies the LTE predicate on the "content" field. 867 func ContentLTE(v string) predicate.Post { 868 return predicate.Post(func(s *sql.Selector) { 869 s.Where(sql.LTE(s.C(FieldContent), v)) 870 }) 871 } 872 873 // ContentContains applies the Contains predicate on the "content" field. 874 func ContentContains(v string) predicate.Post { 875 return predicate.Post(func(s *sql.Selector) { 876 s.Where(sql.Contains(s.C(FieldContent), v)) 877 }) 878 } 879 880 // ContentHasPrefix applies the HasPrefix predicate on the "content" field. 881 func ContentHasPrefix(v string) predicate.Post { 882 return predicate.Post(func(s *sql.Selector) { 883 s.Where(sql.HasPrefix(s.C(FieldContent), v)) 884 }) 885 } 886 887 // ContentHasSuffix applies the HasSuffix predicate on the "content" field. 888 func ContentHasSuffix(v string) predicate.Post { 889 return predicate.Post(func(s *sql.Selector) { 890 s.Where(sql.HasSuffix(s.C(FieldContent), v)) 891 }) 892 } 893 894 // ContentEqualFold applies the EqualFold predicate on the "content" field. 895 func ContentEqualFold(v string) predicate.Post { 896 return predicate.Post(func(s *sql.Selector) { 897 s.Where(sql.EqualFold(s.C(FieldContent), v)) 898 }) 899 } 900 901 // ContentContainsFold applies the ContainsFold predicate on the "content" field. 902 func ContentContainsFold(v string) predicate.Post { 903 return predicate.Post(func(s *sql.Selector) { 904 s.Where(sql.ContainsFold(s.C(FieldContent), v)) 905 }) 906 } 907 908 // ContentHTMLEQ applies the EQ predicate on the "content_html" field. 909 func ContentHTMLEQ(v string) predicate.Post { 910 return predicate.Post(func(s *sql.Selector) { 911 s.Where(sql.EQ(s.C(FieldContentHTML), v)) 912 }) 913 } 914 915 // ContentHTMLNEQ applies the NEQ predicate on the "content_html" field. 916 func ContentHTMLNEQ(v string) predicate.Post { 917 return predicate.Post(func(s *sql.Selector) { 918 s.Where(sql.NEQ(s.C(FieldContentHTML), v)) 919 }) 920 } 921 922 // ContentHTMLIn applies the In predicate on the "content_html" field. 923 func ContentHTMLIn(vs ...string) predicate.Post { 924 v := make([]interface{}, len(vs)) 925 for i := range v { 926 v[i] = vs[i] 927 } 928 return predicate.Post(func(s *sql.Selector) { 929 // if not arguments were provided, append the FALSE constants, 930 // since we can't apply "IN ()". This will make this predicate falsy. 931 if len(v) == 0 { 932 s.Where(sql.False()) 933 return 934 } 935 s.Where(sql.In(s.C(FieldContentHTML), v...)) 936 }) 937 } 938 939 // ContentHTMLNotIn applies the NotIn predicate on the "content_html" field. 940 func ContentHTMLNotIn(vs ...string) predicate.Post { 941 v := make([]interface{}, len(vs)) 942 for i := range v { 943 v[i] = vs[i] 944 } 945 return predicate.Post(func(s *sql.Selector) { 946 // if not arguments were provided, append the FALSE constants, 947 // since we can't apply "IN ()". This will make this predicate falsy. 948 if len(v) == 0 { 949 s.Where(sql.False()) 950 return 951 } 952 s.Where(sql.NotIn(s.C(FieldContentHTML), v...)) 953 }) 954 } 955 956 // ContentHTMLGT applies the GT predicate on the "content_html" field. 957 func ContentHTMLGT(v string) predicate.Post { 958 return predicate.Post(func(s *sql.Selector) { 959 s.Where(sql.GT(s.C(FieldContentHTML), v)) 960 }) 961 } 962 963 // ContentHTMLGTE applies the GTE predicate on the "content_html" field. 964 func ContentHTMLGTE(v string) predicate.Post { 965 return predicate.Post(func(s *sql.Selector) { 966 s.Where(sql.GTE(s.C(FieldContentHTML), v)) 967 }) 968 } 969 970 // ContentHTMLLT applies the LT predicate on the "content_html" field. 971 func ContentHTMLLT(v string) predicate.Post { 972 return predicate.Post(func(s *sql.Selector) { 973 s.Where(sql.LT(s.C(FieldContentHTML), v)) 974 }) 975 } 976 977 // ContentHTMLLTE applies the LTE predicate on the "content_html" field. 978 func ContentHTMLLTE(v string) predicate.Post { 979 return predicate.Post(func(s *sql.Selector) { 980 s.Where(sql.LTE(s.C(FieldContentHTML), v)) 981 }) 982 } 983 984 // ContentHTMLContains applies the Contains predicate on the "content_html" field. 985 func ContentHTMLContains(v string) predicate.Post { 986 return predicate.Post(func(s *sql.Selector) { 987 s.Where(sql.Contains(s.C(FieldContentHTML), v)) 988 }) 989 } 990 991 // ContentHTMLHasPrefix applies the HasPrefix predicate on the "content_html" field. 992 func ContentHTMLHasPrefix(v string) predicate.Post { 993 return predicate.Post(func(s *sql.Selector) { 994 s.Where(sql.HasPrefix(s.C(FieldContentHTML), v)) 995 }) 996 } 997 998 // ContentHTMLHasSuffix applies the HasSuffix predicate on the "content_html" field. 999 func ContentHTMLHasSuffix(v string) predicate.Post { 1000 return predicate.Post(func(s *sql.Selector) { 1001 s.Where(sql.HasSuffix(s.C(FieldContentHTML), v)) 1002 }) 1003 } 1004 1005 // ContentHTMLEqualFold applies the EqualFold predicate on the "content_html" field. 1006 func ContentHTMLEqualFold(v string) predicate.Post { 1007 return predicate.Post(func(s *sql.Selector) { 1008 s.Where(sql.EqualFold(s.C(FieldContentHTML), v)) 1009 }) 1010 } 1011 1012 // ContentHTMLContainsFold applies the ContainsFold predicate on the "content_html" field. 1013 func ContentHTMLContainsFold(v string) predicate.Post { 1014 return predicate.Post(func(s *sql.Selector) { 1015 s.Where(sql.ContainsFold(s.C(FieldContentHTML), v)) 1016 }) 1017 } 1018 1019 // ViewCountEQ applies the EQ predicate on the "view_count" field. 1020 func ViewCountEQ(v int64) predicate.Post { 1021 return predicate.Post(func(s *sql.Selector) { 1022 s.Where(sql.EQ(s.C(FieldViewCount), v)) 1023 }) 1024 } 1025 1026 // ViewCountNEQ applies the NEQ predicate on the "view_count" field. 1027 func ViewCountNEQ(v int64) predicate.Post { 1028 return predicate.Post(func(s *sql.Selector) { 1029 s.Where(sql.NEQ(s.C(FieldViewCount), v)) 1030 }) 1031 } 1032 1033 // ViewCountIn applies the In predicate on the "view_count" field. 1034 func ViewCountIn(vs ...int64) predicate.Post { 1035 v := make([]interface{}, len(vs)) 1036 for i := range v { 1037 v[i] = vs[i] 1038 } 1039 return predicate.Post(func(s *sql.Selector) { 1040 // if not arguments were provided, append the FALSE constants, 1041 // since we can't apply "IN ()". This will make this predicate falsy. 1042 if len(v) == 0 { 1043 s.Where(sql.False()) 1044 return 1045 } 1046 s.Where(sql.In(s.C(FieldViewCount), v...)) 1047 }) 1048 } 1049 1050 // ViewCountNotIn applies the NotIn predicate on the "view_count" field. 1051 func ViewCountNotIn(vs ...int64) predicate.Post { 1052 v := make([]interface{}, len(vs)) 1053 for i := range v { 1054 v[i] = vs[i] 1055 } 1056 return predicate.Post(func(s *sql.Selector) { 1057 // if not arguments were provided, append the FALSE constants, 1058 // since we can't apply "IN ()". This will make this predicate falsy. 1059 if len(v) == 0 { 1060 s.Where(sql.False()) 1061 return 1062 } 1063 s.Where(sql.NotIn(s.C(FieldViewCount), v...)) 1064 }) 1065 } 1066 1067 // ViewCountGT applies the GT predicate on the "view_count" field. 1068 func ViewCountGT(v int64) predicate.Post { 1069 return predicate.Post(func(s *sql.Selector) { 1070 s.Where(sql.GT(s.C(FieldViewCount), v)) 1071 }) 1072 } 1073 1074 // ViewCountGTE applies the GTE predicate on the "view_count" field. 1075 func ViewCountGTE(v int64) predicate.Post { 1076 return predicate.Post(func(s *sql.Selector) { 1077 s.Where(sql.GTE(s.C(FieldViewCount), v)) 1078 }) 1079 } 1080 1081 // ViewCountLT applies the LT predicate on the "view_count" field. 1082 func ViewCountLT(v int64) predicate.Post { 1083 return predicate.Post(func(s *sql.Selector) { 1084 s.Where(sql.LT(s.C(FieldViewCount), v)) 1085 }) 1086 } 1087 1088 // ViewCountLTE applies the LTE predicate on the "view_count" field. 1089 func ViewCountLTE(v int64) predicate.Post { 1090 return predicate.Post(func(s *sql.Selector) { 1091 s.Where(sql.LTE(s.C(FieldViewCount), v)) 1092 }) 1093 } 1094 1095 // CommentCountEQ applies the EQ predicate on the "comment_count" field. 1096 func CommentCountEQ(v int64) predicate.Post { 1097 return predicate.Post(func(s *sql.Selector) { 1098 s.Where(sql.EQ(s.C(FieldCommentCount), v)) 1099 }) 1100 } 1101 1102 // CommentCountNEQ applies the NEQ predicate on the "comment_count" field. 1103 func CommentCountNEQ(v int64) predicate.Post { 1104 return predicate.Post(func(s *sql.Selector) { 1105 s.Where(sql.NEQ(s.C(FieldCommentCount), v)) 1106 }) 1107 } 1108 1109 // CommentCountIn applies the In predicate on the "comment_count" field. 1110 func CommentCountIn(vs ...int64) predicate.Post { 1111 v := make([]interface{}, len(vs)) 1112 for i := range v { 1113 v[i] = vs[i] 1114 } 1115 return predicate.Post(func(s *sql.Selector) { 1116 // if not arguments were provided, append the FALSE constants, 1117 // since we can't apply "IN ()". This will make this predicate falsy. 1118 if len(v) == 0 { 1119 s.Where(sql.False()) 1120 return 1121 } 1122 s.Where(sql.In(s.C(FieldCommentCount), v...)) 1123 }) 1124 } 1125 1126 // CommentCountNotIn applies the NotIn predicate on the "comment_count" field. 1127 func CommentCountNotIn(vs ...int64) predicate.Post { 1128 v := make([]interface{}, len(vs)) 1129 for i := range v { 1130 v[i] = vs[i] 1131 } 1132 return predicate.Post(func(s *sql.Selector) { 1133 // if not arguments were provided, append the FALSE constants, 1134 // since we can't apply "IN ()". This will make this predicate falsy. 1135 if len(v) == 0 { 1136 s.Where(sql.False()) 1137 return 1138 } 1139 s.Where(sql.NotIn(s.C(FieldCommentCount), v...)) 1140 }) 1141 } 1142 1143 // CommentCountGT applies the GT predicate on the "comment_count" field. 1144 func CommentCountGT(v int64) predicate.Post { 1145 return predicate.Post(func(s *sql.Selector) { 1146 s.Where(sql.GT(s.C(FieldCommentCount), v)) 1147 }) 1148 } 1149 1150 // CommentCountGTE applies the GTE predicate on the "comment_count" field. 1151 func CommentCountGTE(v int64) predicate.Post { 1152 return predicate.Post(func(s *sql.Selector) { 1153 s.Where(sql.GTE(s.C(FieldCommentCount), v)) 1154 }) 1155 } 1156 1157 // CommentCountLT applies the LT predicate on the "comment_count" field. 1158 func CommentCountLT(v int64) predicate.Post { 1159 return predicate.Post(func(s *sql.Selector) { 1160 s.Where(sql.LT(s.C(FieldCommentCount), v)) 1161 }) 1162 } 1163 1164 // CommentCountLTE applies the LTE predicate on the "comment_count" field. 1165 func CommentCountLTE(v int64) predicate.Post { 1166 return predicate.Post(func(s *sql.Selector) { 1167 s.Where(sql.LTE(s.C(FieldCommentCount), v)) 1168 }) 1169 } 1170 1171 // RatingCountEQ applies the EQ predicate on the "rating_count" field. 1172 func RatingCountEQ(v int64) predicate.Post { 1173 return predicate.Post(func(s *sql.Selector) { 1174 s.Where(sql.EQ(s.C(FieldRatingCount), v)) 1175 }) 1176 } 1177 1178 // RatingCountNEQ applies the NEQ predicate on the "rating_count" field. 1179 func RatingCountNEQ(v int64) predicate.Post { 1180 return predicate.Post(func(s *sql.Selector) { 1181 s.Where(sql.NEQ(s.C(FieldRatingCount), v)) 1182 }) 1183 } 1184 1185 // RatingCountIn applies the In predicate on the "rating_count" field. 1186 func RatingCountIn(vs ...int64) predicate.Post { 1187 v := make([]interface{}, len(vs)) 1188 for i := range v { 1189 v[i] = vs[i] 1190 } 1191 return predicate.Post(func(s *sql.Selector) { 1192 // if not arguments were provided, append the FALSE constants, 1193 // since we can't apply "IN ()". This will make this predicate falsy. 1194 if len(v) == 0 { 1195 s.Where(sql.False()) 1196 return 1197 } 1198 s.Where(sql.In(s.C(FieldRatingCount), v...)) 1199 }) 1200 } 1201 1202 // RatingCountNotIn applies the NotIn predicate on the "rating_count" field. 1203 func RatingCountNotIn(vs ...int64) predicate.Post { 1204 v := make([]interface{}, len(vs)) 1205 for i := range v { 1206 v[i] = vs[i] 1207 } 1208 return predicate.Post(func(s *sql.Selector) { 1209 // if not arguments were provided, append the FALSE constants, 1210 // since we can't apply "IN ()". This will make this predicate falsy. 1211 if len(v) == 0 { 1212 s.Where(sql.False()) 1213 return 1214 } 1215 s.Where(sql.NotIn(s.C(FieldRatingCount), v...)) 1216 }) 1217 } 1218 1219 // RatingCountGT applies the GT predicate on the "rating_count" field. 1220 func RatingCountGT(v int64) predicate.Post { 1221 return predicate.Post(func(s *sql.Selector) { 1222 s.Where(sql.GT(s.C(FieldRatingCount), v)) 1223 }) 1224 } 1225 1226 // RatingCountGTE applies the GTE predicate on the "rating_count" field. 1227 func RatingCountGTE(v int64) predicate.Post { 1228 return predicate.Post(func(s *sql.Selector) { 1229 s.Where(sql.GTE(s.C(FieldRatingCount), v)) 1230 }) 1231 } 1232 1233 // RatingCountLT applies the LT predicate on the "rating_count" field. 1234 func RatingCountLT(v int64) predicate.Post { 1235 return predicate.Post(func(s *sql.Selector) { 1236 s.Where(sql.LT(s.C(FieldRatingCount), v)) 1237 }) 1238 } 1239 1240 // RatingCountLTE applies the LTE predicate on the "rating_count" field. 1241 func RatingCountLTE(v int64) predicate.Post { 1242 return predicate.Post(func(s *sql.Selector) { 1243 s.Where(sql.LTE(s.C(FieldRatingCount), v)) 1244 }) 1245 } 1246 1247 // RatingCountIsNil applies the IsNil predicate on the "rating_count" field. 1248 func RatingCountIsNil() predicate.Post { 1249 return predicate.Post(func(s *sql.Selector) { 1250 s.Where(sql.IsNull(s.C(FieldRatingCount))) 1251 }) 1252 } 1253 1254 // RatingCountNotNil applies the NotNil predicate on the "rating_count" field. 1255 func RatingCountNotNil() predicate.Post { 1256 return predicate.Post(func(s *sql.Selector) { 1257 s.Where(sql.NotNull(s.C(FieldRatingCount))) 1258 }) 1259 } 1260 1261 // RatingTotalEQ applies the EQ predicate on the "rating_total" field. 1262 func RatingTotalEQ(v int64) predicate.Post { 1263 return predicate.Post(func(s *sql.Selector) { 1264 s.Where(sql.EQ(s.C(FieldRatingTotal), v)) 1265 }) 1266 } 1267 1268 // RatingTotalNEQ applies the NEQ predicate on the "rating_total" field. 1269 func RatingTotalNEQ(v int64) predicate.Post { 1270 return predicate.Post(func(s *sql.Selector) { 1271 s.Where(sql.NEQ(s.C(FieldRatingTotal), v)) 1272 }) 1273 } 1274 1275 // RatingTotalIn applies the In predicate on the "rating_total" field. 1276 func RatingTotalIn(vs ...int64) predicate.Post { 1277 v := make([]interface{}, len(vs)) 1278 for i := range v { 1279 v[i] = vs[i] 1280 } 1281 return predicate.Post(func(s *sql.Selector) { 1282 // if not arguments were provided, append the FALSE constants, 1283 // since we can't apply "IN ()". This will make this predicate falsy. 1284 if len(v) == 0 { 1285 s.Where(sql.False()) 1286 return 1287 } 1288 s.Where(sql.In(s.C(FieldRatingTotal), v...)) 1289 }) 1290 } 1291 1292 // RatingTotalNotIn applies the NotIn predicate on the "rating_total" field. 1293 func RatingTotalNotIn(vs ...int64) predicate.Post { 1294 v := make([]interface{}, len(vs)) 1295 for i := range v { 1296 v[i] = vs[i] 1297 } 1298 return predicate.Post(func(s *sql.Selector) { 1299 // if not arguments were provided, append the FALSE constants, 1300 // since we can't apply "IN ()". This will make this predicate falsy. 1301 if len(v) == 0 { 1302 s.Where(sql.False()) 1303 return 1304 } 1305 s.Where(sql.NotIn(s.C(FieldRatingTotal), v...)) 1306 }) 1307 } 1308 1309 // RatingTotalGT applies the GT predicate on the "rating_total" field. 1310 func RatingTotalGT(v int64) predicate.Post { 1311 return predicate.Post(func(s *sql.Selector) { 1312 s.Where(sql.GT(s.C(FieldRatingTotal), v)) 1313 }) 1314 } 1315 1316 // RatingTotalGTE applies the GTE predicate on the "rating_total" field. 1317 func RatingTotalGTE(v int64) predicate.Post { 1318 return predicate.Post(func(s *sql.Selector) { 1319 s.Where(sql.GTE(s.C(FieldRatingTotal), v)) 1320 }) 1321 } 1322 1323 // RatingTotalLT applies the LT predicate on the "rating_total" field. 1324 func RatingTotalLT(v int64) predicate.Post { 1325 return predicate.Post(func(s *sql.Selector) { 1326 s.Where(sql.LT(s.C(FieldRatingTotal), v)) 1327 }) 1328 } 1329 1330 // RatingTotalLTE applies the LTE predicate on the "rating_total" field. 1331 func RatingTotalLTE(v int64) predicate.Post { 1332 return predicate.Post(func(s *sql.Selector) { 1333 s.Where(sql.LTE(s.C(FieldRatingTotal), v)) 1334 }) 1335 } 1336 1337 // RatingTotalIsNil applies the IsNil predicate on the "rating_total" field. 1338 func RatingTotalIsNil() predicate.Post { 1339 return predicate.Post(func(s *sql.Selector) { 1340 s.Where(sql.IsNull(s.C(FieldRatingTotal))) 1341 }) 1342 } 1343 1344 // RatingTotalNotNil applies the NotNil predicate on the "rating_total" field. 1345 func RatingTotalNotNil() predicate.Post { 1346 return predicate.Post(func(s *sql.Selector) { 1347 s.Where(sql.NotNull(s.C(FieldRatingTotal))) 1348 }) 1349 } 1350 1351 // DraftEQ applies the EQ predicate on the "draft" field. 1352 func DraftEQ(v bool) predicate.Post { 1353 return predicate.Post(func(s *sql.Selector) { 1354 s.Where(sql.EQ(s.C(FieldDraft), v)) 1355 }) 1356 } 1357 1358 // DraftNEQ applies the NEQ predicate on the "draft" field. 1359 func DraftNEQ(v bool) predicate.Post { 1360 return predicate.Post(func(s *sql.Selector) { 1361 s.Where(sql.NEQ(s.C(FieldDraft), v)) 1362 }) 1363 } 1364 1365 // DraftIsNil applies the IsNil predicate on the "draft" field. 1366 func DraftIsNil() predicate.Post { 1367 return predicate.Post(func(s *sql.Selector) { 1368 s.Where(sql.IsNull(s.C(FieldDraft))) 1369 }) 1370 } 1371 1372 // DraftNotNil applies the NotNil predicate on the "draft" field. 1373 func DraftNotNil() predicate.Post { 1374 return predicate.Post(func(s *sql.Selector) { 1375 s.Where(sql.NotNull(s.C(FieldDraft))) 1376 }) 1377 } 1378 1379 // ApprovedEQ applies the EQ predicate on the "approved" field. 1380 func ApprovedEQ(v bool) predicate.Post { 1381 return predicate.Post(func(s *sql.Selector) { 1382 s.Where(sql.EQ(s.C(FieldApproved), v)) 1383 }) 1384 } 1385 1386 // ApprovedNEQ applies the NEQ predicate on the "approved" field. 1387 func ApprovedNEQ(v bool) predicate.Post { 1388 return predicate.Post(func(s *sql.Selector) { 1389 s.Where(sql.NEQ(s.C(FieldApproved), v)) 1390 }) 1391 } 1392 1393 // ApprovedIsNil applies the IsNil predicate on the "approved" field. 1394 func ApprovedIsNil() predicate.Post { 1395 return predicate.Post(func(s *sql.Selector) { 1396 s.Where(sql.IsNull(s.C(FieldApproved))) 1397 }) 1398 } 1399 1400 // ApprovedNotNil applies the NotNil predicate on the "approved" field. 1401 func ApprovedNotNil() predicate.Post { 1402 return predicate.Post(func(s *sql.Selector) { 1403 s.Where(sql.NotNull(s.C(FieldApproved))) 1404 }) 1405 } 1406 1407 // FeaturedImageIDEQ applies the EQ predicate on the "featured_image_id" field. 1408 func FeaturedImageIDEQ(v int) predicate.Post { 1409 return predicate.Post(func(s *sql.Selector) { 1410 s.Where(sql.EQ(s.C(FieldFeaturedImageID), v)) 1411 }) 1412 } 1413 1414 // FeaturedImageIDNEQ applies the NEQ predicate on the "featured_image_id" field. 1415 func FeaturedImageIDNEQ(v int) predicate.Post { 1416 return predicate.Post(func(s *sql.Selector) { 1417 s.Where(sql.NEQ(s.C(FieldFeaturedImageID), v)) 1418 }) 1419 } 1420 1421 // FeaturedImageIDIn applies the In predicate on the "featured_image_id" field. 1422 func FeaturedImageIDIn(vs ...int) predicate.Post { 1423 v := make([]interface{}, len(vs)) 1424 for i := range v { 1425 v[i] = vs[i] 1426 } 1427 return predicate.Post(func(s *sql.Selector) { 1428 // if not arguments were provided, append the FALSE constants, 1429 // since we can't apply "IN ()". This will make this predicate falsy. 1430 if len(v) == 0 { 1431 s.Where(sql.False()) 1432 return 1433 } 1434 s.Where(sql.In(s.C(FieldFeaturedImageID), v...)) 1435 }) 1436 } 1437 1438 // FeaturedImageIDNotIn applies the NotIn predicate on the "featured_image_id" field. 1439 func FeaturedImageIDNotIn(vs ...int) predicate.Post { 1440 v := make([]interface{}, len(vs)) 1441 for i := range v { 1442 v[i] = vs[i] 1443 } 1444 return predicate.Post(func(s *sql.Selector) { 1445 // if not arguments were provided, append the FALSE constants, 1446 // since we can't apply "IN ()". This will make this predicate falsy. 1447 if len(v) == 0 { 1448 s.Where(sql.False()) 1449 return 1450 } 1451 s.Where(sql.NotIn(s.C(FieldFeaturedImageID), v...)) 1452 }) 1453 } 1454 1455 // FeaturedImageIDIsNil applies the IsNil predicate on the "featured_image_id" field. 1456 func FeaturedImageIDIsNil() predicate.Post { 1457 return predicate.Post(func(s *sql.Selector) { 1458 s.Where(sql.IsNull(s.C(FieldFeaturedImageID))) 1459 }) 1460 } 1461 1462 // FeaturedImageIDNotNil applies the NotNil predicate on the "featured_image_id" field. 1463 func FeaturedImageIDNotNil() predicate.Post { 1464 return predicate.Post(func(s *sql.Selector) { 1465 s.Where(sql.NotNull(s.C(FieldFeaturedImageID))) 1466 }) 1467 } 1468 1469 // UserIDEQ applies the EQ predicate on the "user_id" field. 1470 func UserIDEQ(v int) predicate.Post { 1471 return predicate.Post(func(s *sql.Selector) { 1472 s.Where(sql.EQ(s.C(FieldUserID), v)) 1473 }) 1474 } 1475 1476 // UserIDNEQ applies the NEQ predicate on the "user_id" field. 1477 func UserIDNEQ(v int) predicate.Post { 1478 return predicate.Post(func(s *sql.Selector) { 1479 s.Where(sql.NEQ(s.C(FieldUserID), v)) 1480 }) 1481 } 1482 1483 // UserIDIn applies the In predicate on the "user_id" field. 1484 func UserIDIn(vs ...int) predicate.Post { 1485 v := make([]interface{}, len(vs)) 1486 for i := range v { 1487 v[i] = vs[i] 1488 } 1489 return predicate.Post(func(s *sql.Selector) { 1490 // if not arguments were provided, append the FALSE constants, 1491 // since we can't apply "IN ()". This will make this predicate falsy. 1492 if len(v) == 0 { 1493 s.Where(sql.False()) 1494 return 1495 } 1496 s.Where(sql.In(s.C(FieldUserID), v...)) 1497 }) 1498 } 1499 1500 // UserIDNotIn applies the NotIn predicate on the "user_id" field. 1501 func UserIDNotIn(vs ...int) predicate.Post { 1502 v := make([]interface{}, len(vs)) 1503 for i := range v { 1504 v[i] = vs[i] 1505 } 1506 return predicate.Post(func(s *sql.Selector) { 1507 // if not arguments were provided, append the FALSE constants, 1508 // since we can't apply "IN ()". This will make this predicate falsy. 1509 if len(v) == 0 { 1510 s.Where(sql.False()) 1511 return 1512 } 1513 s.Where(sql.NotIn(s.C(FieldUserID), v...)) 1514 }) 1515 } 1516 1517 // UserIDIsNil applies the IsNil predicate on the "user_id" field. 1518 func UserIDIsNil() predicate.Post { 1519 return predicate.Post(func(s *sql.Selector) { 1520 s.Where(sql.IsNull(s.C(FieldUserID))) 1521 }) 1522 } 1523 1524 // UserIDNotNil applies the NotNil predicate on the "user_id" field. 1525 func UserIDNotNil() predicate.Post { 1526 return predicate.Post(func(s *sql.Selector) { 1527 s.Where(sql.NotNull(s.C(FieldUserID))) 1528 }) 1529 } 1530 1531 // HasUser applies the HasEdge predicate on the "user" edge. 1532 func HasUser() predicate.Post { 1533 return predicate.Post(func(s *sql.Selector) { 1534 step := sqlgraph.NewStep( 1535 sqlgraph.From(Table, FieldID), 1536 sqlgraph.To(UserTable, FieldID), 1537 sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn), 1538 ) 1539 sqlgraph.HasNeighbors(s, step) 1540 }) 1541 } 1542 1543 // HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates). 1544 func HasUserWith(preds ...predicate.User) predicate.Post { 1545 return predicate.Post(func(s *sql.Selector) { 1546 step := sqlgraph.NewStep( 1547 sqlgraph.From(Table, FieldID), 1548 sqlgraph.To(UserInverseTable, FieldID), 1549 sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn), 1550 ) 1551 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 1552 for _, p := range preds { 1553 p(s) 1554 } 1555 }) 1556 }) 1557 } 1558 1559 // HasTopics applies the HasEdge predicate on the "topics" edge. 1560 func HasTopics() predicate.Post { 1561 return predicate.Post(func(s *sql.Selector) { 1562 step := sqlgraph.NewStep( 1563 sqlgraph.From(Table, FieldID), 1564 sqlgraph.To(TopicsTable, FieldID), 1565 sqlgraph.Edge(sqlgraph.M2M, true, TopicsTable, TopicsPrimaryKey...), 1566 ) 1567 sqlgraph.HasNeighbors(s, step) 1568 }) 1569 } 1570 1571 // HasTopicsWith applies the HasEdge predicate on the "topics" edge with a given conditions (other predicates). 1572 func HasTopicsWith(preds ...predicate.Topic) predicate.Post { 1573 return predicate.Post(func(s *sql.Selector) { 1574 step := sqlgraph.NewStep( 1575 sqlgraph.From(Table, FieldID), 1576 sqlgraph.To(TopicsInverseTable, FieldID), 1577 sqlgraph.Edge(sqlgraph.M2M, true, TopicsTable, TopicsPrimaryKey...), 1578 ) 1579 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 1580 for _, p := range preds { 1581 p(s) 1582 } 1583 }) 1584 }) 1585 } 1586 1587 // HasFeaturedImage applies the HasEdge predicate on the "featured_image" edge. 1588 func HasFeaturedImage() predicate.Post { 1589 return predicate.Post(func(s *sql.Selector) { 1590 step := sqlgraph.NewStep( 1591 sqlgraph.From(Table, FieldID), 1592 sqlgraph.To(FeaturedImageTable, FieldID), 1593 sqlgraph.Edge(sqlgraph.M2O, true, FeaturedImageTable, FeaturedImageColumn), 1594 ) 1595 sqlgraph.HasNeighbors(s, step) 1596 }) 1597 } 1598 1599 // HasFeaturedImageWith applies the HasEdge predicate on the "featured_image" edge with a given conditions (other predicates). 1600 func HasFeaturedImageWith(preds ...predicate.File) predicate.Post { 1601 return predicate.Post(func(s *sql.Selector) { 1602 step := sqlgraph.NewStep( 1603 sqlgraph.From(Table, FieldID), 1604 sqlgraph.To(FeaturedImageInverseTable, FieldID), 1605 sqlgraph.Edge(sqlgraph.M2O, true, FeaturedImageTable, FeaturedImageColumn), 1606 ) 1607 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 1608 for _, p := range preds { 1609 p(s) 1610 } 1611 }) 1612 }) 1613 } 1614 1615 // HasComments applies the HasEdge predicate on the "comments" edge. 1616 func HasComments() predicate.Post { 1617 return predicate.Post(func(s *sql.Selector) { 1618 step := sqlgraph.NewStep( 1619 sqlgraph.From(Table, FieldID), 1620 sqlgraph.To(CommentsTable, FieldID), 1621 sqlgraph.Edge(sqlgraph.O2M, false, CommentsTable, CommentsColumn), 1622 ) 1623 sqlgraph.HasNeighbors(s, step) 1624 }) 1625 } 1626 1627 // HasCommentsWith applies the HasEdge predicate on the "comments" edge with a given conditions (other predicates). 1628 func HasCommentsWith(preds ...predicate.Comment) predicate.Post { 1629 return predicate.Post(func(s *sql.Selector) { 1630 step := sqlgraph.NewStep( 1631 sqlgraph.From(Table, FieldID), 1632 sqlgraph.To(CommentsInverseTable, FieldID), 1633 sqlgraph.Edge(sqlgraph.O2M, false, CommentsTable, CommentsColumn), 1634 ) 1635 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 1636 for _, p := range preds { 1637 p(s) 1638 } 1639 }) 1640 }) 1641 } 1642 1643 // And groups predicates with the AND operator between them. 1644 func And(predicates ...predicate.Post) predicate.Post { 1645 return predicate.Post(func(s *sql.Selector) { 1646 s1 := s.Clone().SetP(nil) 1647 for _, p := range predicates { 1648 p(s1) 1649 } 1650 s.Where(s1.P()) 1651 }) 1652 } 1653 1654 // Or groups predicates with the OR operator between them. 1655 func Or(predicates ...predicate.Post) predicate.Post { 1656 return predicate.Post(func(s *sql.Selector) { 1657 s1 := s.Clone().SetP(nil) 1658 for i, p := range predicates { 1659 if i > 0 { 1660 s1.Or() 1661 } 1662 p(s1) 1663 } 1664 s.Where(s1.P()) 1665 }) 1666 } 1667 1668 // Not applies the not operator on the given predicate. 1669 func Not(p predicate.Post) predicate.Post { 1670 return predicate.Post(func(s *sql.Selector) { 1671 p(s.Not()) 1672 }) 1673 }