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

Method ListContext

db/sql/sql.go:927–938  ·  view source on GitHub ↗

List resources in the db

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

Source from the content-addressed store, hash-verified

925
926//List resources in the db
927func (tx *Transaction) ListContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions, pg *pagination.Paginator) (list []*schema.Resource, total uint64, err error) {
928 defer tx.measureTime(time.Now(), s.ID, "list")
929
930 sc := listContextHelper(s, filter, options, pg)
931
932 sql, args, err := buildSelect(sc)
933 if err != nil {
934 return nil, 0, err
935 }
936
937 return tx.executeSelect(ctx, sc, sql, args)
938}
939
940func listContextHelper(s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions, pg *pagination.Paginator) *selectContext {
941 sc := &selectContext{

Callers 2

ListMethod · 0.95
FetchContextMethod · 0.95

Calls 4

measureTimeMethod · 0.95
executeSelectMethod · 0.95
listContextHelperFunction · 0.85
buildSelectFunction · 0.85

Tested by

no test coverage detected