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

Function exportToBytes

backend/component/export/export.go:22–28  ·  view source on GitHub ↗

exportToBytes is a helper function that exports to a byte slice using a writer function.

(result *v1pb.QueryResult, writerFunc Writer)

Source from the content-addressed store, hash-verified

20
21// exportToBytes is a helper function that exports to a byte slice using a writer function.
22func exportToBytes(result *v1pb.QueryResult, writerFunc Writer) ([]byte, error) {
23 var buf bytes.Buffer
24 if err := writerFunc(&buf, result); err != nil {
25 return nil, err
26 }
27 return buf.Bytes(), nil
28}
29
30func formatTimestamp(ts *v1pb.RowValue_Timestamp) string {
31 return ts.GoogleTimestamp.AsTime().Format(timestampFormat)

Callers 3

SQLFunction · 0.85
CSVFunction · 0.85
JSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected