Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 880 | |
| 881 | // Format implements the NodeFormatter interface. |
| 882 | func (node *Array) Format(ctx *FmtCtx) { |
| 883 | ctx.WriteString("ARRAY[") |
| 884 | ctx.FormatNode(&node.Exprs) |
| 885 | ctx.WriteByte(']') |
| 886 | // If the array has a type, add an annotation. Don't add it if the type is |
| 887 | // UNKNOWN[], since that's not a valid annotation. |
| 888 | if ctx.HasFlags(FmtParsable) && node.typ != nil { |
| 889 | if node.typ.ArrayContents().Family() != types.UnknownFamily { |
| 890 | ctx.WriteString(":::") |
| 891 | ctx.Buffer.WriteString(node.typ.SQLString()) |
| 892 | } |
| 893 | } |
| 894 | } |
| 895 | |
| 896 | // ArrayFlatten represents a subquery array constructor. |
| 897 | type ArrayFlatten struct { |
no test coverage detected