collatedStringTypeSQL returns the string representation of a COLLATEDSTRING or []COLLATEDSTRING type. This is tricky in the case of an array of collated string, since brackets must precede the COLLATE identifier: STRING COLLATE EN VARCHAR(20)[] COLLATE DE
(isArray bool)
| 3011 | // STRING COLLATE EN |
| 3012 | // VARCHAR(20)[] COLLATE DE |
| 3013 | func (t *T) collatedStringTypeSQL(isArray bool) string { |
| 3014 | var buf bytes.Buffer |
| 3015 | buf.WriteString(t.stringTypeSQL()) |
| 3016 | if isArray { |
| 3017 | buf.WriteString("[] COLLATE ") |
| 3018 | } else { |
| 3019 | buf.WriteString(" COLLATE ") |
| 3020 | } |
| 3021 | lex.EncodeLocaleName(&buf, t.Locale()) |
| 3022 | return buf.String() |
| 3023 | } |
| 3024 | |
| 3025 | // stringTypeSQL returns the visible type name plus any width specifier for the |
| 3026 | // STRING/COLLATEDSTRING type. |
no test coverage detected