github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/entrepository/ent/page/where.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package page 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.Page { 15 return predicate.Page(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.Page { 22 return predicate.Page(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.Page { 29 return predicate.Page(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.Page { 36 return predicate.Page(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.Page { 53 return predicate.Page(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.Page { 70 return predicate.Page(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.Page { 77 return predicate.Page(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.Page { 84 return predicate.Page(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.Page { 91 return predicate.Page(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.Page { 98 return predicate.Page(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.Page { 105 return predicate.Page(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.Page { 112 return predicate.Page(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.Page { 119 return predicate.Page(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.Page { 126 return predicate.Page(func(s *sql.Selector) { 127 s.Where(sql.EQ(s.C(FieldSlug), v)) 128 }) 129 } 130 131 // Content applies equality check predicate on the "content" field. It's identical to ContentEQ. 132 func Content(v string) predicate.Page { 133 return predicate.Page(func(s *sql.Selector) { 134 s.Where(sql.EQ(s.C(FieldContent), v)) 135 }) 136 } 137 138 // ContentHTML applies equality check predicate on the "content_html" field. It's identical to ContentHTMLEQ. 139 func ContentHTML(v string) predicate.Page { 140 return predicate.Page(func(s *sql.Selector) { 141 s.Where(sql.EQ(s.C(FieldContentHTML), v)) 142 }) 143 } 144 145 // Draft applies equality check predicate on the "draft" field. It's identical to DraftEQ. 146 func Draft(v bool) predicate.Page { 147 return predicate.Page(func(s *sql.Selector) { 148 s.Where(sql.EQ(s.C(FieldDraft), v)) 149 }) 150 } 151 152 // FeaturedImageID applies equality check predicate on the "featured_image_id" field. It's identical to FeaturedImageIDEQ. 153 func FeaturedImageID(v int) predicate.Page { 154 return predicate.Page(func(s *sql.Selector) { 155 s.Where(sql.EQ(s.C(FieldFeaturedImageID), v)) 156 }) 157 } 158 159 // CreatedAtEQ applies the EQ predicate on the "created_at" field. 160 func CreatedAtEQ(v time.Time) predicate.Page { 161 return predicate.Page(func(s *sql.Selector) { 162 s.Where(sql.EQ(s.C(FieldCreatedAt), v)) 163 }) 164 } 165 166 // CreatedAtNEQ applies the NEQ predicate on the "created_at" field. 167 func CreatedAtNEQ(v time.Time) predicate.Page { 168 return predicate.Page(func(s *sql.Selector) { 169 s.Where(sql.NEQ(s.C(FieldCreatedAt), v)) 170 }) 171 } 172 173 // CreatedAtIn applies the In predicate on the "created_at" field. 174 func CreatedAtIn(vs ...time.Time) predicate.Page { 175 v := make([]interface{}, len(vs)) 176 for i := range v { 177 v[i] = vs[i] 178 } 179 return predicate.Page(func(s *sql.Selector) { 180 // if not arguments were provided, append the FALSE constants, 181 // since we can't apply "IN ()". This will make this predicate falsy. 182 if len(v) == 0 { 183 s.Where(sql.False()) 184 return 185 } 186 s.Where(sql.In(s.C(FieldCreatedAt), v...)) 187 }) 188 } 189 190 // CreatedAtNotIn applies the NotIn predicate on the "created_at" field. 191 func CreatedAtNotIn(vs ...time.Time) predicate.Page { 192 v := make([]interface{}, len(vs)) 193 for i := range v { 194 v[i] = vs[i] 195 } 196 return predicate.Page(func(s *sql.Selector) { 197 // if not arguments were provided, append the FALSE constants, 198 // since we can't apply "IN ()". This will make this predicate falsy. 199 if len(v) == 0 { 200 s.Where(sql.False()) 201 return 202 } 203 s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) 204 }) 205 } 206 207 // CreatedAtGT applies the GT predicate on the "created_at" field. 208 func CreatedAtGT(v time.Time) predicate.Page { 209 return predicate.Page(func(s *sql.Selector) { 210 s.Where(sql.GT(s.C(FieldCreatedAt), v)) 211 }) 212 } 213 214 // CreatedAtGTE applies the GTE predicate on the "created_at" field. 215 func CreatedAtGTE(v time.Time) predicate.Page { 216 return predicate.Page(func(s *sql.Selector) { 217 s.Where(sql.GTE(s.C(FieldCreatedAt), v)) 218 }) 219 } 220 221 // CreatedAtLT applies the LT predicate on the "created_at" field. 222 func CreatedAtLT(v time.Time) predicate.Page { 223 return predicate.Page(func(s *sql.Selector) { 224 s.Where(sql.LT(s.C(FieldCreatedAt), v)) 225 }) 226 } 227 228 // CreatedAtLTE applies the LTE predicate on the "created_at" field. 229 func CreatedAtLTE(v time.Time) predicate.Page { 230 return predicate.Page(func(s *sql.Selector) { 231 s.Where(sql.LTE(s.C(FieldCreatedAt), v)) 232 }) 233 } 234 235 // UpdatedAtEQ applies the EQ predicate on the "updated_at" field. 236 func UpdatedAtEQ(v time.Time) predicate.Page { 237 return predicate.Page(func(s *sql.Selector) { 238 s.Where(sql.EQ(s.C(FieldUpdatedAt), v)) 239 }) 240 } 241 242 // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. 243 func UpdatedAtNEQ(v time.Time) predicate.Page { 244 return predicate.Page(func(s *sql.Selector) { 245 s.Where(sql.NEQ(s.C(FieldUpdatedAt), v)) 246 }) 247 } 248 249 // UpdatedAtIn applies the In predicate on the "updated_at" field. 250 func UpdatedAtIn(vs ...time.Time) predicate.Page { 251 v := make([]interface{}, len(vs)) 252 for i := range v { 253 v[i] = vs[i] 254 } 255 return predicate.Page(func(s *sql.Selector) { 256 // if not arguments were provided, append the FALSE constants, 257 // since we can't apply "IN ()". This will make this predicate falsy. 258 if len(v) == 0 { 259 s.Where(sql.False()) 260 return 261 } 262 s.Where(sql.In(s.C(FieldUpdatedAt), v...)) 263 }) 264 } 265 266 // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. 267 func UpdatedAtNotIn(vs ...time.Time) predicate.Page { 268 v := make([]interface{}, len(vs)) 269 for i := range v { 270 v[i] = vs[i] 271 } 272 return predicate.Page(func(s *sql.Selector) { 273 // if not arguments were provided, append the FALSE constants, 274 // since we can't apply "IN ()". This will make this predicate falsy. 275 if len(v) == 0 { 276 s.Where(sql.False()) 277 return 278 } 279 s.Where(sql.NotIn(s.C(FieldUpdatedAt), v...)) 280 }) 281 } 282 283 // UpdatedAtGT applies the GT predicate on the "updated_at" field. 284 func UpdatedAtGT(v time.Time) predicate.Page { 285 return predicate.Page(func(s *sql.Selector) { 286 s.Where(sql.GT(s.C(FieldUpdatedAt), v)) 287 }) 288 } 289 290 // UpdatedAtGTE applies the GTE predicate on the "updated_at" field. 291 func UpdatedAtGTE(v time.Time) predicate.Page { 292 return predicate.Page(func(s *sql.Selector) { 293 s.Where(sql.GTE(s.C(FieldUpdatedAt), v)) 294 }) 295 } 296 297 // UpdatedAtLT applies the LT predicate on the "updated_at" field. 298 func UpdatedAtLT(v time.Time) predicate.Page { 299 return predicate.Page(func(s *sql.Selector) { 300 s.Where(sql.LT(s.C(FieldUpdatedAt), v)) 301 }) 302 } 303 304 // UpdatedAtLTE applies the LTE predicate on the "updated_at" field. 305 func UpdatedAtLTE(v time.Time) predicate.Page { 306 return predicate.Page(func(s *sql.Selector) { 307 s.Where(sql.LTE(s.C(FieldUpdatedAt), v)) 308 }) 309 } 310 311 // DeletedAtEQ applies the EQ predicate on the "deleted_at" field. 312 func DeletedAtEQ(v time.Time) predicate.Page { 313 return predicate.Page(func(s *sql.Selector) { 314 s.Where(sql.EQ(s.C(FieldDeletedAt), v)) 315 }) 316 } 317 318 // DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. 319 func DeletedAtNEQ(v time.Time) predicate.Page { 320 return predicate.Page(func(s *sql.Selector) { 321 s.Where(sql.NEQ(s.C(FieldDeletedAt), v)) 322 }) 323 } 324 325 // DeletedAtIn applies the In predicate on the "deleted_at" field. 326 func DeletedAtIn(vs ...time.Time) predicate.Page { 327 v := make([]interface{}, len(vs)) 328 for i := range v { 329 v[i] = vs[i] 330 } 331 return predicate.Page(func(s *sql.Selector) { 332 // if not arguments were provided, append the FALSE constants, 333 // since we can't apply "IN ()". This will make this predicate falsy. 334 if len(v) == 0 { 335 s.Where(sql.False()) 336 return 337 } 338 s.Where(sql.In(s.C(FieldDeletedAt), v...)) 339 }) 340 } 341 342 // DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. 343 func DeletedAtNotIn(vs ...time.Time) predicate.Page { 344 v := make([]interface{}, len(vs)) 345 for i := range v { 346 v[i] = vs[i] 347 } 348 return predicate.Page(func(s *sql.Selector) { 349 // if not arguments were provided, append the FALSE constants, 350 // since we can't apply "IN ()". This will make this predicate falsy. 351 if len(v) == 0 { 352 s.Where(sql.False()) 353 return 354 } 355 s.Where(sql.NotIn(s.C(FieldDeletedAt), v...)) 356 }) 357 } 358 359 // DeletedAtGT applies the GT predicate on the "deleted_at" field. 360 func DeletedAtGT(v time.Time) predicate.Page { 361 return predicate.Page(func(s *sql.Selector) { 362 s.Where(sql.GT(s.C(FieldDeletedAt), v)) 363 }) 364 } 365 366 // DeletedAtGTE applies the GTE predicate on the "deleted_at" field. 367 func DeletedAtGTE(v time.Time) predicate.Page { 368 return predicate.Page(func(s *sql.Selector) { 369 s.Where(sql.GTE(s.C(FieldDeletedAt), v)) 370 }) 371 } 372 373 // DeletedAtLT applies the LT predicate on the "deleted_at" field. 374 func DeletedAtLT(v time.Time) predicate.Page { 375 return predicate.Page(func(s *sql.Selector) { 376 s.Where(sql.LT(s.C(FieldDeletedAt), v)) 377 }) 378 } 379 380 // DeletedAtLTE applies the LTE predicate on the "deleted_at" field. 381 func DeletedAtLTE(v time.Time) predicate.Page { 382 return predicate.Page(func(s *sql.Selector) { 383 s.Where(sql.LTE(s.C(FieldDeletedAt), v)) 384 }) 385 } 386 387 // DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. 388 func DeletedAtIsNil() predicate.Page { 389 return predicate.Page(func(s *sql.Selector) { 390 s.Where(sql.IsNull(s.C(FieldDeletedAt))) 391 }) 392 } 393 394 // DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. 395 func DeletedAtNotNil() predicate.Page { 396 return predicate.Page(func(s *sql.Selector) { 397 s.Where(sql.NotNull(s.C(FieldDeletedAt))) 398 }) 399 } 400 401 // NameEQ applies the EQ predicate on the "name" field. 402 func NameEQ(v string) predicate.Page { 403 return predicate.Page(func(s *sql.Selector) { 404 s.Where(sql.EQ(s.C(FieldName), v)) 405 }) 406 } 407 408 // NameNEQ applies the NEQ predicate on the "name" field. 409 func NameNEQ(v string) predicate.Page { 410 return predicate.Page(func(s *sql.Selector) { 411 s.Where(sql.NEQ(s.C(FieldName), v)) 412 }) 413 } 414 415 // NameIn applies the In predicate on the "name" field. 416 func NameIn(vs ...string) predicate.Page { 417 v := make([]interface{}, len(vs)) 418 for i := range v { 419 v[i] = vs[i] 420 } 421 return predicate.Page(func(s *sql.Selector) { 422 // if not arguments were provided, append the FALSE constants, 423 // since we can't apply "IN ()". This will make this predicate falsy. 424 if len(v) == 0 { 425 s.Where(sql.False()) 426 return 427 } 428 s.Where(sql.In(s.C(FieldName), v...)) 429 }) 430 } 431 432 // NameNotIn applies the NotIn predicate on the "name" field. 433 func NameNotIn(vs ...string) predicate.Page { 434 v := make([]interface{}, len(vs)) 435 for i := range v { 436 v[i] = vs[i] 437 } 438 return predicate.Page(func(s *sql.Selector) { 439 // if not arguments were provided, append the FALSE constants, 440 // since we can't apply "IN ()". This will make this predicate falsy. 441 if len(v) == 0 { 442 s.Where(sql.False()) 443 return 444 } 445 s.Where(sql.NotIn(s.C(FieldName), v...)) 446 }) 447 } 448 449 // NameGT applies the GT predicate on the "name" field. 450 func NameGT(v string) predicate.Page { 451 return predicate.Page(func(s *sql.Selector) { 452 s.Where(sql.GT(s.C(FieldName), v)) 453 }) 454 } 455 456 // NameGTE applies the GTE predicate on the "name" field. 457 func NameGTE(v string) predicate.Page { 458 return predicate.Page(func(s *sql.Selector) { 459 s.Where(sql.GTE(s.C(FieldName), v)) 460 }) 461 } 462 463 // NameLT applies the LT predicate on the "name" field. 464 func NameLT(v string) predicate.Page { 465 return predicate.Page(func(s *sql.Selector) { 466 s.Where(sql.LT(s.C(FieldName), v)) 467 }) 468 } 469 470 // NameLTE applies the LTE predicate on the "name" field. 471 func NameLTE(v string) predicate.Page { 472 return predicate.Page(func(s *sql.Selector) { 473 s.Where(sql.LTE(s.C(FieldName), v)) 474 }) 475 } 476 477 // NameContains applies the Contains predicate on the "name" field. 478 func NameContains(v string) predicate.Page { 479 return predicate.Page(func(s *sql.Selector) { 480 s.Where(sql.Contains(s.C(FieldName), v)) 481 }) 482 } 483 484 // NameHasPrefix applies the HasPrefix predicate on the "name" field. 485 func NameHasPrefix(v string) predicate.Page { 486 return predicate.Page(func(s *sql.Selector) { 487 s.Where(sql.HasPrefix(s.C(FieldName), v)) 488 }) 489 } 490 491 // NameHasSuffix applies the HasSuffix predicate on the "name" field. 492 func NameHasSuffix(v string) predicate.Page { 493 return predicate.Page(func(s *sql.Selector) { 494 s.Where(sql.HasSuffix(s.C(FieldName), v)) 495 }) 496 } 497 498 // NameEqualFold applies the EqualFold predicate on the "name" field. 499 func NameEqualFold(v string) predicate.Page { 500 return predicate.Page(func(s *sql.Selector) { 501 s.Where(sql.EqualFold(s.C(FieldName), v)) 502 }) 503 } 504 505 // NameContainsFold applies the ContainsFold predicate on the "name" field. 506 func NameContainsFold(v string) predicate.Page { 507 return predicate.Page(func(s *sql.Selector) { 508 s.Where(sql.ContainsFold(s.C(FieldName), v)) 509 }) 510 } 511 512 // SlugEQ applies the EQ predicate on the "slug" field. 513 func SlugEQ(v string) predicate.Page { 514 return predicate.Page(func(s *sql.Selector) { 515 s.Where(sql.EQ(s.C(FieldSlug), v)) 516 }) 517 } 518 519 // SlugNEQ applies the NEQ predicate on the "slug" field. 520 func SlugNEQ(v string) predicate.Page { 521 return predicate.Page(func(s *sql.Selector) { 522 s.Where(sql.NEQ(s.C(FieldSlug), v)) 523 }) 524 } 525 526 // SlugIn applies the In predicate on the "slug" field. 527 func SlugIn(vs ...string) predicate.Page { 528 v := make([]interface{}, len(vs)) 529 for i := range v { 530 v[i] = vs[i] 531 } 532 return predicate.Page(func(s *sql.Selector) { 533 // if not arguments were provided, append the FALSE constants, 534 // since we can't apply "IN ()". This will make this predicate falsy. 535 if len(v) == 0 { 536 s.Where(sql.False()) 537 return 538 } 539 s.Where(sql.In(s.C(FieldSlug), v...)) 540 }) 541 } 542 543 // SlugNotIn applies the NotIn predicate on the "slug" field. 544 func SlugNotIn(vs ...string) predicate.Page { 545 v := make([]interface{}, len(vs)) 546 for i := range v { 547 v[i] = vs[i] 548 } 549 return predicate.Page(func(s *sql.Selector) { 550 // if not arguments were provided, append the FALSE constants, 551 // since we can't apply "IN ()". This will make this predicate falsy. 552 if len(v) == 0 { 553 s.Where(sql.False()) 554 return 555 } 556 s.Where(sql.NotIn(s.C(FieldSlug), v...)) 557 }) 558 } 559 560 // SlugGT applies the GT predicate on the "slug" field. 561 func SlugGT(v string) predicate.Page { 562 return predicate.Page(func(s *sql.Selector) { 563 s.Where(sql.GT(s.C(FieldSlug), v)) 564 }) 565 } 566 567 // SlugGTE applies the GTE predicate on the "slug" field. 568 func SlugGTE(v string) predicate.Page { 569 return predicate.Page(func(s *sql.Selector) { 570 s.Where(sql.GTE(s.C(FieldSlug), v)) 571 }) 572 } 573 574 // SlugLT applies the LT predicate on the "slug" field. 575 func SlugLT(v string) predicate.Page { 576 return predicate.Page(func(s *sql.Selector) { 577 s.Where(sql.LT(s.C(FieldSlug), v)) 578 }) 579 } 580 581 // SlugLTE applies the LTE predicate on the "slug" field. 582 func SlugLTE(v string) predicate.Page { 583 return predicate.Page(func(s *sql.Selector) { 584 s.Where(sql.LTE(s.C(FieldSlug), v)) 585 }) 586 } 587 588 // SlugContains applies the Contains predicate on the "slug" field. 589 func SlugContains(v string) predicate.Page { 590 return predicate.Page(func(s *sql.Selector) { 591 s.Where(sql.Contains(s.C(FieldSlug), v)) 592 }) 593 } 594 595 // SlugHasPrefix applies the HasPrefix predicate on the "slug" field. 596 func SlugHasPrefix(v string) predicate.Page { 597 return predicate.Page(func(s *sql.Selector) { 598 s.Where(sql.HasPrefix(s.C(FieldSlug), v)) 599 }) 600 } 601 602 // SlugHasSuffix applies the HasSuffix predicate on the "slug" field. 603 func SlugHasSuffix(v string) predicate.Page { 604 return predicate.Page(func(s *sql.Selector) { 605 s.Where(sql.HasSuffix(s.C(FieldSlug), v)) 606 }) 607 } 608 609 // SlugEqualFold applies the EqualFold predicate on the "slug" field. 610 func SlugEqualFold(v string) predicate.Page { 611 return predicate.Page(func(s *sql.Selector) { 612 s.Where(sql.EqualFold(s.C(FieldSlug), v)) 613 }) 614 } 615 616 // SlugContainsFold applies the ContainsFold predicate on the "slug" field. 617 func SlugContainsFold(v string) predicate.Page { 618 return predicate.Page(func(s *sql.Selector) { 619 s.Where(sql.ContainsFold(s.C(FieldSlug), v)) 620 }) 621 } 622 623 // ContentEQ applies the EQ predicate on the "content" field. 624 func ContentEQ(v string) predicate.Page { 625 return predicate.Page(func(s *sql.Selector) { 626 s.Where(sql.EQ(s.C(FieldContent), v)) 627 }) 628 } 629 630 // ContentNEQ applies the NEQ predicate on the "content" field. 631 func ContentNEQ(v string) predicate.Page { 632 return predicate.Page(func(s *sql.Selector) { 633 s.Where(sql.NEQ(s.C(FieldContent), v)) 634 }) 635 } 636 637 // ContentIn applies the In predicate on the "content" field. 638 func ContentIn(vs ...string) predicate.Page { 639 v := make([]interface{}, len(vs)) 640 for i := range v { 641 v[i] = vs[i] 642 } 643 return predicate.Page(func(s *sql.Selector) { 644 // if not arguments were provided, append the FALSE constants, 645 // since we can't apply "IN ()". This will make this predicate falsy. 646 if len(v) == 0 { 647 s.Where(sql.False()) 648 return 649 } 650 s.Where(sql.In(s.C(FieldContent), v...)) 651 }) 652 } 653 654 // ContentNotIn applies the NotIn predicate on the "content" field. 655 func ContentNotIn(vs ...string) predicate.Page { 656 v := make([]interface{}, len(vs)) 657 for i := range v { 658 v[i] = vs[i] 659 } 660 return predicate.Page(func(s *sql.Selector) { 661 // if not arguments were provided, append the FALSE constants, 662 // since we can't apply "IN ()". This will make this predicate falsy. 663 if len(v) == 0 { 664 s.Where(sql.False()) 665 return 666 } 667 s.Where(sql.NotIn(s.C(FieldContent), v...)) 668 }) 669 } 670 671 // ContentGT applies the GT predicate on the "content" field. 672 func ContentGT(v string) predicate.Page { 673 return predicate.Page(func(s *sql.Selector) { 674 s.Where(sql.GT(s.C(FieldContent), v)) 675 }) 676 } 677 678 // ContentGTE applies the GTE predicate on the "content" field. 679 func ContentGTE(v string) predicate.Page { 680 return predicate.Page(func(s *sql.Selector) { 681 s.Where(sql.GTE(s.C(FieldContent), v)) 682 }) 683 } 684 685 // ContentLT applies the LT predicate on the "content" field. 686 func ContentLT(v string) predicate.Page { 687 return predicate.Page(func(s *sql.Selector) { 688 s.Where(sql.LT(s.C(FieldContent), v)) 689 }) 690 } 691 692 // ContentLTE applies the LTE predicate on the "content" field. 693 func ContentLTE(v string) predicate.Page { 694 return predicate.Page(func(s *sql.Selector) { 695 s.Where(sql.LTE(s.C(FieldContent), v)) 696 }) 697 } 698 699 // ContentContains applies the Contains predicate on the "content" field. 700 func ContentContains(v string) predicate.Page { 701 return predicate.Page(func(s *sql.Selector) { 702 s.Where(sql.Contains(s.C(FieldContent), v)) 703 }) 704 } 705 706 // ContentHasPrefix applies the HasPrefix predicate on the "content" field. 707 func ContentHasPrefix(v string) predicate.Page { 708 return predicate.Page(func(s *sql.Selector) { 709 s.Where(sql.HasPrefix(s.C(FieldContent), v)) 710 }) 711 } 712 713 // ContentHasSuffix applies the HasSuffix predicate on the "content" field. 714 func ContentHasSuffix(v string) predicate.Page { 715 return predicate.Page(func(s *sql.Selector) { 716 s.Where(sql.HasSuffix(s.C(FieldContent), v)) 717 }) 718 } 719 720 // ContentEqualFold applies the EqualFold predicate on the "content" field. 721 func ContentEqualFold(v string) predicate.Page { 722 return predicate.Page(func(s *sql.Selector) { 723 s.Where(sql.EqualFold(s.C(FieldContent), v)) 724 }) 725 } 726 727 // ContentContainsFold applies the ContainsFold predicate on the "content" field. 728 func ContentContainsFold(v string) predicate.Page { 729 return predicate.Page(func(s *sql.Selector) { 730 s.Where(sql.ContainsFold(s.C(FieldContent), v)) 731 }) 732 } 733 734 // ContentHTMLEQ applies the EQ predicate on the "content_html" field. 735 func ContentHTMLEQ(v string) predicate.Page { 736 return predicate.Page(func(s *sql.Selector) { 737 s.Where(sql.EQ(s.C(FieldContentHTML), v)) 738 }) 739 } 740 741 // ContentHTMLNEQ applies the NEQ predicate on the "content_html" field. 742 func ContentHTMLNEQ(v string) predicate.Page { 743 return predicate.Page(func(s *sql.Selector) { 744 s.Where(sql.NEQ(s.C(FieldContentHTML), v)) 745 }) 746 } 747 748 // ContentHTMLIn applies the In predicate on the "content_html" field. 749 func ContentHTMLIn(vs ...string) predicate.Page { 750 v := make([]interface{}, len(vs)) 751 for i := range v { 752 v[i] = vs[i] 753 } 754 return predicate.Page(func(s *sql.Selector) { 755 // if not arguments were provided, append the FALSE constants, 756 // since we can't apply "IN ()". This will make this predicate falsy. 757 if len(v) == 0 { 758 s.Where(sql.False()) 759 return 760 } 761 s.Where(sql.In(s.C(FieldContentHTML), v...)) 762 }) 763 } 764 765 // ContentHTMLNotIn applies the NotIn predicate on the "content_html" field. 766 func ContentHTMLNotIn(vs ...string) predicate.Page { 767 v := make([]interface{}, len(vs)) 768 for i := range v { 769 v[i] = vs[i] 770 } 771 return predicate.Page(func(s *sql.Selector) { 772 // if not arguments were provided, append the FALSE constants, 773 // since we can't apply "IN ()". This will make this predicate falsy. 774 if len(v) == 0 { 775 s.Where(sql.False()) 776 return 777 } 778 s.Where(sql.NotIn(s.C(FieldContentHTML), v...)) 779 }) 780 } 781 782 // ContentHTMLGT applies the GT predicate on the "content_html" field. 783 func ContentHTMLGT(v string) predicate.Page { 784 return predicate.Page(func(s *sql.Selector) { 785 s.Where(sql.GT(s.C(FieldContentHTML), v)) 786 }) 787 } 788 789 // ContentHTMLGTE applies the GTE predicate on the "content_html" field. 790 func ContentHTMLGTE(v string) predicate.Page { 791 return predicate.Page(func(s *sql.Selector) { 792 s.Where(sql.GTE(s.C(FieldContentHTML), v)) 793 }) 794 } 795 796 // ContentHTMLLT applies the LT predicate on the "content_html" field. 797 func ContentHTMLLT(v string) predicate.Page { 798 return predicate.Page(func(s *sql.Selector) { 799 s.Where(sql.LT(s.C(FieldContentHTML), v)) 800 }) 801 } 802 803 // ContentHTMLLTE applies the LTE predicate on the "content_html" field. 804 func ContentHTMLLTE(v string) predicate.Page { 805 return predicate.Page(func(s *sql.Selector) { 806 s.Where(sql.LTE(s.C(FieldContentHTML), v)) 807 }) 808 } 809 810 // ContentHTMLContains applies the Contains predicate on the "content_html" field. 811 func ContentHTMLContains(v string) predicate.Page { 812 return predicate.Page(func(s *sql.Selector) { 813 s.Where(sql.Contains(s.C(FieldContentHTML), v)) 814 }) 815 } 816 817 // ContentHTMLHasPrefix applies the HasPrefix predicate on the "content_html" field. 818 func ContentHTMLHasPrefix(v string) predicate.Page { 819 return predicate.Page(func(s *sql.Selector) { 820 s.Where(sql.HasPrefix(s.C(FieldContentHTML), v)) 821 }) 822 } 823 824 // ContentHTMLHasSuffix applies the HasSuffix predicate on the "content_html" field. 825 func ContentHTMLHasSuffix(v string) predicate.Page { 826 return predicate.Page(func(s *sql.Selector) { 827 s.Where(sql.HasSuffix(s.C(FieldContentHTML), v)) 828 }) 829 } 830 831 // ContentHTMLEqualFold applies the EqualFold predicate on the "content_html" field. 832 func ContentHTMLEqualFold(v string) predicate.Page { 833 return predicate.Page(func(s *sql.Selector) { 834 s.Where(sql.EqualFold(s.C(FieldContentHTML), v)) 835 }) 836 } 837 838 // ContentHTMLContainsFold applies the ContainsFold predicate on the "content_html" field. 839 func ContentHTMLContainsFold(v string) predicate.Page { 840 return predicate.Page(func(s *sql.Selector) { 841 s.Where(sql.ContainsFold(s.C(FieldContentHTML), v)) 842 }) 843 } 844 845 // DraftEQ applies the EQ predicate on the "draft" field. 846 func DraftEQ(v bool) predicate.Page { 847 return predicate.Page(func(s *sql.Selector) { 848 s.Where(sql.EQ(s.C(FieldDraft), v)) 849 }) 850 } 851 852 // DraftNEQ applies the NEQ predicate on the "draft" field. 853 func DraftNEQ(v bool) predicate.Page { 854 return predicate.Page(func(s *sql.Selector) { 855 s.Where(sql.NEQ(s.C(FieldDraft), v)) 856 }) 857 } 858 859 // DraftIsNil applies the IsNil predicate on the "draft" field. 860 func DraftIsNil() predicate.Page { 861 return predicate.Page(func(s *sql.Selector) { 862 s.Where(sql.IsNull(s.C(FieldDraft))) 863 }) 864 } 865 866 // DraftNotNil applies the NotNil predicate on the "draft" field. 867 func DraftNotNil() predicate.Page { 868 return predicate.Page(func(s *sql.Selector) { 869 s.Where(sql.NotNull(s.C(FieldDraft))) 870 }) 871 } 872 873 // FeaturedImageIDEQ applies the EQ predicate on the "featured_image_id" field. 874 func FeaturedImageIDEQ(v int) predicate.Page { 875 return predicate.Page(func(s *sql.Selector) { 876 s.Where(sql.EQ(s.C(FieldFeaturedImageID), v)) 877 }) 878 } 879 880 // FeaturedImageIDNEQ applies the NEQ predicate on the "featured_image_id" field. 881 func FeaturedImageIDNEQ(v int) predicate.Page { 882 return predicate.Page(func(s *sql.Selector) { 883 s.Where(sql.NEQ(s.C(FieldFeaturedImageID), v)) 884 }) 885 } 886 887 // FeaturedImageIDIn applies the In predicate on the "featured_image_id" field. 888 func FeaturedImageIDIn(vs ...int) predicate.Page { 889 v := make([]interface{}, len(vs)) 890 for i := range v { 891 v[i] = vs[i] 892 } 893 return predicate.Page(func(s *sql.Selector) { 894 // if not arguments were provided, append the FALSE constants, 895 // since we can't apply "IN ()". This will make this predicate falsy. 896 if len(v) == 0 { 897 s.Where(sql.False()) 898 return 899 } 900 s.Where(sql.In(s.C(FieldFeaturedImageID), v...)) 901 }) 902 } 903 904 // FeaturedImageIDNotIn applies the NotIn predicate on the "featured_image_id" field. 905 func FeaturedImageIDNotIn(vs ...int) predicate.Page { 906 v := make([]interface{}, len(vs)) 907 for i := range v { 908 v[i] = vs[i] 909 } 910 return predicate.Page(func(s *sql.Selector) { 911 // if not arguments were provided, append the FALSE constants, 912 // since we can't apply "IN ()". This will make this predicate falsy. 913 if len(v) == 0 { 914 s.Where(sql.False()) 915 return 916 } 917 s.Where(sql.NotIn(s.C(FieldFeaturedImageID), v...)) 918 }) 919 } 920 921 // FeaturedImageIDIsNil applies the IsNil predicate on the "featured_image_id" field. 922 func FeaturedImageIDIsNil() predicate.Page { 923 return predicate.Page(func(s *sql.Selector) { 924 s.Where(sql.IsNull(s.C(FieldFeaturedImageID))) 925 }) 926 } 927 928 // FeaturedImageIDNotNil applies the NotNil predicate on the "featured_image_id" field. 929 func FeaturedImageIDNotNil() predicate.Page { 930 return predicate.Page(func(s *sql.Selector) { 931 s.Where(sql.NotNull(s.C(FieldFeaturedImageID))) 932 }) 933 } 934 935 // HasFeaturedImage applies the HasEdge predicate on the "featured_image" edge. 936 func HasFeaturedImage() predicate.Page { 937 return predicate.Page(func(s *sql.Selector) { 938 step := sqlgraph.NewStep( 939 sqlgraph.From(Table, FieldID), 940 sqlgraph.To(FeaturedImageTable, FieldID), 941 sqlgraph.Edge(sqlgraph.M2O, true, FeaturedImageTable, FeaturedImageColumn), 942 ) 943 sqlgraph.HasNeighbors(s, step) 944 }) 945 } 946 947 // HasFeaturedImageWith applies the HasEdge predicate on the "featured_image" edge with a given conditions (other predicates). 948 func HasFeaturedImageWith(preds ...predicate.File) predicate.Page { 949 return predicate.Page(func(s *sql.Selector) { 950 step := sqlgraph.NewStep( 951 sqlgraph.From(Table, FieldID), 952 sqlgraph.To(FeaturedImageInverseTable, FieldID), 953 sqlgraph.Edge(sqlgraph.M2O, true, FeaturedImageTable, FeaturedImageColumn), 954 ) 955 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 956 for _, p := range preds { 957 p(s) 958 } 959 }) 960 }) 961 } 962 963 // And groups predicates with the AND operator between them. 964 func And(predicates ...predicate.Page) predicate.Page { 965 return predicate.Page(func(s *sql.Selector) { 966 s1 := s.Clone().SetP(nil) 967 for _, p := range predicates { 968 p(s1) 969 } 970 s.Where(s1.P()) 971 }) 972 } 973 974 // Or groups predicates with the OR operator between them. 975 func Or(predicates ...predicate.Page) predicate.Page { 976 return predicate.Page(func(s *sql.Selector) { 977 s1 := s.Clone().SetP(nil) 978 for i, p := range predicates { 979 if i > 0 { 980 s1.Or() 981 } 982 p(s1) 983 } 984 s.Where(s1.P()) 985 }) 986 } 987 988 // Not applies the not operator on the given predicate. 989 func Not(p predicate.Page) predicate.Page { 990 return predicate.Page(func(s *sql.Selector) { 991 p(s.Not()) 992 }) 993 }