VectorToString is used for *vectorout functions, to serialize vector values for wire transfer.
(ctx *sql.Context, arr []any, baseType *DoltgresType)
| 221 | |
| 222 | // VectorToString is used for *vectorout functions, to serialize vector values for wire transfer. |
| 223 | func VectorToString(ctx *sql.Context, arr []any, baseType *DoltgresType) (string, error) { |
| 224 | sb := strings.Builder{} |
| 225 | for i, v := range arr { |
| 226 | if i > 0 { |
| 227 | sb.WriteString(" ") |
| 228 | } |
| 229 | if v != nil { |
| 230 | str, err := baseType.IoOutput(ctx, v) |
| 231 | if err != nil { |
| 232 | return "", err |
| 233 | } |
| 234 | sb.WriteString(quoteString(str)) |
| 235 | } else { |
| 236 | sb.WriteString("NULL") |
| 237 | } |
| 238 | } |
| 239 | return sb.String(), nil |
| 240 | } |
| 241 | |
| 242 | // ParseCompositeLiteral parses a Postgres composite literal string like "(1,2,hello)" into a slice |
| 243 | // of RecordValues using the field types from |compositeType|. |
nothing calls this directly
no test coverage detected