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

Method CallReceive

server/types/type.go:1168–1184  ·  view source on GitHub ↗

CallReceive is a way to call the `receive` function for this type.

(ctx *sql.Context, val []byte)

Source from the content-addressed store, hash-verified

1166
1167// CallReceive is a way to call the `receive` function for this type.
1168func (t *DoltgresType) CallReceive(ctx *sql.Context, val []byte) (any, error) {
1169 if t.TypType == TypeType_Domain {
1170 return globalFunctionRegistry.GetFunction(ctx, t.ReceiveFunc).CallVariadic(ctx, val, t.BaseTypeType.ID.AsId(), t.attTypMod)
1171 } else if t.ModInFunc != 0 || t.IsArrayType() {
1172 if t.Elem.ID != id.NullType {
1173 return globalFunctionRegistry.GetFunction(ctx, t.ReceiveFunc).CallVariadic(ctx, val, t.Elem.ID.AsId(), t.attTypMod)
1174 } else {
1175 return globalFunctionRegistry.GetFunction(ctx, t.ReceiveFunc).CallVariadic(ctx, val, t.ID.AsId(), t.attTypMod)
1176 }
1177 } else if t.TypType == TypeType_Enum {
1178 return globalFunctionRegistry.GetFunction(ctx, t.ReceiveFunc).CallVariadic(ctx, val, t.ID.AsId())
1179 } else if t.IsCompositeType() {
1180 return globalFunctionRegistry.GetFunction(ctx, t.ReceiveFunc).CallVariadic(ctx, val, t.ID.AsId(), t.attTypMod)
1181 } else {
1182 return globalFunctionRegistry.GetFunction(ctx, t.ReceiveFunc).CallVariadic(ctx, val)
1183 }
1184}
1185
1186// ConvertSerialized implements the val.TupleTypeHandler interface.
1187func (t *DoltgresType) ConvertSerialized(ctx context.Context, other val.TupleTypeHandler, val []byte) ([]byte, error) {

Callers 4

DeserializeValueMethod · 0.95
convertBindParametersMethod · 0.80
record_recv_callableFunction · 0.80
array_recv_callableFunction · 0.80

Calls 5

IsArrayTypeMethod · 0.95
IsCompositeTypeMethod · 0.95
CallVariadicMethod · 0.65
GetFunctionMethod · 0.45
AsIdMethod · 0.45

Tested by

no test coverage detected