-
Notifications
You must be signed in to change notification settings - Fork 41
/
entql.go
690 lines (598 loc) · 22.9 KB
/
entql.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
// Code generated by ent, DO NOT EDIT.
package ent
import (
"github.com/omni-network/omni/explorer/db/ent/block"
"github.com/omni-network/omni/explorer/db/ent/chain"
"github.com/omni-network/omni/explorer/db/ent/msg"
"github.com/omni-network/omni/explorer/db/ent/predicate"
"github.com/omni-network/omni/explorer/db/ent/receipt"
"github.com/omni-network/omni/explorer/db/ent/xprovidercursor"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/entql"
"entgo.io/ent/schema/field"
)
// schemaGraph holds a representation of ent/schema at runtime.
var schemaGraph = func() *sqlgraph.Schema {
graph := &sqlgraph.Schema{Nodes: make([]*sqlgraph.Node, 5)}
graph.Nodes[0] = &sqlgraph.Node{
NodeSpec: sqlgraph.NodeSpec{
Table: block.Table,
Columns: block.Columns,
ID: &sqlgraph.FieldSpec{
Type: field.TypeInt,
Column: block.FieldID,
},
},
Type: "Block",
Fields: map[string]*sqlgraph.FieldSpec{
block.FieldSourceChainID: {Type: field.TypeUint64, Column: block.FieldSourceChainID},
block.FieldBlockHeight: {Type: field.TypeUint64, Column: block.FieldBlockHeight},
block.FieldBlockHash: {Type: field.TypeBytes, Column: block.FieldBlockHash},
block.FieldTimestamp: {Type: field.TypeTime, Column: block.FieldTimestamp},
block.FieldCreatedAt: {Type: field.TypeTime, Column: block.FieldCreatedAt},
},
}
graph.Nodes[1] = &sqlgraph.Node{
NodeSpec: sqlgraph.NodeSpec{
Table: chain.Table,
Columns: chain.Columns,
ID: &sqlgraph.FieldSpec{
Type: field.TypeInt,
Column: chain.FieldID,
},
},
Type: "Chain",
Fields: map[string]*sqlgraph.FieldSpec{
chain.FieldUUID: {Type: field.TypeUUID, Column: chain.FieldUUID},
chain.FieldCreatedAt: {Type: field.TypeTime, Column: chain.FieldCreatedAt},
chain.FieldChainID: {Type: field.TypeUint64, Column: chain.FieldChainID},
chain.FieldName: {Type: field.TypeString, Column: chain.FieldName},
},
}
graph.Nodes[2] = &sqlgraph.Node{
NodeSpec: sqlgraph.NodeSpec{
Table: msg.Table,
Columns: msg.Columns,
ID: &sqlgraph.FieldSpec{
Type: field.TypeInt,
Column: msg.FieldID,
},
},
Type: "Msg",
Fields: map[string]*sqlgraph.FieldSpec{
msg.FieldUUID: {Type: field.TypeUUID, Column: msg.FieldUUID},
msg.FieldBlockID: {Type: field.TypeInt, Column: msg.FieldBlockID},
msg.FieldSourceMsgSender: {Type: field.TypeBytes, Column: msg.FieldSourceMsgSender},
msg.FieldDestAddress: {Type: field.TypeBytes, Column: msg.FieldDestAddress},
msg.FieldData: {Type: field.TypeBytes, Column: msg.FieldData},
msg.FieldDestGasLimit: {Type: field.TypeUint64, Column: msg.FieldDestGasLimit},
msg.FieldSourceChainID: {Type: field.TypeUint64, Column: msg.FieldSourceChainID},
msg.FieldDestChainID: {Type: field.TypeUint64, Column: msg.FieldDestChainID},
msg.FieldStreamOffset: {Type: field.TypeUint64, Column: msg.FieldStreamOffset},
msg.FieldTxHash: {Type: field.TypeBytes, Column: msg.FieldTxHash},
msg.FieldBlockHash: {Type: field.TypeBytes, Column: msg.FieldBlockHash},
msg.FieldBlockHeight: {Type: field.TypeUint64, Column: msg.FieldBlockHeight},
msg.FieldReceiptHash: {Type: field.TypeBytes, Column: msg.FieldReceiptHash},
msg.FieldStatus: {Type: field.TypeString, Column: msg.FieldStatus},
msg.FieldBlockTime: {Type: field.TypeTime, Column: msg.FieldBlockTime},
msg.FieldCreatedAt: {Type: field.TypeTime, Column: msg.FieldCreatedAt},
},
}
graph.Nodes[3] = &sqlgraph.Node{
NodeSpec: sqlgraph.NodeSpec{
Table: receipt.Table,
Columns: receipt.Columns,
ID: &sqlgraph.FieldSpec{
Type: field.TypeInt,
Column: receipt.FieldID,
},
},
Type: "Receipt",
Fields: map[string]*sqlgraph.FieldSpec{
receipt.FieldUUID: {Type: field.TypeUUID, Column: receipt.FieldUUID},
receipt.FieldBlockID: {Type: field.TypeInt, Column: receipt.FieldBlockID},
receipt.FieldGasUsed: {Type: field.TypeUint64, Column: receipt.FieldGasUsed},
receipt.FieldSuccess: {Type: field.TypeBool, Column: receipt.FieldSuccess},
receipt.FieldRelayerAddress: {Type: field.TypeBytes, Column: receipt.FieldRelayerAddress},
receipt.FieldSourceChainID: {Type: field.TypeUint64, Column: receipt.FieldSourceChainID},
receipt.FieldDestChainID: {Type: field.TypeUint64, Column: receipt.FieldDestChainID},
receipt.FieldStreamOffset: {Type: field.TypeUint64, Column: receipt.FieldStreamOffset},
receipt.FieldTxHash: {Type: field.TypeBytes, Column: receipt.FieldTxHash},
receipt.FieldCreatedAt: {Type: field.TypeTime, Column: receipt.FieldCreatedAt},
},
}
graph.Nodes[4] = &sqlgraph.Node{
NodeSpec: sqlgraph.NodeSpec{
Table: xprovidercursor.Table,
Columns: xprovidercursor.Columns,
ID: &sqlgraph.FieldSpec{
Type: field.TypeInt,
Column: xprovidercursor.FieldID,
},
},
Type: "XProviderCursor",
Fields: map[string]*sqlgraph.FieldSpec{
xprovidercursor.FieldUUID: {Type: field.TypeUUID, Column: xprovidercursor.FieldUUID},
xprovidercursor.FieldChainID: {Type: field.TypeUint64, Column: xprovidercursor.FieldChainID},
xprovidercursor.FieldHeight: {Type: field.TypeUint64, Column: xprovidercursor.FieldHeight},
xprovidercursor.FieldCreatedAt: {Type: field.TypeTime, Column: xprovidercursor.FieldCreatedAt},
xprovidercursor.FieldUpdatedAt: {Type: field.TypeTime, Column: xprovidercursor.FieldUpdatedAt},
},
}
graph.MustAddE(
"Msgs",
&sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: block.MsgsTable,
Columns: []string{block.MsgsColumn},
Bidi: false,
},
"Block",
"Msg",
)
graph.MustAddE(
"Receipts",
&sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: block.ReceiptsTable,
Columns: []string{block.ReceiptsColumn},
Bidi: false,
},
"Block",
"Receipt",
)
graph.MustAddE(
"Block",
&sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
Inverse: true,
Table: msg.BlockTable,
Columns: []string{msg.BlockColumn},
Bidi: false,
},
"Msg",
"Block",
)
graph.MustAddE(
"Receipts",
&sqlgraph.EdgeSpec{
Rel: sqlgraph.M2M,
Inverse: false,
Table: msg.ReceiptsTable,
Columns: msg.ReceiptsPrimaryKey,
Bidi: false,
},
"Msg",
"Receipt",
)
graph.MustAddE(
"Block",
&sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
Inverse: true,
Table: receipt.BlockTable,
Columns: []string{receipt.BlockColumn},
Bidi: false,
},
"Receipt",
"Block",
)
graph.MustAddE(
"Msgs",
&sqlgraph.EdgeSpec{
Rel: sqlgraph.M2M,
Inverse: true,
Table: receipt.MsgsTable,
Columns: receipt.MsgsPrimaryKey,
Bidi: false,
},
"Receipt",
"Msg",
)
return graph
}()
// predicateAdder wraps the addPredicate method.
// All update, update-one and query builders implement this interface.
type predicateAdder interface {
addPredicate(func(s *sql.Selector))
}
// addPredicate implements the predicateAdder interface.
func (bq *BlockQuery) addPredicate(pred func(s *sql.Selector)) {
bq.predicates = append(bq.predicates, pred)
}
// Filter returns a Filter implementation to apply filters on the BlockQuery builder.
func (bq *BlockQuery) Filter() *BlockFilter {
return &BlockFilter{config: bq.config, predicateAdder: bq}
}
// addPredicate implements the predicateAdder interface.
func (m *BlockMutation) addPredicate(pred func(s *sql.Selector)) {
m.predicates = append(m.predicates, pred)
}
// Filter returns an entql.Where implementation to apply filters on the BlockMutation builder.
func (m *BlockMutation) Filter() *BlockFilter {
return &BlockFilter{config: m.config, predicateAdder: m}
}
// BlockFilter provides a generic filtering capability at runtime for BlockQuery.
type BlockFilter struct {
predicateAdder
config
}
// Where applies the entql predicate on the query filter.
func (f *BlockFilter) Where(p entql.P) {
f.addPredicate(func(s *sql.Selector) {
if err := schemaGraph.EvalP(schemaGraph.Nodes[0].Type, p, s); err != nil {
s.AddError(err)
}
})
}
// WhereID applies the entql int predicate on the id field.
func (f *BlockFilter) WhereID(p entql.IntP) {
f.Where(p.Field(block.FieldID))
}
// WhereSourceChainID applies the entql uint64 predicate on the SourceChainID field.
func (f *BlockFilter) WhereSourceChainID(p entql.Uint64P) {
f.Where(p.Field(block.FieldSourceChainID))
}
// WhereBlockHeight applies the entql uint64 predicate on the BlockHeight field.
func (f *BlockFilter) WhereBlockHeight(p entql.Uint64P) {
f.Where(p.Field(block.FieldBlockHeight))
}
// WhereBlockHash applies the entql []byte predicate on the BlockHash field.
func (f *BlockFilter) WhereBlockHash(p entql.BytesP) {
f.Where(p.Field(block.FieldBlockHash))
}
// WhereTimestamp applies the entql time.Time predicate on the Timestamp field.
func (f *BlockFilter) WhereTimestamp(p entql.TimeP) {
f.Where(p.Field(block.FieldTimestamp))
}
// WhereCreatedAt applies the entql time.Time predicate on the CreatedAt field.
func (f *BlockFilter) WhereCreatedAt(p entql.TimeP) {
f.Where(p.Field(block.FieldCreatedAt))
}
// WhereHasMsgs applies a predicate to check if query has an edge Msgs.
func (f *BlockFilter) WhereHasMsgs() {
f.Where(entql.HasEdge("Msgs"))
}
// WhereHasMsgsWith applies a predicate to check if query has an edge Msgs with a given conditions (other predicates).
func (f *BlockFilter) WhereHasMsgsWith(preds ...predicate.Msg) {
f.Where(entql.HasEdgeWith("Msgs", sqlgraph.WrapFunc(func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})))
}
// WhereHasReceipts applies a predicate to check if query has an edge Receipts.
func (f *BlockFilter) WhereHasReceipts() {
f.Where(entql.HasEdge("Receipts"))
}
// WhereHasReceiptsWith applies a predicate to check if query has an edge Receipts with a given conditions (other predicates).
func (f *BlockFilter) WhereHasReceiptsWith(preds ...predicate.Receipt) {
f.Where(entql.HasEdgeWith("Receipts", sqlgraph.WrapFunc(func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})))
}
// addPredicate implements the predicateAdder interface.
func (cq *ChainQuery) addPredicate(pred func(s *sql.Selector)) {
cq.predicates = append(cq.predicates, pred)
}
// Filter returns a Filter implementation to apply filters on the ChainQuery builder.
func (cq *ChainQuery) Filter() *ChainFilter {
return &ChainFilter{config: cq.config, predicateAdder: cq}
}
// addPredicate implements the predicateAdder interface.
func (m *ChainMutation) addPredicate(pred func(s *sql.Selector)) {
m.predicates = append(m.predicates, pred)
}
// Filter returns an entql.Where implementation to apply filters on the ChainMutation builder.
func (m *ChainMutation) Filter() *ChainFilter {
return &ChainFilter{config: m.config, predicateAdder: m}
}
// ChainFilter provides a generic filtering capability at runtime for ChainQuery.
type ChainFilter struct {
predicateAdder
config
}
// Where applies the entql predicate on the query filter.
func (f *ChainFilter) Where(p entql.P) {
f.addPredicate(func(s *sql.Selector) {
if err := schemaGraph.EvalP(schemaGraph.Nodes[1].Type, p, s); err != nil {
s.AddError(err)
}
})
}
// WhereID applies the entql int predicate on the id field.
func (f *ChainFilter) WhereID(p entql.IntP) {
f.Where(p.Field(chain.FieldID))
}
// WhereUUID applies the entql [16]byte predicate on the UUID field.
func (f *ChainFilter) WhereUUID(p entql.ValueP) {
f.Where(p.Field(chain.FieldUUID))
}
// WhereCreatedAt applies the entql time.Time predicate on the CreatedAt field.
func (f *ChainFilter) WhereCreatedAt(p entql.TimeP) {
f.Where(p.Field(chain.FieldCreatedAt))
}
// WhereChainID applies the entql uint64 predicate on the ChainID field.
func (f *ChainFilter) WhereChainID(p entql.Uint64P) {
f.Where(p.Field(chain.FieldChainID))
}
// WhereName applies the entql string predicate on the Name field.
func (f *ChainFilter) WhereName(p entql.StringP) {
f.Where(p.Field(chain.FieldName))
}
// addPredicate implements the predicateAdder interface.
func (mq *MsgQuery) addPredicate(pred func(s *sql.Selector)) {
mq.predicates = append(mq.predicates, pred)
}
// Filter returns a Filter implementation to apply filters on the MsgQuery builder.
func (mq *MsgQuery) Filter() *MsgFilter {
return &MsgFilter{config: mq.config, predicateAdder: mq}
}
// addPredicate implements the predicateAdder interface.
func (m *MsgMutation) addPredicate(pred func(s *sql.Selector)) {
m.predicates = append(m.predicates, pred)
}
// Filter returns an entql.Where implementation to apply filters on the MsgMutation builder.
func (m *MsgMutation) Filter() *MsgFilter {
return &MsgFilter{config: m.config, predicateAdder: m}
}
// MsgFilter provides a generic filtering capability at runtime for MsgQuery.
type MsgFilter struct {
predicateAdder
config
}
// Where applies the entql predicate on the query filter.
func (f *MsgFilter) Where(p entql.P) {
f.addPredicate(func(s *sql.Selector) {
if err := schemaGraph.EvalP(schemaGraph.Nodes[2].Type, p, s); err != nil {
s.AddError(err)
}
})
}
// WhereID applies the entql int predicate on the id field.
func (f *MsgFilter) WhereID(p entql.IntP) {
f.Where(p.Field(msg.FieldID))
}
// WhereUUID applies the entql [16]byte predicate on the UUID field.
func (f *MsgFilter) WhereUUID(p entql.ValueP) {
f.Where(p.Field(msg.FieldUUID))
}
// WhereBlockID applies the entql int predicate on the Block_ID field.
func (f *MsgFilter) WhereBlockID(p entql.IntP) {
f.Where(p.Field(msg.FieldBlockID))
}
// WhereSourceMsgSender applies the entql []byte predicate on the SourceMsgSender field.
func (f *MsgFilter) WhereSourceMsgSender(p entql.BytesP) {
f.Where(p.Field(msg.FieldSourceMsgSender))
}
// WhereDestAddress applies the entql []byte predicate on the DestAddress field.
func (f *MsgFilter) WhereDestAddress(p entql.BytesP) {
f.Where(p.Field(msg.FieldDestAddress))
}
// WhereData applies the entql []byte predicate on the Data field.
func (f *MsgFilter) WhereData(p entql.BytesP) {
f.Where(p.Field(msg.FieldData))
}
// WhereDestGasLimit applies the entql uint64 predicate on the DestGasLimit field.
func (f *MsgFilter) WhereDestGasLimit(p entql.Uint64P) {
f.Where(p.Field(msg.FieldDestGasLimit))
}
// WhereSourceChainID applies the entql uint64 predicate on the SourceChainID field.
func (f *MsgFilter) WhereSourceChainID(p entql.Uint64P) {
f.Where(p.Field(msg.FieldSourceChainID))
}
// WhereDestChainID applies the entql uint64 predicate on the DestChainID field.
func (f *MsgFilter) WhereDestChainID(p entql.Uint64P) {
f.Where(p.Field(msg.FieldDestChainID))
}
// WhereStreamOffset applies the entql uint64 predicate on the StreamOffset field.
func (f *MsgFilter) WhereStreamOffset(p entql.Uint64P) {
f.Where(p.Field(msg.FieldStreamOffset))
}
// WhereTxHash applies the entql []byte predicate on the TxHash field.
func (f *MsgFilter) WhereTxHash(p entql.BytesP) {
f.Where(p.Field(msg.FieldTxHash))
}
// WhereBlockHash applies the entql []byte predicate on the BlockHash field.
func (f *MsgFilter) WhereBlockHash(p entql.BytesP) {
f.Where(p.Field(msg.FieldBlockHash))
}
// WhereBlockHeight applies the entql uint64 predicate on the BlockHeight field.
func (f *MsgFilter) WhereBlockHeight(p entql.Uint64P) {
f.Where(p.Field(msg.FieldBlockHeight))
}
// WhereReceiptHash applies the entql []byte predicate on the ReceiptHash field.
func (f *MsgFilter) WhereReceiptHash(p entql.BytesP) {
f.Where(p.Field(msg.FieldReceiptHash))
}
// WhereStatus applies the entql string predicate on the Status field.
func (f *MsgFilter) WhereStatus(p entql.StringP) {
f.Where(p.Field(msg.FieldStatus))
}
// WhereBlockTime applies the entql time.Time predicate on the BlockTime field.
func (f *MsgFilter) WhereBlockTime(p entql.TimeP) {
f.Where(p.Field(msg.FieldBlockTime))
}
// WhereCreatedAt applies the entql time.Time predicate on the CreatedAt field.
func (f *MsgFilter) WhereCreatedAt(p entql.TimeP) {
f.Where(p.Field(msg.FieldCreatedAt))
}
// WhereHasBlock applies a predicate to check if query has an edge Block.
func (f *MsgFilter) WhereHasBlock() {
f.Where(entql.HasEdge("Block"))
}
// WhereHasBlockWith applies a predicate to check if query has an edge Block with a given conditions (other predicates).
func (f *MsgFilter) WhereHasBlockWith(preds ...predicate.Block) {
f.Where(entql.HasEdgeWith("Block", sqlgraph.WrapFunc(func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})))
}
// WhereHasReceipts applies a predicate to check if query has an edge Receipts.
func (f *MsgFilter) WhereHasReceipts() {
f.Where(entql.HasEdge("Receipts"))
}
// WhereHasReceiptsWith applies a predicate to check if query has an edge Receipts with a given conditions (other predicates).
func (f *MsgFilter) WhereHasReceiptsWith(preds ...predicate.Receipt) {
f.Where(entql.HasEdgeWith("Receipts", sqlgraph.WrapFunc(func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})))
}
// addPredicate implements the predicateAdder interface.
func (rq *ReceiptQuery) addPredicate(pred func(s *sql.Selector)) {
rq.predicates = append(rq.predicates, pred)
}
// Filter returns a Filter implementation to apply filters on the ReceiptQuery builder.
func (rq *ReceiptQuery) Filter() *ReceiptFilter {
return &ReceiptFilter{config: rq.config, predicateAdder: rq}
}
// addPredicate implements the predicateAdder interface.
func (m *ReceiptMutation) addPredicate(pred func(s *sql.Selector)) {
m.predicates = append(m.predicates, pred)
}
// Filter returns an entql.Where implementation to apply filters on the ReceiptMutation builder.
func (m *ReceiptMutation) Filter() *ReceiptFilter {
return &ReceiptFilter{config: m.config, predicateAdder: m}
}
// ReceiptFilter provides a generic filtering capability at runtime for ReceiptQuery.
type ReceiptFilter struct {
predicateAdder
config
}
// Where applies the entql predicate on the query filter.
func (f *ReceiptFilter) Where(p entql.P) {
f.addPredicate(func(s *sql.Selector) {
if err := schemaGraph.EvalP(schemaGraph.Nodes[3].Type, p, s); err != nil {
s.AddError(err)
}
})
}
// WhereID applies the entql int predicate on the id field.
func (f *ReceiptFilter) WhereID(p entql.IntP) {
f.Where(p.Field(receipt.FieldID))
}
// WhereUUID applies the entql [16]byte predicate on the UUID field.
func (f *ReceiptFilter) WhereUUID(p entql.ValueP) {
f.Where(p.Field(receipt.FieldUUID))
}
// WhereBlockID applies the entql int predicate on the Block_ID field.
func (f *ReceiptFilter) WhereBlockID(p entql.IntP) {
f.Where(p.Field(receipt.FieldBlockID))
}
// WhereGasUsed applies the entql uint64 predicate on the GasUsed field.
func (f *ReceiptFilter) WhereGasUsed(p entql.Uint64P) {
f.Where(p.Field(receipt.FieldGasUsed))
}
// WhereSuccess applies the entql bool predicate on the Success field.
func (f *ReceiptFilter) WhereSuccess(p entql.BoolP) {
f.Where(p.Field(receipt.FieldSuccess))
}
// WhereRelayerAddress applies the entql []byte predicate on the RelayerAddress field.
func (f *ReceiptFilter) WhereRelayerAddress(p entql.BytesP) {
f.Where(p.Field(receipt.FieldRelayerAddress))
}
// WhereSourceChainID applies the entql uint64 predicate on the SourceChainID field.
func (f *ReceiptFilter) WhereSourceChainID(p entql.Uint64P) {
f.Where(p.Field(receipt.FieldSourceChainID))
}
// WhereDestChainID applies the entql uint64 predicate on the DestChainID field.
func (f *ReceiptFilter) WhereDestChainID(p entql.Uint64P) {
f.Where(p.Field(receipt.FieldDestChainID))
}
// WhereStreamOffset applies the entql uint64 predicate on the StreamOffset field.
func (f *ReceiptFilter) WhereStreamOffset(p entql.Uint64P) {
f.Where(p.Field(receipt.FieldStreamOffset))
}
// WhereTxHash applies the entql []byte predicate on the TxHash field.
func (f *ReceiptFilter) WhereTxHash(p entql.BytesP) {
f.Where(p.Field(receipt.FieldTxHash))
}
// WhereCreatedAt applies the entql time.Time predicate on the CreatedAt field.
func (f *ReceiptFilter) WhereCreatedAt(p entql.TimeP) {
f.Where(p.Field(receipt.FieldCreatedAt))
}
// WhereHasBlock applies a predicate to check if query has an edge Block.
func (f *ReceiptFilter) WhereHasBlock() {
f.Where(entql.HasEdge("Block"))
}
// WhereHasBlockWith applies a predicate to check if query has an edge Block with a given conditions (other predicates).
func (f *ReceiptFilter) WhereHasBlockWith(preds ...predicate.Block) {
f.Where(entql.HasEdgeWith("Block", sqlgraph.WrapFunc(func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})))
}
// WhereHasMsgs applies a predicate to check if query has an edge Msgs.
func (f *ReceiptFilter) WhereHasMsgs() {
f.Where(entql.HasEdge("Msgs"))
}
// WhereHasMsgsWith applies a predicate to check if query has an edge Msgs with a given conditions (other predicates).
func (f *ReceiptFilter) WhereHasMsgsWith(preds ...predicate.Msg) {
f.Where(entql.HasEdgeWith("Msgs", sqlgraph.WrapFunc(func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})))
}
// addPredicate implements the predicateAdder interface.
func (xcq *XProviderCursorQuery) addPredicate(pred func(s *sql.Selector)) {
xcq.predicates = append(xcq.predicates, pred)
}
// Filter returns a Filter implementation to apply filters on the XProviderCursorQuery builder.
func (xcq *XProviderCursorQuery) Filter() *XProviderCursorFilter {
return &XProviderCursorFilter{config: xcq.config, predicateAdder: xcq}
}
// addPredicate implements the predicateAdder interface.
func (m *XProviderCursorMutation) addPredicate(pred func(s *sql.Selector)) {
m.predicates = append(m.predicates, pred)
}
// Filter returns an entql.Where implementation to apply filters on the XProviderCursorMutation builder.
func (m *XProviderCursorMutation) Filter() *XProviderCursorFilter {
return &XProviderCursorFilter{config: m.config, predicateAdder: m}
}
// XProviderCursorFilter provides a generic filtering capability at runtime for XProviderCursorQuery.
type XProviderCursorFilter struct {
predicateAdder
config
}
// Where applies the entql predicate on the query filter.
func (f *XProviderCursorFilter) Where(p entql.P) {
f.addPredicate(func(s *sql.Selector) {
if err := schemaGraph.EvalP(schemaGraph.Nodes[4].Type, p, s); err != nil {
s.AddError(err)
}
})
}
// WhereID applies the entql int predicate on the id field.
func (f *XProviderCursorFilter) WhereID(p entql.IntP) {
f.Where(p.Field(xprovidercursor.FieldID))
}
// WhereUUID applies the entql [16]byte predicate on the UUID field.
func (f *XProviderCursorFilter) WhereUUID(p entql.ValueP) {
f.Where(p.Field(xprovidercursor.FieldUUID))
}
// WhereChainID applies the entql uint64 predicate on the ChainID field.
func (f *XProviderCursorFilter) WhereChainID(p entql.Uint64P) {
f.Where(p.Field(xprovidercursor.FieldChainID))
}
// WhereHeight applies the entql uint64 predicate on the Height field.
func (f *XProviderCursorFilter) WhereHeight(p entql.Uint64P) {
f.Where(p.Field(xprovidercursor.FieldHeight))
}
// WhereCreatedAt applies the entql time.Time predicate on the CreatedAt field.
func (f *XProviderCursorFilter) WhereCreatedAt(p entql.TimeP) {
f.Where(p.Field(xprovidercursor.FieldCreatedAt))
}
// WhereUpdatedAt applies the entql time.Time predicate on the UpdatedAt field.
func (f *XProviderCursorFilter) WhereUpdatedAt(p entql.TimeP) {
f.Where(p.Field(xprovidercursor.FieldUpdatedAt))
}