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)
| 2028 | // VARCHAR(20)[] COLLATE DE |
| 2029 | // |
| 2030 | func (t *T) collatedStringTypeSQL(isArray bool) string { |
| 2031 | var buf bytes.Buffer |
| 2032 | buf.WriteString(t.stringTypeSQL()) |
| 2033 | if isArray { |
| 2034 | buf.WriteString("[] COLLATE ") |
| 2035 | } else { |
| 2036 | buf.WriteString(" COLLATE ") |
| 2037 | } |
| 2038 | lex.EncodeLocaleName(&buf, t.Locale()) |
| 2039 | return buf.String() |
| 2040 | } |
| 2041 | |
| 2042 | // stringTypeSQL returns the visible type name plus any width specifier for the |
| 2043 | // STRING/COLLATEDSTRING type. |
no test coverage detected