github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/entrepository/ent/comment/where.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package comment 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.Comment { 15 return predicate.Comment(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.Comment { 22 return predicate.Comment(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.Comment { 29 return predicate.Comment(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.Comment { 36 return predicate.Comment(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.Comment { 53 return predicate.Comment(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.Comment { 70 return predicate.Comment(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.Comment { 77 return predicate.Comment(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.Comment { 84 return predicate.Comment(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.Comment { 91 return predicate.Comment(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.Comment { 98 return predicate.Comment(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.Comment { 105 return predicate.Comment(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.Comment { 112 return predicate.Comment(func(s *sql.Selector) { 113 s.Where(sql.EQ(s.C(FieldDeletedAt), v)) 114 }) 115 } 116 117 // Content applies equality check predicate on the "content" field. It's identical to ContentEQ. 118 func Content(v string) predicate.Comment { 119 return predicate.Comment(func(s *sql.Selector) { 120 s.Where(sql.EQ(s.C(FieldContent), v)) 121 }) 122 } 123 124 // ContentHTML applies equality check predicate on the "content_html" field. It's identical to ContentHTMLEQ. 125 func ContentHTML(v string) predicate.Comment { 126 return predicate.Comment(func(s *sql.Selector) { 127 s.Where(sql.EQ(s.C(FieldContentHTML), v)) 128 }) 129 } 130 131 // Votes applies equality check predicate on the "votes" field. It's identical to VotesEQ. 132 func Votes(v int64) predicate.Comment { 133 return predicate.Comment(func(s *sql.Selector) { 134 s.Where(sql.EQ(s.C(FieldVotes), v)) 135 }) 136 } 137 138 // PostID applies equality check predicate on the "post_id" field. It's identical to PostIDEQ. 139 func PostID(v int) predicate.Comment { 140 return predicate.Comment(func(s *sql.Selector) { 141 s.Where(sql.EQ(s.C(FieldPostID), v)) 142 }) 143 } 144 145 // UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ. 146 func UserID(v int) predicate.Comment { 147 return predicate.Comment(func(s *sql.Selector) { 148 s.Where(sql.EQ(s.C(FieldUserID), v)) 149 }) 150 } 151 152 // ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ. 153 func ParentID(v int) predicate.Comment { 154 return predicate.Comment(func(s *sql.Selector) { 155 s.Where(sql.EQ(s.C(FieldParentID), v)) 156 }) 157 } 158 159 // CreatedAtEQ applies the EQ predicate on the "created_at" field. 160 func CreatedAtEQ(v time.Time) predicate.Comment { 161 return predicate.Comment(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.Comment { 168 return predicate.Comment(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.Comment { 175 v := make([]interface{}, len(vs)) 176 for i := range v { 177 v[i] = vs[i] 178 } 179 return predicate.Comment(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.Comment { 192 v := make([]interface{}, len(vs)) 193 for i := range v { 194 v[i] = vs[i] 195 } 196 return predicate.Comment(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.Comment { 209 return predicate.Comment(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.Comment { 216 return predicate.Comment(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.Comment { 223 return predicate.Comment(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.Comment { 230 return predicate.Comment(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.Comment { 237 return predicate.Comment(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.Comment { 244 return predicate.Comment(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.Comment { 251 v := make([]interface{}, len(vs)) 252 for i := range v { 253 v[i] = vs[i] 254 } 255 return predicate.Comment(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.Comment { 268 v := make([]interface{}, len(vs)) 269 for i := range v { 270 v[i] = vs[i] 271 } 272 return predicate.Comment(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.Comment { 285 return predicate.Comment(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.Comment { 292 return predicate.Comment(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.Comment { 299 return predicate.Comment(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.Comment { 306 return predicate.Comment(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.Comment { 313 return predicate.Comment(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.Comment { 320 return predicate.Comment(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.Comment { 327 v := make([]interface{}, len(vs)) 328 for i := range v { 329 v[i] = vs[i] 330 } 331 return predicate.Comment(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.Comment { 344 v := make([]interface{}, len(vs)) 345 for i := range v { 346 v[i] = vs[i] 347 } 348 return predicate.Comment(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.Comment { 361 return predicate.Comment(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.Comment { 368 return predicate.Comment(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.Comment { 375 return predicate.Comment(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.Comment { 382 return predicate.Comment(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.Comment { 389 return predicate.Comment(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.Comment { 396 return predicate.Comment(func(s *sql.Selector) { 397 s.Where(sql.NotNull(s.C(FieldDeletedAt))) 398 }) 399 } 400 401 // ContentEQ applies the EQ predicate on the "content" field. 402 func ContentEQ(v string) predicate.Comment { 403 return predicate.Comment(func(s *sql.Selector) { 404 s.Where(sql.EQ(s.C(FieldContent), v)) 405 }) 406 } 407 408 // ContentNEQ applies the NEQ predicate on the "content" field. 409 func ContentNEQ(v string) predicate.Comment { 410 return predicate.Comment(func(s *sql.Selector) { 411 s.Where(sql.NEQ(s.C(FieldContent), v)) 412 }) 413 } 414 415 // ContentIn applies the In predicate on the "content" field. 416 func ContentIn(vs ...string) predicate.Comment { 417 v := make([]interface{}, len(vs)) 418 for i := range v { 419 v[i] = vs[i] 420 } 421 return predicate.Comment(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(FieldContent), v...)) 429 }) 430 } 431 432 // ContentNotIn applies the NotIn predicate on the "content" field. 433 func ContentNotIn(vs ...string) predicate.Comment { 434 v := make([]interface{}, len(vs)) 435 for i := range v { 436 v[i] = vs[i] 437 } 438 return predicate.Comment(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(FieldContent), v...)) 446 }) 447 } 448 449 // ContentGT applies the GT predicate on the "content" field. 450 func ContentGT(v string) predicate.Comment { 451 return predicate.Comment(func(s *sql.Selector) { 452 s.Where(sql.GT(s.C(FieldContent), v)) 453 }) 454 } 455 456 // ContentGTE applies the GTE predicate on the "content" field. 457 func ContentGTE(v string) predicate.Comment { 458 return predicate.Comment(func(s *sql.Selector) { 459 s.Where(sql.GTE(s.C(FieldContent), v)) 460 }) 461 } 462 463 // ContentLT applies the LT predicate on the "content" field. 464 func ContentLT(v string) predicate.Comment { 465 return predicate.Comment(func(s *sql.Selector) { 466 s.Where(sql.LT(s.C(FieldContent), v)) 467 }) 468 } 469 470 // ContentLTE applies the LTE predicate on the "content" field. 471 func ContentLTE(v string) predicate.Comment { 472 return predicate.Comment(func(s *sql.Selector) { 473 s.Where(sql.LTE(s.C(FieldContent), v)) 474 }) 475 } 476 477 // ContentContains applies the Contains predicate on the "content" field. 478 func ContentContains(v string) predicate.Comment { 479 return predicate.Comment(func(s *sql.Selector) { 480 s.Where(sql.Contains(s.C(FieldContent), v)) 481 }) 482 } 483 484 // ContentHasPrefix applies the HasPrefix predicate on the "content" field. 485 func ContentHasPrefix(v string) predicate.Comment { 486 return predicate.Comment(func(s *sql.Selector) { 487 s.Where(sql.HasPrefix(s.C(FieldContent), v)) 488 }) 489 } 490 491 // ContentHasSuffix applies the HasSuffix predicate on the "content" field. 492 func ContentHasSuffix(v string) predicate.Comment { 493 return predicate.Comment(func(s *sql.Selector) { 494 s.Where(sql.HasSuffix(s.C(FieldContent), v)) 495 }) 496 } 497 498 // ContentEqualFold applies the EqualFold predicate on the "content" field. 499 func ContentEqualFold(v string) predicate.Comment { 500 return predicate.Comment(func(s *sql.Selector) { 501 s.Where(sql.EqualFold(s.C(FieldContent), v)) 502 }) 503 } 504 505 // ContentContainsFold applies the ContainsFold predicate on the "content" field. 506 func ContentContainsFold(v string) predicate.Comment { 507 return predicate.Comment(func(s *sql.Selector) { 508 s.Where(sql.ContainsFold(s.C(FieldContent), v)) 509 }) 510 } 511 512 // ContentHTMLEQ applies the EQ predicate on the "content_html" field. 513 func ContentHTMLEQ(v string) predicate.Comment { 514 return predicate.Comment(func(s *sql.Selector) { 515 s.Where(sql.EQ(s.C(FieldContentHTML), v)) 516 }) 517 } 518 519 // ContentHTMLNEQ applies the NEQ predicate on the "content_html" field. 520 func ContentHTMLNEQ(v string) predicate.Comment { 521 return predicate.Comment(func(s *sql.Selector) { 522 s.Where(sql.NEQ(s.C(FieldContentHTML), v)) 523 }) 524 } 525 526 // ContentHTMLIn applies the In predicate on the "content_html" field. 527 func ContentHTMLIn(vs ...string) predicate.Comment { 528 v := make([]interface{}, len(vs)) 529 for i := range v { 530 v[i] = vs[i] 531 } 532 return predicate.Comment(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(FieldContentHTML), v...)) 540 }) 541 } 542 543 // ContentHTMLNotIn applies the NotIn predicate on the "content_html" field. 544 func ContentHTMLNotIn(vs ...string) predicate.Comment { 545 v := make([]interface{}, len(vs)) 546 for i := range v { 547 v[i] = vs[i] 548 } 549 return predicate.Comment(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(FieldContentHTML), v...)) 557 }) 558 } 559 560 // ContentHTMLGT applies the GT predicate on the "content_html" field. 561 func ContentHTMLGT(v string) predicate.Comment { 562 return predicate.Comment(func(s *sql.Selector) { 563 s.Where(sql.GT(s.C(FieldContentHTML), v)) 564 }) 565 } 566 567 // ContentHTMLGTE applies the GTE predicate on the "content_html" field. 568 func ContentHTMLGTE(v string) predicate.Comment { 569 return predicate.Comment(func(s *sql.Selector) { 570 s.Where(sql.GTE(s.C(FieldContentHTML), v)) 571 }) 572 } 573 574 // ContentHTMLLT applies the LT predicate on the "content_html" field. 575 func ContentHTMLLT(v string) predicate.Comment { 576 return predicate.Comment(func(s *sql.Selector) { 577 s.Where(sql.LT(s.C(FieldContentHTML), v)) 578 }) 579 } 580 581 // ContentHTMLLTE applies the LTE predicate on the "content_html" field. 582 func ContentHTMLLTE(v string) predicate.Comment { 583 return predicate.Comment(func(s *sql.Selector) { 584 s.Where(sql.LTE(s.C(FieldContentHTML), v)) 585 }) 586 } 587 588 // ContentHTMLContains applies the Contains predicate on the "content_html" field. 589 func ContentHTMLContains(v string) predicate.Comment { 590 return predicate.Comment(func(s *sql.Selector) { 591 s.Where(sql.Contains(s.C(FieldContentHTML), v)) 592 }) 593 } 594 595 // ContentHTMLHasPrefix applies the HasPrefix predicate on the "content_html" field. 596 func ContentHTMLHasPrefix(v string) predicate.Comment { 597 return predicate.Comment(func(s *sql.Selector) { 598 s.Where(sql.HasPrefix(s.C(FieldContentHTML), v)) 599 }) 600 } 601 602 // ContentHTMLHasSuffix applies the HasSuffix predicate on the "content_html" field. 603 func ContentHTMLHasSuffix(v string) predicate.Comment { 604 return predicate.Comment(func(s *sql.Selector) { 605 s.Where(sql.HasSuffix(s.C(FieldContentHTML), v)) 606 }) 607 } 608 609 // ContentHTMLEqualFold applies the EqualFold predicate on the "content_html" field. 610 func ContentHTMLEqualFold(v string) predicate.Comment { 611 return predicate.Comment(func(s *sql.Selector) { 612 s.Where(sql.EqualFold(s.C(FieldContentHTML), v)) 613 }) 614 } 615 616 // ContentHTMLContainsFold applies the ContainsFold predicate on the "content_html" field. 617 func ContentHTMLContainsFold(v string) predicate.Comment { 618 return predicate.Comment(func(s *sql.Selector) { 619 s.Where(sql.ContainsFold(s.C(FieldContentHTML), v)) 620 }) 621 } 622 623 // VotesEQ applies the EQ predicate on the "votes" field. 624 func VotesEQ(v int64) predicate.Comment { 625 return predicate.Comment(func(s *sql.Selector) { 626 s.Where(sql.EQ(s.C(FieldVotes), v)) 627 }) 628 } 629 630 // VotesNEQ applies the NEQ predicate on the "votes" field. 631 func VotesNEQ(v int64) predicate.Comment { 632 return predicate.Comment(func(s *sql.Selector) { 633 s.Where(sql.NEQ(s.C(FieldVotes), v)) 634 }) 635 } 636 637 // VotesIn applies the In predicate on the "votes" field. 638 func VotesIn(vs ...int64) predicate.Comment { 639 v := make([]interface{}, len(vs)) 640 for i := range v { 641 v[i] = vs[i] 642 } 643 return predicate.Comment(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(FieldVotes), v...)) 651 }) 652 } 653 654 // VotesNotIn applies the NotIn predicate on the "votes" field. 655 func VotesNotIn(vs ...int64) predicate.Comment { 656 v := make([]interface{}, len(vs)) 657 for i := range v { 658 v[i] = vs[i] 659 } 660 return predicate.Comment(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(FieldVotes), v...)) 668 }) 669 } 670 671 // VotesGT applies the GT predicate on the "votes" field. 672 func VotesGT(v int64) predicate.Comment { 673 return predicate.Comment(func(s *sql.Selector) { 674 s.Where(sql.GT(s.C(FieldVotes), v)) 675 }) 676 } 677 678 // VotesGTE applies the GTE predicate on the "votes" field. 679 func VotesGTE(v int64) predicate.Comment { 680 return predicate.Comment(func(s *sql.Selector) { 681 s.Where(sql.GTE(s.C(FieldVotes), v)) 682 }) 683 } 684 685 // VotesLT applies the LT predicate on the "votes" field. 686 func VotesLT(v int64) predicate.Comment { 687 return predicate.Comment(func(s *sql.Selector) { 688 s.Where(sql.LT(s.C(FieldVotes), v)) 689 }) 690 } 691 692 // VotesLTE applies the LTE predicate on the "votes" field. 693 func VotesLTE(v int64) predicate.Comment { 694 return predicate.Comment(func(s *sql.Selector) { 695 s.Where(sql.LTE(s.C(FieldVotes), v)) 696 }) 697 } 698 699 // PostIDEQ applies the EQ predicate on the "post_id" field. 700 func PostIDEQ(v int) predicate.Comment { 701 return predicate.Comment(func(s *sql.Selector) { 702 s.Where(sql.EQ(s.C(FieldPostID), v)) 703 }) 704 } 705 706 // PostIDNEQ applies the NEQ predicate on the "post_id" field. 707 func PostIDNEQ(v int) predicate.Comment { 708 return predicate.Comment(func(s *sql.Selector) { 709 s.Where(sql.NEQ(s.C(FieldPostID), v)) 710 }) 711 } 712 713 // PostIDIn applies the In predicate on the "post_id" field. 714 func PostIDIn(vs ...int) predicate.Comment { 715 v := make([]interface{}, len(vs)) 716 for i := range v { 717 v[i] = vs[i] 718 } 719 return predicate.Comment(func(s *sql.Selector) { 720 // if not arguments were provided, append the FALSE constants, 721 // since we can't apply "IN ()". This will make this predicate falsy. 722 if len(v) == 0 { 723 s.Where(sql.False()) 724 return 725 } 726 s.Where(sql.In(s.C(FieldPostID), v...)) 727 }) 728 } 729 730 // PostIDNotIn applies the NotIn predicate on the "post_id" field. 731 func PostIDNotIn(vs ...int) predicate.Comment { 732 v := make([]interface{}, len(vs)) 733 for i := range v { 734 v[i] = vs[i] 735 } 736 return predicate.Comment(func(s *sql.Selector) { 737 // if not arguments were provided, append the FALSE constants, 738 // since we can't apply "IN ()". This will make this predicate falsy. 739 if len(v) == 0 { 740 s.Where(sql.False()) 741 return 742 } 743 s.Where(sql.NotIn(s.C(FieldPostID), v...)) 744 }) 745 } 746 747 // PostIDIsNil applies the IsNil predicate on the "post_id" field. 748 func PostIDIsNil() predicate.Comment { 749 return predicate.Comment(func(s *sql.Selector) { 750 s.Where(sql.IsNull(s.C(FieldPostID))) 751 }) 752 } 753 754 // PostIDNotNil applies the NotNil predicate on the "post_id" field. 755 func PostIDNotNil() predicate.Comment { 756 return predicate.Comment(func(s *sql.Selector) { 757 s.Where(sql.NotNull(s.C(FieldPostID))) 758 }) 759 } 760 761 // UserIDEQ applies the EQ predicate on the "user_id" field. 762 func UserIDEQ(v int) predicate.Comment { 763 return predicate.Comment(func(s *sql.Selector) { 764 s.Where(sql.EQ(s.C(FieldUserID), v)) 765 }) 766 } 767 768 // UserIDNEQ applies the NEQ predicate on the "user_id" field. 769 func UserIDNEQ(v int) predicate.Comment { 770 return predicate.Comment(func(s *sql.Selector) { 771 s.Where(sql.NEQ(s.C(FieldUserID), v)) 772 }) 773 } 774 775 // UserIDIn applies the In predicate on the "user_id" field. 776 func UserIDIn(vs ...int) predicate.Comment { 777 v := make([]interface{}, len(vs)) 778 for i := range v { 779 v[i] = vs[i] 780 } 781 return predicate.Comment(func(s *sql.Selector) { 782 // if not arguments were provided, append the FALSE constants, 783 // since we can't apply "IN ()". This will make this predicate falsy. 784 if len(v) == 0 { 785 s.Where(sql.False()) 786 return 787 } 788 s.Where(sql.In(s.C(FieldUserID), v...)) 789 }) 790 } 791 792 // UserIDNotIn applies the NotIn predicate on the "user_id" field. 793 func UserIDNotIn(vs ...int) predicate.Comment { 794 v := make([]interface{}, len(vs)) 795 for i := range v { 796 v[i] = vs[i] 797 } 798 return predicate.Comment(func(s *sql.Selector) { 799 // if not arguments were provided, append the FALSE constants, 800 // since we can't apply "IN ()". This will make this predicate falsy. 801 if len(v) == 0 { 802 s.Where(sql.False()) 803 return 804 } 805 s.Where(sql.NotIn(s.C(FieldUserID), v...)) 806 }) 807 } 808 809 // UserIDIsNil applies the IsNil predicate on the "user_id" field. 810 func UserIDIsNil() predicate.Comment { 811 return predicate.Comment(func(s *sql.Selector) { 812 s.Where(sql.IsNull(s.C(FieldUserID))) 813 }) 814 } 815 816 // UserIDNotNil applies the NotNil predicate on the "user_id" field. 817 func UserIDNotNil() predicate.Comment { 818 return predicate.Comment(func(s *sql.Selector) { 819 s.Where(sql.NotNull(s.C(FieldUserID))) 820 }) 821 } 822 823 // ParentIDEQ applies the EQ predicate on the "parent_id" field. 824 func ParentIDEQ(v int) predicate.Comment { 825 return predicate.Comment(func(s *sql.Selector) { 826 s.Where(sql.EQ(s.C(FieldParentID), v)) 827 }) 828 } 829 830 // ParentIDNEQ applies the NEQ predicate on the "parent_id" field. 831 func ParentIDNEQ(v int) predicate.Comment { 832 return predicate.Comment(func(s *sql.Selector) { 833 s.Where(sql.NEQ(s.C(FieldParentID), v)) 834 }) 835 } 836 837 // ParentIDIn applies the In predicate on the "parent_id" field. 838 func ParentIDIn(vs ...int) predicate.Comment { 839 v := make([]interface{}, len(vs)) 840 for i := range v { 841 v[i] = vs[i] 842 } 843 return predicate.Comment(func(s *sql.Selector) { 844 // if not arguments were provided, append the FALSE constants, 845 // since we can't apply "IN ()". This will make this predicate falsy. 846 if len(v) == 0 { 847 s.Where(sql.False()) 848 return 849 } 850 s.Where(sql.In(s.C(FieldParentID), v...)) 851 }) 852 } 853 854 // ParentIDNotIn applies the NotIn predicate on the "parent_id" field. 855 func ParentIDNotIn(vs ...int) predicate.Comment { 856 v := make([]interface{}, len(vs)) 857 for i := range v { 858 v[i] = vs[i] 859 } 860 return predicate.Comment(func(s *sql.Selector) { 861 // if not arguments were provided, append the FALSE constants, 862 // since we can't apply "IN ()". This will make this predicate falsy. 863 if len(v) == 0 { 864 s.Where(sql.False()) 865 return 866 } 867 s.Where(sql.NotIn(s.C(FieldParentID), v...)) 868 }) 869 } 870 871 // ParentIDIsNil applies the IsNil predicate on the "parent_id" field. 872 func ParentIDIsNil() predicate.Comment { 873 return predicate.Comment(func(s *sql.Selector) { 874 s.Where(sql.IsNull(s.C(FieldParentID))) 875 }) 876 } 877 878 // ParentIDNotNil applies the NotNil predicate on the "parent_id" field. 879 func ParentIDNotNil() predicate.Comment { 880 return predicate.Comment(func(s *sql.Selector) { 881 s.Where(sql.NotNull(s.C(FieldParentID))) 882 }) 883 } 884 885 // HasPost applies the HasEdge predicate on the "post" edge. 886 func HasPost() predicate.Comment { 887 return predicate.Comment(func(s *sql.Selector) { 888 step := sqlgraph.NewStep( 889 sqlgraph.From(Table, FieldID), 890 sqlgraph.To(PostTable, FieldID), 891 sqlgraph.Edge(sqlgraph.M2O, true, PostTable, PostColumn), 892 ) 893 sqlgraph.HasNeighbors(s, step) 894 }) 895 } 896 897 // HasPostWith applies the HasEdge predicate on the "post" edge with a given conditions (other predicates). 898 func HasPostWith(preds ...predicate.Post) predicate.Comment { 899 return predicate.Comment(func(s *sql.Selector) { 900 step := sqlgraph.NewStep( 901 sqlgraph.From(Table, FieldID), 902 sqlgraph.To(PostInverseTable, FieldID), 903 sqlgraph.Edge(sqlgraph.M2O, true, PostTable, PostColumn), 904 ) 905 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 906 for _, p := range preds { 907 p(s) 908 } 909 }) 910 }) 911 } 912 913 // HasUser applies the HasEdge predicate on the "user" edge. 914 func HasUser() predicate.Comment { 915 return predicate.Comment(func(s *sql.Selector) { 916 step := sqlgraph.NewStep( 917 sqlgraph.From(Table, FieldID), 918 sqlgraph.To(UserTable, FieldID), 919 sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn), 920 ) 921 sqlgraph.HasNeighbors(s, step) 922 }) 923 } 924 925 // HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates). 926 func HasUserWith(preds ...predicate.User) predicate.Comment { 927 return predicate.Comment(func(s *sql.Selector) { 928 step := sqlgraph.NewStep( 929 sqlgraph.From(Table, FieldID), 930 sqlgraph.To(UserInverseTable, FieldID), 931 sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn), 932 ) 933 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 934 for _, p := range preds { 935 p(s) 936 } 937 }) 938 }) 939 } 940 941 // HasChildren applies the HasEdge predicate on the "children" edge. 942 func HasChildren() predicate.Comment { 943 return predicate.Comment(func(s *sql.Selector) { 944 step := sqlgraph.NewStep( 945 sqlgraph.From(Table, FieldID), 946 sqlgraph.To(ChildrenTable, FieldID), 947 sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), 948 ) 949 sqlgraph.HasNeighbors(s, step) 950 }) 951 } 952 953 // HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). 954 func HasChildrenWith(preds ...predicate.Comment) predicate.Comment { 955 return predicate.Comment(func(s *sql.Selector) { 956 step := sqlgraph.NewStep( 957 sqlgraph.From(Table, FieldID), 958 sqlgraph.To(Table, FieldID), 959 sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), 960 ) 961 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 962 for _, p := range preds { 963 p(s) 964 } 965 }) 966 }) 967 } 968 969 // HasParent applies the HasEdge predicate on the "parent" edge. 970 func HasParent() predicate.Comment { 971 return predicate.Comment(func(s *sql.Selector) { 972 step := sqlgraph.NewStep( 973 sqlgraph.From(Table, FieldID), 974 sqlgraph.To(ParentTable, FieldID), 975 sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), 976 ) 977 sqlgraph.HasNeighbors(s, step) 978 }) 979 } 980 981 // HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). 982 func HasParentWith(preds ...predicate.Comment) predicate.Comment { 983 return predicate.Comment(func(s *sql.Selector) { 984 step := sqlgraph.NewStep( 985 sqlgraph.From(Table, FieldID), 986 sqlgraph.To(Table, FieldID), 987 sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), 988 ) 989 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 990 for _, p := range preds { 991 p(s) 992 } 993 }) 994 }) 995 } 996 997 // And groups predicates with the AND operator between them. 998 func And(predicates ...predicate.Comment) predicate.Comment { 999 return predicate.Comment(func(s *sql.Selector) { 1000 s1 := s.Clone().SetP(nil) 1001 for _, p := range predicates { 1002 p(s1) 1003 } 1004 s.Where(s1.P()) 1005 }) 1006 } 1007 1008 // Or groups predicates with the OR operator between them. 1009 func Or(predicates ...predicate.Comment) predicate.Comment { 1010 return predicate.Comment(func(s *sql.Selector) { 1011 s1 := s.Clone().SetP(nil) 1012 for i, p := range predicates { 1013 if i > 0 { 1014 s1.Or() 1015 } 1016 p(s1) 1017 } 1018 s.Where(s1.P()) 1019 }) 1020 } 1021 1022 // Not applies the not operator on the given predicate. 1023 func Not(p predicate.Comment) predicate.Comment { 1024 return predicate.Comment(func(s *sql.Selector) { 1025 p(s.Not()) 1026 }) 1027 }