MCPcopy Create free account
hub / github.com/cloudwan/gohan / FetchContext

Method FetchContext

db/sql/sql.go:1110–1115  ·  view source on GitHub ↗

Fetch resources by ID in the db

(ctx context.Context, s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions)

Source from the content-addressed store, hash-verified

1108
1109//Fetch resources by ID in the db
1110func (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
1117func fetchContextHelper(list []*schema.Resource, err error, filter transaction.Filter) (*schema.Resource, error) {
1118 if err != nil {

Callers 1

FetchMethod · 0.95

Calls 3

measureTimeMethod · 0.95
ListContextMethod · 0.95
fetchContextHelperFunction · 0.85

Tested by

no test coverage detected