MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetSheetFull

Method GetSheetFull

backend/store/sheet.go:42–57  ·  view source on GitHub ↗

GetSheetFull gets a sheet by SHA256 hash with the complete statement. Statement field contains the complete content regardless of size. Results are cached by SHA256 hex string.

(ctx context.Context, sha256Hex string)

Source from the content-addressed store, hash-verified

40// Statement field contains the complete content regardless of size.
41// Results are cached by SHA256 hex string.
42func (s *Store) GetSheetFull(ctx context.Context, sha256Hex string) (*SheetMessage, error) {
43 if v, ok := s.sheetFullCache.Get(sha256Hex); ok && s.enableCache {
44 return v, nil
45 }
46
47 sheet, err := s.getSheet(ctx, sha256Hex, true)
48 if err != nil {
49 return nil, err
50 }
51 if sheet == nil {
52 return nil, nil
53 }
54
55 s.sheetFullCache.Add(sha256Hex, sheet)
56 return sheet, nil
57}
58
59// getSheet is the internal helper for fetching a single sheet by SHA256.
60func (s *Store) getSheet(ctx context.Context, sha256Hex string, loadFull bool) (*SheetMessage, error) {

Callers 14

RunOnceMethod · 0.80
RunOnceMethod · 0.80
runVersionedReleaseMethod · 0.80
runDeclarativeReleaseMethod · 0.80
RunOnceMethod · 0.80
getSheetContentFunction · 0.80
RunForTargetMethod · 0.80
RunForTargetMethod · 0.80
RunForTargetMethod · 0.80
GetSheetMethod · 0.80

Calls 2

getSheetMethod · 0.95
GetMethod · 0.80

Tested by

no test coverage detected