QueryDecisions chains the current query on the "decisions" edge.
()
| 92 | |
| 93 | // QueryDecisions chains the current query on the "decisions" edge. |
| 94 | func (_q *AlertQuery) QueryDecisions() *DecisionQuery { |
| 95 | query := (&DecisionClient{config: _q.config}).Query() |
| 96 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 97 | if err := _q.prepareQuery(ctx); err != nil { |
| 98 | return nil, err |
| 99 | } |
| 100 | selector := _q.sqlQuery(ctx) |
| 101 | if err := selector.Err(); err != nil { |
| 102 | return nil, err |
| 103 | } |
| 104 | step := sqlgraph.NewStep( |
| 105 | sqlgraph.From(alert.Table, alert.FieldID, selector), |
| 106 | sqlgraph.To(decision.Table, decision.FieldID), |
| 107 | sqlgraph.Edge(sqlgraph.O2M, false, alert.DecisionsTable, alert.DecisionsColumn), |
| 108 | ) |
| 109 | fromU = sqlgraph.SetNeighbors(_q.driver.Dialect(), step) |
| 110 | return fromU, nil |
| 111 | } |
| 112 | return query |
| 113 | } |
| 114 | |
| 115 | // QueryEvents chains the current query on the "events" edge. |
| 116 | func (_q *AlertQuery) QueryEvents() *EventQuery { |
nothing calls this directly
no test coverage detected