/
where.go
2350 lines (2086 loc) · 72.7 KB
/
where.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
// This source code is licensed under the Apache 2.0 license found
// in the LICENSE file in the root directory of this source tree.
// Code generated by entc, DO NOT EDIT.
package fieldtype
import (
"github.com/facebookincubator/ent/dialect/sql"
"github.com/facebookincubator/ent/entc/integration/ent/predicate"
)
// ID filters vertices based on their identifier.
func ID(id int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldID), id))
})
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldID), id))
})
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldID), id))
})
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
}
s.Where(sql.In(s.C(FieldID), v...))
})
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
}
s.Where(sql.NotIn(s.C(FieldID), v...))
})
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldID), id))
})
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldID), id))
})
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldID), id))
})
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldID), id))
})
}
// Int applies equality check predicate on the "int" field. It's identical to IntEQ.
func Int(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt), v))
})
}
// Int8 applies equality check predicate on the "int8" field. It's identical to Int8EQ.
func Int8(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt8), v))
})
}
// Int16 applies equality check predicate on the "int16" field. It's identical to Int16EQ.
func Int16(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt16), v))
})
}
// Int32 applies equality check predicate on the "int32" field. It's identical to Int32EQ.
func Int32(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt32), v))
})
}
// Int64 applies equality check predicate on the "int64" field. It's identical to Int64EQ.
func Int64(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt64), v))
})
}
// OptionalInt applies equality check predicate on the "optional_int" field. It's identical to OptionalIntEQ.
func OptionalInt(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt), v))
})
}
// OptionalInt8 applies equality check predicate on the "optional_int8" field. It's identical to OptionalInt8EQ.
func OptionalInt8(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt8), v))
})
}
// OptionalInt16 applies equality check predicate on the "optional_int16" field. It's identical to OptionalInt16EQ.
func OptionalInt16(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt16), v))
})
}
// OptionalInt32 applies equality check predicate on the "optional_int32" field. It's identical to OptionalInt32EQ.
func OptionalInt32(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt32), v))
})
}
// OptionalInt64 applies equality check predicate on the "optional_int64" field. It's identical to OptionalInt64EQ.
func OptionalInt64(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt64), v))
})
}
// NillableInt applies equality check predicate on the "nillable_int" field. It's identical to NillableIntEQ.
func NillableInt(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldNillableInt), v))
})
}
// NillableInt8 applies equality check predicate on the "nillable_int8" field. It's identical to NillableInt8EQ.
func NillableInt8(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldNillableInt8), v))
})
}
// NillableInt16 applies equality check predicate on the "nillable_int16" field. It's identical to NillableInt16EQ.
func NillableInt16(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldNillableInt16), v))
})
}
// NillableInt32 applies equality check predicate on the "nillable_int32" field. It's identical to NillableInt32EQ.
func NillableInt32(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldNillableInt32), v))
})
}
// NillableInt64 applies equality check predicate on the "nillable_int64" field. It's identical to NillableInt64EQ.
func NillableInt64(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldNillableInt64), v))
})
}
// ValidateOptionalInt32 applies equality check predicate on the "validate_optional_int32" field. It's identical to ValidateOptionalInt32EQ.
func ValidateOptionalInt32(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldValidateOptionalInt32), v))
})
}
// OptionalUint applies equality check predicate on the "optional_uint" field. It's identical to OptionalUintEQ.
func OptionalUint(v uint) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalUint), v))
})
}
// OptionalUint8 applies equality check predicate on the "optional_uint8" field. It's identical to OptionalUint8EQ.
func OptionalUint8(v uint8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalUint8), v))
})
}
// OptionalUint16 applies equality check predicate on the "optional_uint16" field. It's identical to OptionalUint16EQ.
func OptionalUint16(v uint16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalUint16), v))
})
}
// OptionalUint32 applies equality check predicate on the "optional_uint32" field. It's identical to OptionalUint32EQ.
func OptionalUint32(v uint32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalUint32), v))
})
}
// OptionalUint64 applies equality check predicate on the "optional_uint64" field. It's identical to OptionalUint64EQ.
func OptionalUint64(v uint64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalUint64), v))
})
}
// OptionalFloat applies equality check predicate on the "optional_float" field. It's identical to OptionalFloatEQ.
func OptionalFloat(v float64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalFloat), v))
})
}
// OptionalFloat32 applies equality check predicate on the "optional_float32" field. It's identical to OptionalFloat32EQ.
func OptionalFloat32(v float32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalFloat32), v))
})
}
// IntEQ applies the EQ predicate on the "int" field.
func IntEQ(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt), v))
})
}
// IntNEQ applies the NEQ predicate on the "int" field.
func IntNEQ(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldInt), v))
})
}
// IntIn applies the In predicate on the "int" field.
func IntIn(vs ...int) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldInt), v...))
})
}
// IntNotIn applies the NotIn predicate on the "int" field.
func IntNotIn(vs ...int) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldInt), v...))
})
}
// IntGT applies the GT predicate on the "int" field.
func IntGT(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldInt), v))
})
}
// IntGTE applies the GTE predicate on the "int" field.
func IntGTE(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldInt), v))
})
}
// IntLT applies the LT predicate on the "int" field.
func IntLT(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldInt), v))
})
}
// IntLTE applies the LTE predicate on the "int" field.
func IntLTE(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldInt), v))
})
}
// Int8EQ applies the EQ predicate on the "int8" field.
func Int8EQ(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt8), v))
})
}
// Int8NEQ applies the NEQ predicate on the "int8" field.
func Int8NEQ(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldInt8), v))
})
}
// Int8In applies the In predicate on the "int8" field.
func Int8In(vs ...int8) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldInt8), v...))
})
}
// Int8NotIn applies the NotIn predicate on the "int8" field.
func Int8NotIn(vs ...int8) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldInt8), v...))
})
}
// Int8GT applies the GT predicate on the "int8" field.
func Int8GT(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldInt8), v))
})
}
// Int8GTE applies the GTE predicate on the "int8" field.
func Int8GTE(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldInt8), v))
})
}
// Int8LT applies the LT predicate on the "int8" field.
func Int8LT(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldInt8), v))
})
}
// Int8LTE applies the LTE predicate on the "int8" field.
func Int8LTE(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldInt8), v))
})
}
// Int16EQ applies the EQ predicate on the "int16" field.
func Int16EQ(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt16), v))
})
}
// Int16NEQ applies the NEQ predicate on the "int16" field.
func Int16NEQ(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldInt16), v))
})
}
// Int16In applies the In predicate on the "int16" field.
func Int16In(vs ...int16) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldInt16), v...))
})
}
// Int16NotIn applies the NotIn predicate on the "int16" field.
func Int16NotIn(vs ...int16) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldInt16), v...))
})
}
// Int16GT applies the GT predicate on the "int16" field.
func Int16GT(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldInt16), v))
})
}
// Int16GTE applies the GTE predicate on the "int16" field.
func Int16GTE(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldInt16), v))
})
}
// Int16LT applies the LT predicate on the "int16" field.
func Int16LT(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldInt16), v))
})
}
// Int16LTE applies the LTE predicate on the "int16" field.
func Int16LTE(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldInt16), v))
})
}
// Int32EQ applies the EQ predicate on the "int32" field.
func Int32EQ(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt32), v))
})
}
// Int32NEQ applies the NEQ predicate on the "int32" field.
func Int32NEQ(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldInt32), v))
})
}
// Int32In applies the In predicate on the "int32" field.
func Int32In(vs ...int32) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldInt32), v...))
})
}
// Int32NotIn applies the NotIn predicate on the "int32" field.
func Int32NotIn(vs ...int32) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldInt32), v...))
})
}
// Int32GT applies the GT predicate on the "int32" field.
func Int32GT(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldInt32), v))
})
}
// Int32GTE applies the GTE predicate on the "int32" field.
func Int32GTE(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldInt32), v))
})
}
// Int32LT applies the LT predicate on the "int32" field.
func Int32LT(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldInt32), v))
})
}
// Int32LTE applies the LTE predicate on the "int32" field.
func Int32LTE(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldInt32), v))
})
}
// Int64EQ applies the EQ predicate on the "int64" field.
func Int64EQ(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldInt64), v))
})
}
// Int64NEQ applies the NEQ predicate on the "int64" field.
func Int64NEQ(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldInt64), v))
})
}
// Int64In applies the In predicate on the "int64" field.
func Int64In(vs ...int64) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldInt64), v...))
})
}
// Int64NotIn applies the NotIn predicate on the "int64" field.
func Int64NotIn(vs ...int64) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldInt64), v...))
})
}
// Int64GT applies the GT predicate on the "int64" field.
func Int64GT(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldInt64), v))
})
}
// Int64GTE applies the GTE predicate on the "int64" field.
func Int64GTE(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldInt64), v))
})
}
// Int64LT applies the LT predicate on the "int64" field.
func Int64LT(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldInt64), v))
})
}
// Int64LTE applies the LTE predicate on the "int64" field.
func Int64LTE(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldInt64), v))
})
}
// OptionalIntEQ applies the EQ predicate on the "optional_int" field.
func OptionalIntEQ(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt), v))
})
}
// OptionalIntNEQ applies the NEQ predicate on the "optional_int" field.
func OptionalIntNEQ(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldOptionalInt), v))
})
}
// OptionalIntIn applies the In predicate on the "optional_int" field.
func OptionalIntIn(vs ...int) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldOptionalInt), v...))
})
}
// OptionalIntNotIn applies the NotIn predicate on the "optional_int" field.
func OptionalIntNotIn(vs ...int) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldOptionalInt), v...))
})
}
// OptionalIntGT applies the GT predicate on the "optional_int" field.
func OptionalIntGT(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldOptionalInt), v))
})
}
// OptionalIntGTE applies the GTE predicate on the "optional_int" field.
func OptionalIntGTE(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldOptionalInt), v))
})
}
// OptionalIntLT applies the LT predicate on the "optional_int" field.
func OptionalIntLT(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldOptionalInt), v))
})
}
// OptionalIntLTE applies the LTE predicate on the "optional_int" field.
func OptionalIntLTE(v int) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldOptionalInt), v))
})
}
// OptionalIntIsNil applies the IsNil predicate on the "optional_int" field.
func OptionalIntIsNil() predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldOptionalInt)))
})
}
// OptionalIntNotNil applies the NotNil predicate on the "optional_int" field.
func OptionalIntNotNil() predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldOptionalInt)))
})
}
// OptionalInt8EQ applies the EQ predicate on the "optional_int8" field.
func OptionalInt8EQ(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt8), v))
})
}
// OptionalInt8NEQ applies the NEQ predicate on the "optional_int8" field.
func OptionalInt8NEQ(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldOptionalInt8), v))
})
}
// OptionalInt8In applies the In predicate on the "optional_int8" field.
func OptionalInt8In(vs ...int8) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldOptionalInt8), v...))
})
}
// OptionalInt8NotIn applies the NotIn predicate on the "optional_int8" field.
func OptionalInt8NotIn(vs ...int8) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldOptionalInt8), v...))
})
}
// OptionalInt8GT applies the GT predicate on the "optional_int8" field.
func OptionalInt8GT(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldOptionalInt8), v))
})
}
// OptionalInt8GTE applies the GTE predicate on the "optional_int8" field.
func OptionalInt8GTE(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldOptionalInt8), v))
})
}
// OptionalInt8LT applies the LT predicate on the "optional_int8" field.
func OptionalInt8LT(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldOptionalInt8), v))
})
}
// OptionalInt8LTE applies the LTE predicate on the "optional_int8" field.
func OptionalInt8LTE(v int8) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldOptionalInt8), v))
})
}
// OptionalInt8IsNil applies the IsNil predicate on the "optional_int8" field.
func OptionalInt8IsNil() predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldOptionalInt8)))
})
}
// OptionalInt8NotNil applies the NotNil predicate on the "optional_int8" field.
func OptionalInt8NotNil() predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldOptionalInt8)))
})
}
// OptionalInt16EQ applies the EQ predicate on the "optional_int16" field.
func OptionalInt16EQ(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt16), v))
})
}
// OptionalInt16NEQ applies the NEQ predicate on the "optional_int16" field.
func OptionalInt16NEQ(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldOptionalInt16), v))
})
}
// OptionalInt16In applies the In predicate on the "optional_int16" field.
func OptionalInt16In(vs ...int16) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldOptionalInt16), v...))
})
}
// OptionalInt16NotIn applies the NotIn predicate on the "optional_int16" field.
func OptionalInt16NotIn(vs ...int16) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldOptionalInt16), v...))
})
}
// OptionalInt16GT applies the GT predicate on the "optional_int16" field.
func OptionalInt16GT(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldOptionalInt16), v))
})
}
// OptionalInt16GTE applies the GTE predicate on the "optional_int16" field.
func OptionalInt16GTE(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldOptionalInt16), v))
})
}
// OptionalInt16LT applies the LT predicate on the "optional_int16" field.
func OptionalInt16LT(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldOptionalInt16), v))
})
}
// OptionalInt16LTE applies the LTE predicate on the "optional_int16" field.
func OptionalInt16LTE(v int16) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldOptionalInt16), v))
})
}
// OptionalInt16IsNil applies the IsNil predicate on the "optional_int16" field.
func OptionalInt16IsNil() predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldOptionalInt16)))
})
}
// OptionalInt16NotNil applies the NotNil predicate on the "optional_int16" field.
func OptionalInt16NotNil() predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldOptionalInt16)))
})
}
// OptionalInt32EQ applies the EQ predicate on the "optional_int32" field.
func OptionalInt32EQ(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldOptionalInt32), v))
})
}
// OptionalInt32NEQ applies the NEQ predicate on the "optional_int32" field.
func OptionalInt32NEQ(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldOptionalInt32), v))
})
}
// OptionalInt32In applies the In predicate on the "optional_int32" field.
func OptionalInt32In(vs ...int32) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldOptionalInt32), v...))
})
}
// OptionalInt32NotIn applies the NotIn predicate on the "optional_int32" field.
func OptionalInt32NotIn(vs ...int32) predicate.FieldType {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.FieldType(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(vs) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldOptionalInt32), v...))
})
}
// OptionalInt32GT applies the GT predicate on the "optional_int32" field.
func OptionalInt32GT(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldOptionalInt32), v))
})
}
// OptionalInt32GTE applies the GTE predicate on the "optional_int32" field.
func OptionalInt32GTE(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldOptionalInt32), v))
})
}
// OptionalInt32LT applies the LT predicate on the "optional_int32" field.
func OptionalInt32LT(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldOptionalInt32), v))
})
}
// OptionalInt32LTE applies the LTE predicate on the "optional_int32" field.
func OptionalInt32LTE(v int32) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldOptionalInt32), v))
})
}
// OptionalInt32IsNil applies the IsNil predicate on the "optional_int32" field.
func OptionalInt32IsNil() predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldOptionalInt32)))
})
}
// OptionalInt32NotNil applies the NotNil predicate on the "optional_int32" field.
func OptionalInt32NotNil() predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldOptionalInt32)))
})
}
// OptionalInt64EQ applies the EQ predicate on the "optional_int64" field.
func OptionalInt64EQ(v int64) predicate.FieldType {
return predicate.FieldType(func(s *sql.Selector) {