MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / ParseDByte

Function ParseDByte

pkg/sql/sem/tree/datum.go:321–327  ·  view source on GitHub ↗

ParseDByte parses a string representation of hex encoded binary data. It supports both the hex format, with "\x" followed by a string of hexadecimal digits (the "\x" prefix occurs just once at the beginning), and the escaped format, which supports "\\" and octal escapes.

(s string)

Source from the content-addressed store, hash-verified

319// the beginning), and the escaped format, which supports "\\" and
320// octal escapes.
321func ParseDByte(s string) (*DBytes, error) {
322 res, err := lex.DecodeRawBytesToByteArrayAuto([]byte(s))
323 if err != nil {
324 return nil, makeParseError(s, types.Bytes, err)
325 }
326 return NewDBytes(DBytes(res)), nil
327}
328
329// ParseDUuidFromString parses and returns the *DUuid Datum value represented
330// by the provided input string, or an error.

Callers 3

ParseAndRequireStringFunction · 0.85
PerformCastFunction · 0.85
ResolveAsTypeMethod · 0.85

Calls 4

makeParseErrorFunction · 0.85
NewDBytesFunction · 0.85
DBytesTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…