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

Function DecodeUntaggedTimeTZValue

pkg/util/encoding/encoding.go:2167–2180  ·  view source on GitHub ↗

DecodeUntaggedTimeTZValue decodes a value encoded by EncodeUntaggedTimeTZValue.

(b []byte)

Source from the content-addressed store, hash-verified

2165
2166// DecodeUntaggedTimeTZValue decodes a value encoded by EncodeUntaggedTimeTZValue.
2167func DecodeUntaggedTimeTZValue(b []byte) (remaining []byte, t timetz.TimeTZ, err error) {
2168 var timeOfDayMicros int64
2169 b, _, timeOfDayMicros, err = DecodeNonsortingStdlibVarint(b)
2170 if err != nil {
2171 return b, timetz.TimeTZ{}, err
2172 }
2173 var offsetSecs int64
2174 b, _, offsetSecs, err = DecodeNonsortingStdlibVarint(b)
2175 if err != nil {
2176 return b, timetz.TimeTZ{}, err
2177 }
2178 // Do not use timeofday.FromInt as it truncates 24:00 into 00:00.
2179 return b, timetz.MakeTimeTZ(timeofday.TimeOfDay(timeOfDayMicros), int32(offsetSecs)), nil
2180}
2181
2182// DecodeDecimalValue decodes a value encoded by EncodeDecimalValue.
2183func DecodeDecimalValue(b []byte) (remaining []byte, d apd.Decimal, err error) {

Callers 1

DecodeTimeTZValueFunction · 0.85

Calls 3

MakeTimeTZFunction · 0.92
TimeOfDayTypeAlias · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…