github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/entrepository/ent/topic/where.go (about)

     1  // Code generated by entc, DO NOT EDIT.
     2  
     3  package topic
     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.Topic {
    15  	return predicate.Topic(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.Topic {
    22  	return predicate.Topic(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.Topic {
    29  	return predicate.Topic(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.Topic {
    36  	return predicate.Topic(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.Topic {
    53  	return predicate.Topic(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.Topic {
    70  	return predicate.Topic(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.Topic {
    77  	return predicate.Topic(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.Topic {
    84  	return predicate.Topic(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.Topic {
    91  	return predicate.Topic(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.Topic {
    98  	return predicate.Topic(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.Topic {
   105  	return predicate.Topic(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.Topic {
   112  	return predicate.Topic(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.Topic {
   119  	return predicate.Topic(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.Topic {
   126  	return predicate.Topic(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.Topic {
   133  	return predicate.Topic(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.Topic {
   140  	return predicate.Topic(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.Topic {
   147  	return predicate.Topic(func(s *sql.Selector) {
   148  		s.Where(sql.EQ(s.C(FieldContentHTML), 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.Topic {
   154  	return predicate.Topic(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.Topic {
   161  	return predicate.Topic(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.Topic {
   168  	return predicate.Topic(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.Topic {
   175  	v := make([]interface{}, len(vs))
   176  	for i := range v {
   177  		v[i] = vs[i]
   178  	}
   179  	return predicate.Topic(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.Topic {
   192  	v := make([]interface{}, len(vs))
   193  	for i := range v {
   194  		v[i] = vs[i]
   195  	}
   196  	return predicate.Topic(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.Topic {
   209  	return predicate.Topic(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.Topic {
   216  	return predicate.Topic(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.Topic {
   223  	return predicate.Topic(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.Topic {
   230  	return predicate.Topic(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.Topic {
   237  	return predicate.Topic(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.Topic {
   244  	return predicate.Topic(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.Topic {
   251  	v := make([]interface{}, len(vs))
   252  	for i := range v {
   253  		v[i] = vs[i]
   254  	}
   255  	return predicate.Topic(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.Topic {
   268  	v := make([]interface{}, len(vs))
   269  	for i := range v {
   270  		v[i] = vs[i]
   271  	}
   272  	return predicate.Topic(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.Topic {
   285  	return predicate.Topic(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.Topic {
   292  	return predicate.Topic(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.Topic {
   299  	return predicate.Topic(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.Topic {
   306  	return predicate.Topic(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.Topic {
   313  	return predicate.Topic(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.Topic {
   320  	return predicate.Topic(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.Topic {
   327  	v := make([]interface{}, len(vs))
   328  	for i := range v {
   329  		v[i] = vs[i]
   330  	}
   331  	return predicate.Topic(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.Topic {
   344  	v := make([]interface{}, len(vs))
   345  	for i := range v {
   346  		v[i] = vs[i]
   347  	}
   348  	return predicate.Topic(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.Topic {
   361  	return predicate.Topic(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.Topic {
   368  	return predicate.Topic(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.Topic {
   375  	return predicate.Topic(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.Topic {
   382  	return predicate.Topic(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.Topic {
   389  	return predicate.Topic(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.Topic {
   396  	return predicate.Topic(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.Topic {
   403  	return predicate.Topic(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.Topic {
   410  	return predicate.Topic(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.Topic {
   417  	v := make([]interface{}, len(vs))
   418  	for i := range v {
   419  		v[i] = vs[i]
   420  	}
   421  	return predicate.Topic(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.Topic {
   434  	v := make([]interface{}, len(vs))
   435  	for i := range v {
   436  		v[i] = vs[i]
   437  	}
   438  	return predicate.Topic(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.Topic {
   451  	return predicate.Topic(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.Topic {
   458  	return predicate.Topic(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.Topic {
   465  	return predicate.Topic(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.Topic {
   472  	return predicate.Topic(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.Topic {
   479  	return predicate.Topic(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.Topic {
   486  	return predicate.Topic(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.Topic {
   493  	return predicate.Topic(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.Topic {
   500  	return predicate.Topic(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.Topic {
   507  	return predicate.Topic(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.Topic {
   514  	return predicate.Topic(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.Topic {
   521  	return predicate.Topic(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.Topic {
   528  	v := make([]interface{}, len(vs))
   529  	for i := range v {
   530  		v[i] = vs[i]
   531  	}
   532  	return predicate.Topic(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.Topic {
   545  	v := make([]interface{}, len(vs))
   546  	for i := range v {
   547  		v[i] = vs[i]
   548  	}
   549  	return predicate.Topic(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.Topic {
   562  	return predicate.Topic(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.Topic {
   569  	return predicate.Topic(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.Topic {
   576  	return predicate.Topic(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.Topic {
   583  	return predicate.Topic(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.Topic {
   590  	return predicate.Topic(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.Topic {
   597  	return predicate.Topic(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.Topic {
   604  	return predicate.Topic(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.Topic {
   611  	return predicate.Topic(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.Topic {
   618  	return predicate.Topic(func(s *sql.Selector) {
   619  		s.Where(sql.ContainsFold(s.C(FieldSlug), v))
   620  	})
   621  }
   622  
   623  // DescriptionEQ applies the EQ predicate on the "description" field.
   624  func DescriptionEQ(v string) predicate.Topic {
   625  	return predicate.Topic(func(s *sql.Selector) {
   626  		s.Where(sql.EQ(s.C(FieldDescription), v))
   627  	})
   628  }
   629  
   630  // DescriptionNEQ applies the NEQ predicate on the "description" field.
   631  func DescriptionNEQ(v string) predicate.Topic {
   632  	return predicate.Topic(func(s *sql.Selector) {
   633  		s.Where(sql.NEQ(s.C(FieldDescription), v))
   634  	})
   635  }
   636  
   637  // DescriptionIn applies the In predicate on the "description" field.
   638  func DescriptionIn(vs ...string) predicate.Topic {
   639  	v := make([]interface{}, len(vs))
   640  	for i := range v {
   641  		v[i] = vs[i]
   642  	}
   643  	return predicate.Topic(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(FieldDescription), v...))
   651  	})
   652  }
   653  
   654  // DescriptionNotIn applies the NotIn predicate on the "description" field.
   655  func DescriptionNotIn(vs ...string) predicate.Topic {
   656  	v := make([]interface{}, len(vs))
   657  	for i := range v {
   658  		v[i] = vs[i]
   659  	}
   660  	return predicate.Topic(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(FieldDescription), v...))
   668  	})
   669  }
   670  
   671  // DescriptionGT applies the GT predicate on the "description" field.
   672  func DescriptionGT(v string) predicate.Topic {
   673  	return predicate.Topic(func(s *sql.Selector) {
   674  		s.Where(sql.GT(s.C(FieldDescription), v))
   675  	})
   676  }
   677  
   678  // DescriptionGTE applies the GTE predicate on the "description" field.
   679  func DescriptionGTE(v string) predicate.Topic {
   680  	return predicate.Topic(func(s *sql.Selector) {
   681  		s.Where(sql.GTE(s.C(FieldDescription), v))
   682  	})
   683  }
   684  
   685  // DescriptionLT applies the LT predicate on the "description" field.
   686  func DescriptionLT(v string) predicate.Topic {
   687  	return predicate.Topic(func(s *sql.Selector) {
   688  		s.Where(sql.LT(s.C(FieldDescription), v))
   689  	})
   690  }
   691  
   692  // DescriptionLTE applies the LTE predicate on the "description" field.
   693  func DescriptionLTE(v string) predicate.Topic {
   694  	return predicate.Topic(func(s *sql.Selector) {
   695  		s.Where(sql.LTE(s.C(FieldDescription), v))
   696  	})
   697  }
   698  
   699  // DescriptionContains applies the Contains predicate on the "description" field.
   700  func DescriptionContains(v string) predicate.Topic {
   701  	return predicate.Topic(func(s *sql.Selector) {
   702  		s.Where(sql.Contains(s.C(FieldDescription), v))
   703  	})
   704  }
   705  
   706  // DescriptionHasPrefix applies the HasPrefix predicate on the "description" field.
   707  func DescriptionHasPrefix(v string) predicate.Topic {
   708  	return predicate.Topic(func(s *sql.Selector) {
   709  		s.Where(sql.HasPrefix(s.C(FieldDescription), v))
   710  	})
   711  }
   712  
   713  // DescriptionHasSuffix applies the HasSuffix predicate on the "description" field.
   714  func DescriptionHasSuffix(v string) predicate.Topic {
   715  	return predicate.Topic(func(s *sql.Selector) {
   716  		s.Where(sql.HasSuffix(s.C(FieldDescription), v))
   717  	})
   718  }
   719  
   720  // DescriptionIsNil applies the IsNil predicate on the "description" field.
   721  func DescriptionIsNil() predicate.Topic {
   722  	return predicate.Topic(func(s *sql.Selector) {
   723  		s.Where(sql.IsNull(s.C(FieldDescription)))
   724  	})
   725  }
   726  
   727  // DescriptionNotNil applies the NotNil predicate on the "description" field.
   728  func DescriptionNotNil() predicate.Topic {
   729  	return predicate.Topic(func(s *sql.Selector) {
   730  		s.Where(sql.NotNull(s.C(FieldDescription)))
   731  	})
   732  }
   733  
   734  // DescriptionEqualFold applies the EqualFold predicate on the "description" field.
   735  func DescriptionEqualFold(v string) predicate.Topic {
   736  	return predicate.Topic(func(s *sql.Selector) {
   737  		s.Where(sql.EqualFold(s.C(FieldDescription), v))
   738  	})
   739  }
   740  
   741  // DescriptionContainsFold applies the ContainsFold predicate on the "description" field.
   742  func DescriptionContainsFold(v string) predicate.Topic {
   743  	return predicate.Topic(func(s *sql.Selector) {
   744  		s.Where(sql.ContainsFold(s.C(FieldDescription), v))
   745  	})
   746  }
   747  
   748  // ContentEQ applies the EQ predicate on the "content" field.
   749  func ContentEQ(v string) predicate.Topic {
   750  	return predicate.Topic(func(s *sql.Selector) {
   751  		s.Where(sql.EQ(s.C(FieldContent), v))
   752  	})
   753  }
   754  
   755  // ContentNEQ applies the NEQ predicate on the "content" field.
   756  func ContentNEQ(v string) predicate.Topic {
   757  	return predicate.Topic(func(s *sql.Selector) {
   758  		s.Where(sql.NEQ(s.C(FieldContent), v))
   759  	})
   760  }
   761  
   762  // ContentIn applies the In predicate on the "content" field.
   763  func ContentIn(vs ...string) predicate.Topic {
   764  	v := make([]interface{}, len(vs))
   765  	for i := range v {
   766  		v[i] = vs[i]
   767  	}
   768  	return predicate.Topic(func(s *sql.Selector) {
   769  		// if not arguments were provided, append the FALSE constants,
   770  		// since we can't apply "IN ()". This will make this predicate falsy.
   771  		if len(v) == 0 {
   772  			s.Where(sql.False())
   773  			return
   774  		}
   775  		s.Where(sql.In(s.C(FieldContent), v...))
   776  	})
   777  }
   778  
   779  // ContentNotIn applies the NotIn predicate on the "content" field.
   780  func ContentNotIn(vs ...string) predicate.Topic {
   781  	v := make([]interface{}, len(vs))
   782  	for i := range v {
   783  		v[i] = vs[i]
   784  	}
   785  	return predicate.Topic(func(s *sql.Selector) {
   786  		// if not arguments were provided, append the FALSE constants,
   787  		// since we can't apply "IN ()". This will make this predicate falsy.
   788  		if len(v) == 0 {
   789  			s.Where(sql.False())
   790  			return
   791  		}
   792  		s.Where(sql.NotIn(s.C(FieldContent), v...))
   793  	})
   794  }
   795  
   796  // ContentGT applies the GT predicate on the "content" field.
   797  func ContentGT(v string) predicate.Topic {
   798  	return predicate.Topic(func(s *sql.Selector) {
   799  		s.Where(sql.GT(s.C(FieldContent), v))
   800  	})
   801  }
   802  
   803  // ContentGTE applies the GTE predicate on the "content" field.
   804  func ContentGTE(v string) predicate.Topic {
   805  	return predicate.Topic(func(s *sql.Selector) {
   806  		s.Where(sql.GTE(s.C(FieldContent), v))
   807  	})
   808  }
   809  
   810  // ContentLT applies the LT predicate on the "content" field.
   811  func ContentLT(v string) predicate.Topic {
   812  	return predicate.Topic(func(s *sql.Selector) {
   813  		s.Where(sql.LT(s.C(FieldContent), v))
   814  	})
   815  }
   816  
   817  // ContentLTE applies the LTE predicate on the "content" field.
   818  func ContentLTE(v string) predicate.Topic {
   819  	return predicate.Topic(func(s *sql.Selector) {
   820  		s.Where(sql.LTE(s.C(FieldContent), v))
   821  	})
   822  }
   823  
   824  // ContentContains applies the Contains predicate on the "content" field.
   825  func ContentContains(v string) predicate.Topic {
   826  	return predicate.Topic(func(s *sql.Selector) {
   827  		s.Where(sql.Contains(s.C(FieldContent), v))
   828  	})
   829  }
   830  
   831  // ContentHasPrefix applies the HasPrefix predicate on the "content" field.
   832  func ContentHasPrefix(v string) predicate.Topic {
   833  	return predicate.Topic(func(s *sql.Selector) {
   834  		s.Where(sql.HasPrefix(s.C(FieldContent), v))
   835  	})
   836  }
   837  
   838  // ContentHasSuffix applies the HasSuffix predicate on the "content" field.
   839  func ContentHasSuffix(v string) predicate.Topic {
   840  	return predicate.Topic(func(s *sql.Selector) {
   841  		s.Where(sql.HasSuffix(s.C(FieldContent), v))
   842  	})
   843  }
   844  
   845  // ContentEqualFold applies the EqualFold predicate on the "content" field.
   846  func ContentEqualFold(v string) predicate.Topic {
   847  	return predicate.Topic(func(s *sql.Selector) {
   848  		s.Where(sql.EqualFold(s.C(FieldContent), v))
   849  	})
   850  }
   851  
   852  // ContentContainsFold applies the ContainsFold predicate on the "content" field.
   853  func ContentContainsFold(v string) predicate.Topic {
   854  	return predicate.Topic(func(s *sql.Selector) {
   855  		s.Where(sql.ContainsFold(s.C(FieldContent), v))
   856  	})
   857  }
   858  
   859  // ContentHTMLEQ applies the EQ predicate on the "content_html" field.
   860  func ContentHTMLEQ(v string) predicate.Topic {
   861  	return predicate.Topic(func(s *sql.Selector) {
   862  		s.Where(sql.EQ(s.C(FieldContentHTML), v))
   863  	})
   864  }
   865  
   866  // ContentHTMLNEQ applies the NEQ predicate on the "content_html" field.
   867  func ContentHTMLNEQ(v string) predicate.Topic {
   868  	return predicate.Topic(func(s *sql.Selector) {
   869  		s.Where(sql.NEQ(s.C(FieldContentHTML), v))
   870  	})
   871  }
   872  
   873  // ContentHTMLIn applies the In predicate on the "content_html" field.
   874  func ContentHTMLIn(vs ...string) predicate.Topic {
   875  	v := make([]interface{}, len(vs))
   876  	for i := range v {
   877  		v[i] = vs[i]
   878  	}
   879  	return predicate.Topic(func(s *sql.Selector) {
   880  		// if not arguments were provided, append the FALSE constants,
   881  		// since we can't apply "IN ()". This will make this predicate falsy.
   882  		if len(v) == 0 {
   883  			s.Where(sql.False())
   884  			return
   885  		}
   886  		s.Where(sql.In(s.C(FieldContentHTML), v...))
   887  	})
   888  }
   889  
   890  // ContentHTMLNotIn applies the NotIn predicate on the "content_html" field.
   891  func ContentHTMLNotIn(vs ...string) predicate.Topic {
   892  	v := make([]interface{}, len(vs))
   893  	for i := range v {
   894  		v[i] = vs[i]
   895  	}
   896  	return predicate.Topic(func(s *sql.Selector) {
   897  		// if not arguments were provided, append the FALSE constants,
   898  		// since we can't apply "IN ()". This will make this predicate falsy.
   899  		if len(v) == 0 {
   900  			s.Where(sql.False())
   901  			return
   902  		}
   903  		s.Where(sql.NotIn(s.C(FieldContentHTML), v...))
   904  	})
   905  }
   906  
   907  // ContentHTMLGT applies the GT predicate on the "content_html" field.
   908  func ContentHTMLGT(v string) predicate.Topic {
   909  	return predicate.Topic(func(s *sql.Selector) {
   910  		s.Where(sql.GT(s.C(FieldContentHTML), v))
   911  	})
   912  }
   913  
   914  // ContentHTMLGTE applies the GTE predicate on the "content_html" field.
   915  func ContentHTMLGTE(v string) predicate.Topic {
   916  	return predicate.Topic(func(s *sql.Selector) {
   917  		s.Where(sql.GTE(s.C(FieldContentHTML), v))
   918  	})
   919  }
   920  
   921  // ContentHTMLLT applies the LT predicate on the "content_html" field.
   922  func ContentHTMLLT(v string) predicate.Topic {
   923  	return predicate.Topic(func(s *sql.Selector) {
   924  		s.Where(sql.LT(s.C(FieldContentHTML), v))
   925  	})
   926  }
   927  
   928  // ContentHTMLLTE applies the LTE predicate on the "content_html" field.
   929  func ContentHTMLLTE(v string) predicate.Topic {
   930  	return predicate.Topic(func(s *sql.Selector) {
   931  		s.Where(sql.LTE(s.C(FieldContentHTML), v))
   932  	})
   933  }
   934  
   935  // ContentHTMLContains applies the Contains predicate on the "content_html" field.
   936  func ContentHTMLContains(v string) predicate.Topic {
   937  	return predicate.Topic(func(s *sql.Selector) {
   938  		s.Where(sql.Contains(s.C(FieldContentHTML), v))
   939  	})
   940  }
   941  
   942  // ContentHTMLHasPrefix applies the HasPrefix predicate on the "content_html" field.
   943  func ContentHTMLHasPrefix(v string) predicate.Topic {
   944  	return predicate.Topic(func(s *sql.Selector) {
   945  		s.Where(sql.HasPrefix(s.C(FieldContentHTML), v))
   946  	})
   947  }
   948  
   949  // ContentHTMLHasSuffix applies the HasSuffix predicate on the "content_html" field.
   950  func ContentHTMLHasSuffix(v string) predicate.Topic {
   951  	return predicate.Topic(func(s *sql.Selector) {
   952  		s.Where(sql.HasSuffix(s.C(FieldContentHTML), v))
   953  	})
   954  }
   955  
   956  // ContentHTMLEqualFold applies the EqualFold predicate on the "content_html" field.
   957  func ContentHTMLEqualFold(v string) predicate.Topic {
   958  	return predicate.Topic(func(s *sql.Selector) {
   959  		s.Where(sql.EqualFold(s.C(FieldContentHTML), v))
   960  	})
   961  }
   962  
   963  // ContentHTMLContainsFold applies the ContainsFold predicate on the "content_html" field.
   964  func ContentHTMLContainsFold(v string) predicate.Topic {
   965  	return predicate.Topic(func(s *sql.Selector) {
   966  		s.Where(sql.ContainsFold(s.C(FieldContentHTML), v))
   967  	})
   968  }
   969  
   970  // ParentIDEQ applies the EQ predicate on the "parent_id" field.
   971  func ParentIDEQ(v int) predicate.Topic {
   972  	return predicate.Topic(func(s *sql.Selector) {
   973  		s.Where(sql.EQ(s.C(FieldParentID), v))
   974  	})
   975  }
   976  
   977  // ParentIDNEQ applies the NEQ predicate on the "parent_id" field.
   978  func ParentIDNEQ(v int) predicate.Topic {
   979  	return predicate.Topic(func(s *sql.Selector) {
   980  		s.Where(sql.NEQ(s.C(FieldParentID), v))
   981  	})
   982  }
   983  
   984  // ParentIDIn applies the In predicate on the "parent_id" field.
   985  func ParentIDIn(vs ...int) predicate.Topic {
   986  	v := make([]interface{}, len(vs))
   987  	for i := range v {
   988  		v[i] = vs[i]
   989  	}
   990  	return predicate.Topic(func(s *sql.Selector) {
   991  		// if not arguments were provided, append the FALSE constants,
   992  		// since we can't apply "IN ()". This will make this predicate falsy.
   993  		if len(v) == 0 {
   994  			s.Where(sql.False())
   995  			return
   996  		}
   997  		s.Where(sql.In(s.C(FieldParentID), v...))
   998  	})
   999  }
  1000  
  1001  // ParentIDNotIn applies the NotIn predicate on the "parent_id" field.
  1002  func ParentIDNotIn(vs ...int) predicate.Topic {
  1003  	v := make([]interface{}, len(vs))
  1004  	for i := range v {
  1005  		v[i] = vs[i]
  1006  	}
  1007  	return predicate.Topic(func(s *sql.Selector) {
  1008  		// if not arguments were provided, append the FALSE constants,
  1009  		// since we can't apply "IN ()". This will make this predicate falsy.
  1010  		if len(v) == 0 {
  1011  			s.Where(sql.False())
  1012  			return
  1013  		}
  1014  		s.Where(sql.NotIn(s.C(FieldParentID), v...))
  1015  	})
  1016  }
  1017  
  1018  // ParentIDIsNil applies the IsNil predicate on the "parent_id" field.
  1019  func ParentIDIsNil() predicate.Topic {
  1020  	return predicate.Topic(func(s *sql.Selector) {
  1021  		s.Where(sql.IsNull(s.C(FieldParentID)))
  1022  	})
  1023  }
  1024  
  1025  // ParentIDNotNil applies the NotNil predicate on the "parent_id" field.
  1026  func ParentIDNotNil() predicate.Topic {
  1027  	return predicate.Topic(func(s *sql.Selector) {
  1028  		s.Where(sql.NotNull(s.C(FieldParentID)))
  1029  	})
  1030  }
  1031  
  1032  // HasPosts applies the HasEdge predicate on the "posts" edge.
  1033  func HasPosts() predicate.Topic {
  1034  	return predicate.Topic(func(s *sql.Selector) {
  1035  		step := sqlgraph.NewStep(
  1036  			sqlgraph.From(Table, FieldID),
  1037  			sqlgraph.To(PostsTable, FieldID),
  1038  			sqlgraph.Edge(sqlgraph.M2M, false, PostsTable, PostsPrimaryKey...),
  1039  		)
  1040  		sqlgraph.HasNeighbors(s, step)
  1041  	})
  1042  }
  1043  
  1044  // HasPostsWith applies the HasEdge predicate on the "posts" edge with a given conditions (other predicates).
  1045  func HasPostsWith(preds ...predicate.Post) predicate.Topic {
  1046  	return predicate.Topic(func(s *sql.Selector) {
  1047  		step := sqlgraph.NewStep(
  1048  			sqlgraph.From(Table, FieldID),
  1049  			sqlgraph.To(PostsInverseTable, FieldID),
  1050  			sqlgraph.Edge(sqlgraph.M2M, false, PostsTable, PostsPrimaryKey...),
  1051  		)
  1052  		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  1053  			for _, p := range preds {
  1054  				p(s)
  1055  			}
  1056  		})
  1057  	})
  1058  }
  1059  
  1060  // HasChildren applies the HasEdge predicate on the "children" edge.
  1061  func HasChildren() predicate.Topic {
  1062  	return predicate.Topic(func(s *sql.Selector) {
  1063  		step := sqlgraph.NewStep(
  1064  			sqlgraph.From(Table, FieldID),
  1065  			sqlgraph.To(ChildrenTable, FieldID),
  1066  			sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn),
  1067  		)
  1068  		sqlgraph.HasNeighbors(s, step)
  1069  	})
  1070  }
  1071  
  1072  // HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates).
  1073  func HasChildrenWith(preds ...predicate.Topic) predicate.Topic {
  1074  	return predicate.Topic(func(s *sql.Selector) {
  1075  		step := sqlgraph.NewStep(
  1076  			sqlgraph.From(Table, FieldID),
  1077  			sqlgraph.To(Table, FieldID),
  1078  			sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn),
  1079  		)
  1080  		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  1081  			for _, p := range preds {
  1082  				p(s)
  1083  			}
  1084  		})
  1085  	})
  1086  }
  1087  
  1088  // HasParent applies the HasEdge predicate on the "parent" edge.
  1089  func HasParent() predicate.Topic {
  1090  	return predicate.Topic(func(s *sql.Selector) {
  1091  		step := sqlgraph.NewStep(
  1092  			sqlgraph.From(Table, FieldID),
  1093  			sqlgraph.To(ParentTable, FieldID),
  1094  			sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn),
  1095  		)
  1096  		sqlgraph.HasNeighbors(s, step)
  1097  	})
  1098  }
  1099  
  1100  // HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates).
  1101  func HasParentWith(preds ...predicate.Topic) predicate.Topic {
  1102  	return predicate.Topic(func(s *sql.Selector) {
  1103  		step := sqlgraph.NewStep(
  1104  			sqlgraph.From(Table, FieldID),
  1105  			sqlgraph.To(Table, FieldID),
  1106  			sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn),
  1107  		)
  1108  		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  1109  			for _, p := range preds {
  1110  				p(s)
  1111  			}
  1112  		})
  1113  	})
  1114  }
  1115  
  1116  // And groups predicates with the AND operator between them.
  1117  func And(predicates ...predicate.Topic) predicate.Topic {
  1118  	return predicate.Topic(func(s *sql.Selector) {
  1119  		s1 := s.Clone().SetP(nil)
  1120  		for _, p := range predicates {
  1121  			p(s1)
  1122  		}
  1123  		s.Where(s1.P())
  1124  	})
  1125  }
  1126  
  1127  // Or groups predicates with the OR operator between them.
  1128  func Or(predicates ...predicate.Topic) predicate.Topic {
  1129  	return predicate.Topic(func(s *sql.Selector) {
  1130  		s1 := s.Clone().SetP(nil)
  1131  		for i, p := range predicates {
  1132  			if i > 0 {
  1133  				s1.Or()
  1134  			}
  1135  			p(s1)
  1136  		}
  1137  		s.Where(s1.P())
  1138  	})
  1139  }
  1140  
  1141  // Not applies the not operator on the given predicate.
  1142  func Not(p predicate.Topic) predicate.Topic {
  1143  	return predicate.Topic(func(s *sql.Selector) {
  1144  		p(s.Not())
  1145  	})
  1146  }