MCPcopy Create free account
hub / github.com/OpenCSGs/csghub-server / ByRepoID

Method ByRepoID

builder/store/database/code.go:37–49  ·  view source on GitHub ↗
(ctx context.Context, repoID int64)

Source from the content-addressed store, hash-verified

35}
36
37func (s *CodeStore) ByRepoID(ctx context.Context, repoID int64) (*Code, error) {
38 var code Code
39 err := s.db.Operator.Core.NewSelect().
40 Model(&code).
41 Where("repository_id = ?", repoID).
42 Scan(ctx)
43
44 if err != nil {
45 return nil, fmt.Errorf("failed to select code, error: %w", err)
46 }
47
48 return &code, nil
49}
50
51func (s *CodeStore) ByUsername(ctx context.Context, username string, per, page int, onlyPublic bool) (codes []Code, total int, err error) {
52 query := s.db.Operator.Core.

Callers 4

UpdateMethod · 0.45
UpdateMethod · 0.45
UpdateMethod · 0.45
UpdateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected