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

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