Fetch resources by ID in the db
(ctx context.Context, s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions)
| 1108 | |
| 1109 | //Fetch resources by ID in the db |
| 1110 | func (tx *Transaction) FetchContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions) (*schema.Resource, error) { |
| 1111 | defer tx.measureTime(time.Now(), s.ID, "fetch") |
| 1112 | |
| 1113 | list, _, err := tx.ListContext(ctx, s, filter, options, nil) |
| 1114 | return fetchContextHelper(list, err, filter) |
| 1115 | } |
| 1116 | |
| 1117 | func fetchContextHelper(list []*schema.Resource, err error, filter transaction.Filter) (*schema.Resource, error) { |
| 1118 | if err != nil { |
no test coverage detected