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

Method GetSheetTruncated

backend/store/sheet.go:28–37  ·  view source on GitHub ↗

GetSheetTruncated gets a sheet by SHA256 hash with truncated statement (max 2MB). Statement field will be truncated to MaxSheetSize (2MB). Results are cached by SHA256 hex string.

(ctx context.Context, sha256Hex string)

Source from the content-addressed store, hash-verified

26// Statement field will be truncated to MaxSheetSize (2MB).
27// Results are cached by SHA256 hex string.
28func (s *Store) GetSheetTruncated(ctx context.Context, sha256Hex string) (*SheetMessage, error) {
29 sheet, err := s.getSheet(ctx, sha256Hex, false)
30 if err != nil {
31 return nil, err
32 }
33 if sheet == nil {
34 return nil, nil
35 }
36 return sheet, nil
37}
38
39// GetSheetFull gets a sheet by SHA256 hash with the complete statement.
40// Statement field contains the complete content regardless of size.

Callers 1

GetSheetMethod · 0.80

Calls 1

getSheetMethod · 0.95

Tested by

no test coverage detected