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

Function unmarshalTimestamp

backend/api/mcp/tool_query.go:311–319  ·  view source on GitHub ↗

unmarshalTimestamp extracts the string value from a timestamp object.

(val json.RawMessage)

Source from the content-addressed store, hash-verified

309
310// unmarshalTimestamp extracts the string value from a timestamp object.
311func unmarshalTimestamp(val json.RawMessage) (any, bool) {
312 var ts map[string]string
313 if json.Unmarshal(val, &ts) == nil {
314 if v, ok := ts["value"]; ok {
315 return v, true
316 }
317 }
318 return nil, false
319}
320
321// parseLatencyMs parses a duration string like "0.012s" into milliseconds.
322func parseLatencyMs(latency string) int64 {

Callers 1

unmarshalRowFieldFunction · 0.85

Calls 1

UnmarshalMethod · 0.80

Tested by

no test coverage detected