(dbCtx *dbContext, qc *qcode.QCode)
| 33 | } |
| 34 | |
| 35 | func (s *gstate) renderNanoDBQuery(dbCtx *dbContext, qc *qcode.QCode) ([]byte, error) { |
| 36 | if qc == nil { |
| 37 | return []byte(`{}`), nil |
| 38 | } |
| 39 | out := make(map[string]any, len(qc.Roots)) |
| 40 | for _, id := range qc.Roots { |
| 41 | sel := &qc.Selects[id] |
| 42 | value, err := s.renderNanoSelect(dbCtx, qc, sel, nil) |
| 43 | if err != nil { |
| 44 | return nil, err |
| 45 | } |
| 46 | out[sel.FieldName] = value |
| 47 | } |
| 48 | return json.Marshal(out) |
| 49 | } |
| 50 | |
| 51 | func (s *gstate) renderNanoSelect( |
| 52 | dbCtx *dbContext, |
no test coverage detected