QueryMetas chains the current query on the "metas" edge.
()
| 136 | |
| 137 | // QueryMetas chains the current query on the "metas" edge. |
| 138 | func (_q *AlertQuery) QueryMetas() *MetaQuery { |
| 139 | query := (&MetaClient{config: _q.config}).Query() |
| 140 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 141 | if err := _q.prepareQuery(ctx); err != nil { |
| 142 | return nil, err |
| 143 | } |
| 144 | selector := _q.sqlQuery(ctx) |
| 145 | if err := selector.Err(); err != nil { |
| 146 | return nil, err |
| 147 | } |
| 148 | step := sqlgraph.NewStep( |
| 149 | sqlgraph.From(alert.Table, alert.FieldID, selector), |
| 150 | sqlgraph.To(meta.Table, meta.FieldID), |
| 151 | sqlgraph.Edge(sqlgraph.O2M, false, alert.MetasTable, alert.MetasColumn), |
| 152 | ) |
| 153 | fromU = sqlgraph.SetNeighbors(_q.driver.Dialect(), step) |
| 154 | return fromU, nil |
| 155 | } |
| 156 | return query |
| 157 | } |
| 158 | |
| 159 | // First returns the first Alert entity from the query. |
| 160 | // Returns a *NotFoundError when no Alert was found. |
nothing calls this directly
no test coverage detected