IoInput converts input string value to given type value.
(ctx *sql.Context, input string)
| 601 | |
| 602 | // IoInput converts input string value to given type value. |
| 603 | func (t *DoltgresType) IoInput(ctx *sql.Context, input string) (any, error) { |
| 604 | if t.TypType == TypeType_Domain { |
| 605 | return globalFunctionRegistry.GetFunction(ctx, t.InputFunc).CallVariadic(ctx, input, t.BaseTypeType.ID.AsId(), t.attTypMod) |
| 606 | } else if t.ModInFunc != 0 || t.IsArrayType() { |
| 607 | if t.Elem.ID != id.NullType { |
| 608 | return globalFunctionRegistry.GetFunction(ctx, t.InputFunc).CallVariadic(ctx, input, t.Elem.ID.AsId(), t.attTypMod) |
| 609 | } else { |
| 610 | return globalFunctionRegistry.GetFunction(ctx, t.InputFunc).CallVariadic(ctx, input, t.ID.AsId(), t.attTypMod) |
| 611 | } |
| 612 | } else if t.TypType == TypeType_Enum { |
| 613 | return globalFunctionRegistry.GetFunction(ctx, t.InputFunc).CallVariadic(ctx, input, t.ID.AsId()) |
| 614 | } else if t.IsCompositeType() { |
| 615 | return ParseCompositeLiteral(ctx, input, t) |
| 616 | } else { |
| 617 | return globalFunctionRegistry.GetFunction(ctx, t.InputFunc).CallVariadic(ctx, input) |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | // IoOutput converts given type value to output string. |
| 622 | func (t *DoltgresType) IoOutput(ctx *sql.Context, val any) (string, error) { |
no test coverage detected