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)
| 2439 | // STRING COLLATE EN |
| 2440 | // VARCHAR(20)[] COLLATE DE |
| 2441 | func (t *T) collatedStringTypeSQL(isArray bool) string { |
| 2442 | var buf bytes.Buffer |
| 2443 | buf.WriteString(t.stringTypeSQL()) |
| 2444 | if isArray { |
| 2445 | buf.WriteString("[] COLLATE ") |
| 2446 | } else { |
| 2447 | buf.WriteString(" COLLATE ") |
| 2448 | } |
| 2449 | lex.EncodeLocaleName(&buf, t.Locale()) |
| 2450 | return buf.String() |
| 2451 | } |
| 2452 | |
| 2453 | // stringTypeSQL returns the visible type name plus any width specifier for the |
| 2454 | // STRING/COLLATEDSTRING type. |
no test coverage detected