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

Method CallSend

server/types/type.go:1150–1165  ·  view source on GitHub ↗

CallSend is a way to call the `send` function for this type.

(ctx *sql.Context, val any)

Source from the content-addressed store, hash-verified

1148
1149// CallSend is a way to call the `send` function for this type.
1150func (t *DoltgresType) CallSend(ctx *sql.Context, val any) ([]byte, error) {
1151 var o any
1152 var err error
1153 if t.ModInFunc != 0 || t.IsArrayType() {
1154 send := globalFunctionRegistry.GetFunction(ctx, t.SendFunc)
1155 resolvedTypes := send.ResolvedTypes()
1156 resolvedTypes[0] = t
1157 o, err = send.WithResolvedTypes(resolvedTypes).(QuickFunction).CallVariadic(ctx, val)
1158 } else {
1159 o, err = globalFunctionRegistry.GetFunction(ctx, t.SendFunc).CallVariadic(ctx, val)
1160 }
1161 if err != nil || o == nil {
1162 return nil, err
1163 }
1164 return o.([]byte), nil
1165}
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) {

Callers 4

SerializeValueMethod · 0.95
rowToBytesFunction · 0.80
record.goFile · 0.80
array.goFile · 0.80

Calls 5

IsArrayTypeMethod · 0.95
ResolvedTypesMethod · 0.65
CallVariadicMethod · 0.65
WithResolvedTypesMethod · 0.65
GetFunctionMethod · 0.45

Tested by

no test coverage detected