MCPcopy Create free account
hub / github.com/dolthub/doltgresql / ParseDByte

Function ParseDByte

postgres/parser/sem/tree/datum.go:219–225  ·  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

217// the beginning), and the escaped format, which supports "\\" and
218// octal escapes.
219func ParseDByte(s string) (*DBytes, error) {
220 res, err := lex.DecodeRawBytesToByteArrayAuto([]byte(s))
221 if err != nil {
222 return nil, makeParseError(s, types.Bytes, err)
223 }
224 return NewDBytes(DBytes(res)), nil
225}
226
227// ParseDUuidFromString parses and returns the *DUuid Datum value represented
228// by the provided input string, or an error.

Callers 2

ParseAndRequireStringFunction · 0.85
ResolveAsTypeMethod · 0.85

Calls 4

makeParseErrorFunction · 0.85
NewDBytesFunction · 0.85
DBytesTypeAlias · 0.85

Tested by

no test coverage detected