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

Function decodeValueTypeAssert

pkg/util/encoding/encoding.go:2308–2318  ·  view source on GitHub ↗
(b []byte, expected Type)

Source from the content-addressed store, hash-verified

2306}
2307
2308func decodeValueTypeAssert(b []byte, expected Type) ([]byte, error) {
2309 _, dataOffset, _, typ, err := DecodeValueTag(b)
2310 if err != nil {
2311 return b, err
2312 }
2313 b = b[dataOffset:]
2314 if typ != expected {
2315 return b, errors.Errorf("value type is not %s: %s", expected, typ)
2316 }
2317 return b, nil
2318}
2319
2320// PeekValueLength returns the length of the encoded value at the start of b.
2321// Note: If this function succeeds, it's not a guarantee that decoding the value

Callers 10

DecodeIntValueFunction · 0.85
DecodeFloatValueFunction · 0.85
DecodeBytesValueFunction · 0.85
DecodeTimeValueFunction · 0.85
DecodeTimeTZValueFunction · 0.85
DecodeDecimalValueFunction · 0.85
DecodeDurationValueFunction · 0.85
DecodeBitArrayValueFunction · 0.85
DecodeUUIDValueFunction · 0.85
DecodeIPAddrValueFunction · 0.85

Calls 1

DecodeValueTagFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…