1 module hunt.database.driver.mysql.impl.MySQLCollation;
2 
3 import hunt.util.ObjectUtils;
4 import hunt.Exceptions;
5 
6 import std.array;
7 import std.conv;
8 
9 /**
10  * MySQL collation which is a set of rules for comparing characters in a character set.
11  */
12 struct MySQLCollation {
13 
14     enum MySQLCollation big5_chinese_ci = MySQLCollation("big5_chinese_ci", "big5", "Big5", 1);
15     enum MySQLCollation latin2_czech_cs = MySQLCollation("latin2_czech_cs", "latin2", "ISO8859_2", 2);
16     enum MySQLCollation dec8_swedish_ci = MySQLCollation("dec8_swedish_ci", "dec8", "Cp1252", 3);
17     enum MySQLCollation cp850_general_ci = MySQLCollation("cp850_general_ci", "cp850", "Cp850", 4);
18     enum MySQLCollation latin1_german1_ci = MySQLCollation("latin1_german1_ci", "latin1", "Cp1252", 5);
19     enum MySQLCollation hp8_english_ci = MySQLCollation("hp8_english_ci", "hp8", "Cp1252", 6);
20     enum MySQLCollation koi8r_general_ci = MySQLCollation("koi8r_general_ci", "koi8r", "KOI8_R", 7);
21     enum MySQLCollation latin1_swedish_ci = MySQLCollation("latin1_swedish_ci", "latin1", "Cp1252", 8);
22     enum MySQLCollation latin2_general_ci = MySQLCollation("latin2_general_ci", "latin2", "ISO8859_2", 9);
23     enum MySQLCollation swe7_swedish_ci = MySQLCollation("swe7_swedish_ci", "swe7", "Cp1252", 10);
24     enum MySQLCollation ascii_general_ci = MySQLCollation("ascii_general_ci", "ascii", "US-ASCII", 11);
25     enum MySQLCollation ujis_japanese_ci = MySQLCollation("ujis_japanese_ci", "ujis", "EUC_JP", 12);
26     enum MySQLCollation sjis_japanese_ci = MySQLCollation("sjis_japanese_ci", "sjis", "SJIS", 13);
27     enum MySQLCollation cp1251_bulgarian_ci = MySQLCollation("cp1251_bulgarian_ci", "cp1251", "Cp1251", 14);
28     enum MySQLCollation latin1_danish_ci = MySQLCollation("latin1_danish_ci", "latin1", "Cp1252", 15);
29     enum MySQLCollation hebrew_general_ci = MySQLCollation("hebrew_general_ci", "hebrew", "ISO8859_8", 16);
30     enum MySQLCollation tis620_thai_ci = MySQLCollation("tis620_thai_ci", "tis620", "TIS620", 18);
31     enum MySQLCollation euckr_korean_ci = MySQLCollation("euckr_korean_ci", "euckr", "EUC_KR", 19);
32     enum MySQLCollation latin7_estonian_cs = MySQLCollation("latin7_estonian_cs", "latin7", "ISO-8859-13", 20);
33     enum MySQLCollation latin2_hungarian_ci = MySQLCollation("latin2_hungarian_ci", "latin2", "ISO8859_2", 21);
34     enum MySQLCollation koi8u_general_ci = MySQLCollation("koi8u_general_ci", "koi8u", "KOI8_R", 22);
35     enum MySQLCollation cp1251_ukrainian_ci = MySQLCollation("cp1251_ukrainian_ci", "cp1251", "Cp1251", 23);
36     enum MySQLCollation gb2312_chinese_ci = MySQLCollation("gb2312_chinese_ci", "gb2312", "EUC_CN", 24);
37     enum MySQLCollation greek_general_ci = MySQLCollation("greek_general_ci", "greek", "ISO8859_7", 25);
38     enum MySQLCollation cp1250_general_ci = MySQLCollation("cp1250_general_ci", "cp1250", "Cp1250", 26);
39     enum MySQLCollation latin2_croatian_ci = MySQLCollation("latin2_croatian_ci", "latin2", "ISO8859_2", 27);
40     enum MySQLCollation gbk_chinese_ci = MySQLCollation("gbk_chinese_ci", "gbk", "GBK", 28);
41     enum MySQLCollation cp1257_lithuanian_ci = MySQLCollation("cp1257_lithuanian_ci", "cp1257", "Cp1257", 29);
42     enum MySQLCollation latin5_turkish_ci = MySQLCollation("latin5_turkish_ci", "latin5", "ISO8859_9", 30);
43     enum MySQLCollation latin1_german2_ci = MySQLCollation("latin1_german2_ci", "latin1", "Cp1252", 31);
44     enum MySQLCollation armscii8_general_ci = MySQLCollation("armscii8_general_ci", "armscii8", "Cp1252", 32);
45     enum MySQLCollation utf8_general_ci = MySQLCollation("utf8_general_ci", "utf8", "UTF-8", 33);
46     enum MySQLCollation cp1250_czech_cs = MySQLCollation("cp1250_czech_cs", "cp1250", "Cp1250", 34);
47     enum MySQLCollation ucs2_general_ci = MySQLCollation("ucs2_general_ci", "ucs2", "UnicodeBig", 35);
48     enum MySQLCollation cp866_general_ci = MySQLCollation("cp866_general_ci", "cp866", "Cp866", 36);
49     enum MySQLCollation keybcs2_general_ci = MySQLCollation("keybcs2_general_ci", "keybcs2", "Cp852", 37);
50     enum MySQLCollation macce_general_ci = MySQLCollation("macce_general_ci", "macce", "MacCentralEurope", 38);
51     enum MySQLCollation macroman_general_ci = MySQLCollation("macroman_general_ci", "macroman", "MacRoman", 39);
52     enum MySQLCollation cp852_general_ci = MySQLCollation("cp852_general_ci", "cp852", "Cp852", 40);
53     enum MySQLCollation latin7_general_ci = MySQLCollation("latin7_general_ci", "latin7", "ISO-8859-13", 41);
54     enum MySQLCollation latin7_general_cs = MySQLCollation("latin7_general_cs", "latin7", "ISO-8859-13", 42);
55     enum MySQLCollation macce_bin = MySQLCollation("macce_bin", "macce", "MacCentralEurope", 43);
56     enum MySQLCollation cp1250_croatian_ci = MySQLCollation("cp1250_croatian_ci", "cp1250", "Cp1250", 44);
57     enum MySQLCollation utf8mb4_general_ci = MySQLCollation("utf8mb4_general_ci", "utf8mb4", "UTF-8", 45);
58     enum MySQLCollation utf8mb4_bin = MySQLCollation("utf8mb4_bin", "utf8mb4", "UTF-8", 46);
59     enum MySQLCollation latin1_bin = MySQLCollation("latin1_bin", "latin1", "Cp1252", 47);
60     enum MySQLCollation latin1_general_ci = MySQLCollation("latin1_general_ci", "latin1", "Cp1252", 48);
61     enum MySQLCollation latin1_general_cs = MySQLCollation("latin1_general_cs", "latin1", "Cp1252", 49);
62     enum MySQLCollation cp1251_bin = MySQLCollation("cp1251_bin", "cp1251", "Cp1251", 50);
63     enum MySQLCollation cp1251_general_ci = MySQLCollation("cp1251_general_ci", "cp1251", "Cp1251", 51);
64     enum MySQLCollation cp1251_general_cs = MySQLCollation("cp1251_general_cs", "cp1251", "Cp1251", 52);
65     enum MySQLCollation macroman_bin = MySQLCollation("macroman_bin", "macroman", "MacRoman", 53);
66     enum MySQLCollation utf16_general_ci = MySQLCollation("utf16_general_ci", "utf16", "UTF-16", 54);
67     enum MySQLCollation utf16_bin = MySQLCollation("utf16_bin", "utf16", "UTF-16", 55);
68     enum MySQLCollation utf16le_general_ci = MySQLCollation("utf16le_general_ci", "utf16le", "UTF-16LE", 56);
69     enum MySQLCollation cp1256_general_ci = MySQLCollation("cp1256_general_ci", "cp1256", "Cp1256", 57);
70     enum MySQLCollation cp1257_bin = MySQLCollation("cp1257_bin", "cp1257", "Cp1257", 58);
71     enum MySQLCollation cp1257_general_ci = MySQLCollation("cp1257_general_ci", "cp1257", "Cp1257", 59);
72     enum MySQLCollation utf32_general_ci = MySQLCollation("utf32_general_ci", "utf32", "UTF-32", 60);
73     enum MySQLCollation utf32_bin = MySQLCollation("utf32_bin", "utf32", "UTF-32", 61);
74     enum MySQLCollation utf16le_bin = MySQLCollation("utf16le_bin", "utf16le", "UTF-16LE", 62);
75     enum MySQLCollation binary = MySQLCollation("binary", "binary", "ISO8859_1", 63);
76     enum MySQLCollation armscii8_bin = MySQLCollation("armscii8_bin", "armscii8", "Cp1252", 64);
77     enum MySQLCollation ascii_bin = MySQLCollation("ascii_bin", "ascii", "US-ASCII", 65);
78     enum MySQLCollation cp1250_bin = MySQLCollation("cp1250_bin", "cp1250", "Cp1250", 66);
79     enum MySQLCollation cp1256_bin = MySQLCollation("cp1256_bin", "cp1256", "Cp1256", 67);
80     enum MySQLCollation cp866_bin = MySQLCollation("cp866_bin", "cp866", "Cp866", 68);
81     enum MySQLCollation dec8_bin = MySQLCollation("dec8_bin", "dec8", "Cp1252", 69);
82     enum MySQLCollation greek_bin = MySQLCollation("greek_bin", "greek", "ISO8859_7", 70);
83     enum MySQLCollation hebrew_bin = MySQLCollation("hebrew_bin", "hebrew", "ISO8859_8", 71);
84     enum MySQLCollation hp8_bin = MySQLCollation("hp8_bin", "hp8", "Cp1252", 72);
85     enum MySQLCollation keybcs2_bin = MySQLCollation("keybcs2_bin", "keybcs2", "Cp852", 73);
86     enum MySQLCollation koi8r_bin = MySQLCollation("koi8r_bin", "koi8r", "KOI8_R", 74);
87     enum MySQLCollation koi8u_bin = MySQLCollation("koi8u_bin", "koi8u", "KOI8_R", 75);
88     enum MySQLCollation latin2_bin = MySQLCollation("latin2_bin", "latin2", "ISO8859_2", 77);
89     enum MySQLCollation latin5_bin = MySQLCollation("latin5_bin", "latin5", "ISO8859_9", 78);
90     enum MySQLCollation latin7_bin = MySQLCollation("latin7_bin", "latin7", "ISO-8859-13", 79);
91     enum MySQLCollation cp850_bin = MySQLCollation("cp850_bin", "cp850", "Cp850", 80);
92     enum MySQLCollation cp852_bin = MySQLCollation("cp852_bin", "cp852", "Cp852", 81);
93     enum MySQLCollation swe7_bin = MySQLCollation("swe7_bin", "swe7", "Cp1252", 82);
94     enum MySQLCollation utf8_bin = MySQLCollation("utf8_bin", "utf8", "UTF-8", 83);
95     enum MySQLCollation big5_bin = MySQLCollation("big5_bin", "big5", "Big5", 84);
96     enum MySQLCollation euckr_bin = MySQLCollation("euckr_bin", "euckr", "EUC_KR", 85);
97     enum MySQLCollation gb2312_bin = MySQLCollation("gb2312_bin", "gb2312", "EUC_CN", 86);
98     enum MySQLCollation gbk_bin = MySQLCollation("gbk_bin", "gbk", "GBK", 87);
99     enum MySQLCollation sjis_bin = MySQLCollation("sjis_bin", "sjis", "SJIS", 88);
100     enum MySQLCollation tis620_bin = MySQLCollation("tis620_bin", "tis620", "TIS620", 89);
101     enum MySQLCollation ucs2_bin = MySQLCollation("ucs2_bin", "ucs2", "UnicodeBig", 90);
102     enum MySQLCollation ujis_bin = MySQLCollation("ujis_bin", "ujis", "EUC_JP", 91);
103     enum MySQLCollation geostd8_general_ci = MySQLCollation("geostd8_general_ci", "geostd8", "Cp1252", 92);
104     enum MySQLCollation geostd8_bin = MySQLCollation("geostd8_bin", "geostd8", "Cp1252", 93);
105     enum MySQLCollation latin1_spanish_ci = MySQLCollation("latin1_spanish_ci", "latin1", "Cp1252", 94);
106     enum MySQLCollation cp932_japanese_ci = MySQLCollation("cp932_japanese_ci", "cp932", "Cp932", 95);
107     enum MySQLCollation cp932_bin = MySQLCollation("cp932_bin", "cp932", "Cp932", 96);
108     enum MySQLCollation eucjpms_japanese_ci = MySQLCollation("eucjpms_japanese_ci", "eucjpms", "EUC_JP_Solaris", 97);
109     enum MySQLCollation eucjpms_bin = MySQLCollation("eucjpms_bin", "eucjpms", "EUC_JP_Solaris", 98);
110     enum MySQLCollation cp1250_polish_ci = MySQLCollation("cp1250_polish_ci", "cp1250", "Cp1250", 99);
111     enum MySQLCollation utf16_unicode_ci = MySQLCollation("utf16_unicode_ci", "utf16", "UTF-16", 101);
112     enum MySQLCollation utf16_icelandic_ci = MySQLCollation("utf16_icelandic_ci", "utf16", "UTF-16", 102);
113     enum MySQLCollation utf16_latvian_ci = MySQLCollation("utf16_latvian_ci", "utf16", "UTF-16", 103);
114     enum MySQLCollation utf16_romanian_ci = MySQLCollation("utf16_romanian_ci", "utf16", "UTF-16", 104);
115     enum MySQLCollation utf16_slovenian_ci = MySQLCollation("utf16_slovenian_ci", "utf16", "UTF-16", 105);
116     enum MySQLCollation utf16_polish_ci = MySQLCollation("utf16_polish_ci", "utf16", "UTF-16", 106);
117     enum MySQLCollation utf16_estonian_ci = MySQLCollation("utf16_estonian_ci", "utf16", "UTF-16", 107);
118     enum MySQLCollation utf16_spanish_ci = MySQLCollation("utf16_spanish_ci", "utf16", "UTF-16", 108);
119     enum MySQLCollation utf16_swedish_ci = MySQLCollation("utf16_swedish_ci", "utf16", "UTF-16", 109);
120     enum MySQLCollation utf16_turkish_ci = MySQLCollation("utf16_turkish_ci", "utf16", "UTF-16", 110);
121     enum MySQLCollation utf16_czech_ci = MySQLCollation("utf16_czech_ci", "utf16", "UTF-16", 111);
122     enum MySQLCollation utf16_danish_ci = MySQLCollation("utf16_danish_ci", "utf16", "UTF-16", 112);
123     enum MySQLCollation utf16_lithuanian_ci = MySQLCollation("utf16_lithuanian_ci", "utf16", "UTF-16", 113);
124     enum MySQLCollation utf16_slovak_ci = MySQLCollation("utf16_slovak_ci", "utf16", "UTF-16", 114);
125     enum MySQLCollation utf16_spanish2_ci = MySQLCollation("utf16_spanish2_ci", "utf16", "UTF-16", 115);
126     enum MySQLCollation utf16_roman_ci = MySQLCollation("utf16_roman_ci", "utf16", "UTF-16", 116);
127     enum MySQLCollation utf16_persian_ci = MySQLCollation("utf16_persian_ci", "utf16", "UTF-16", 117);
128     enum MySQLCollation utf16_esperanto_ci = MySQLCollation("utf16_esperanto_ci", "utf16", "UTF-16", 118);
129     enum MySQLCollation utf16_hungarian_ci = MySQLCollation("utf16_hungarian_ci", "utf16", "UTF-16", 119);
130     enum MySQLCollation utf16_sinhala_ci = MySQLCollation("utf16_sinhala_ci", "utf16", "UTF-16", 120);
131     enum MySQLCollation utf16_german2_ci = MySQLCollation("utf16_german2_ci", "utf16", "UTF-16", 121);
132     enum MySQLCollation utf16_croatian_ci = MySQLCollation("utf16_croatian_ci", "utf16", "UTF-16", 122);
133     enum MySQLCollation utf16_unicode_520_ci = MySQLCollation("utf16_unicode_520_ci", "utf16", "UTF-16", 123);
134     enum MySQLCollation utf16_vietnamese_ci = MySQLCollation("utf16_vietnamese_ci", "utf16", "UTF-16", 124);
135     enum MySQLCollation ucs2_unicode_ci = MySQLCollation("ucs2_unicode_ci", "ucs2", "UnicodeBig", 128);
136     enum MySQLCollation ucs2_icelandic_ci = MySQLCollation("ucs2_icelandic_ci", "ucs2", "UnicodeBig", 129);
137     enum MySQLCollation ucs2_latvian_ci = MySQLCollation("ucs2_latvian_ci", "ucs2", "UnicodeBig", 130);
138     enum MySQLCollation ucs2_romanian_ci = MySQLCollation("ucs2_romanian_ci", "ucs2", "UnicodeBig", 131);
139     enum MySQLCollation ucs2_slovenian_ci = MySQLCollation("ucs2_slovenian_ci", "ucs2", "UnicodeBig", 132);
140     enum MySQLCollation ucs2_polish_ci = MySQLCollation("ucs2_polish_ci", "ucs2", "UnicodeBig", 133);
141     enum MySQLCollation ucs2_estonian_ci = MySQLCollation("ucs2_estonian_ci", "ucs2", "UnicodeBig", 134);
142     enum MySQLCollation ucs2_spanish_ci = MySQLCollation("ucs2_spanish_ci", "ucs2", "UnicodeBig", 135);
143     enum MySQLCollation ucs2_swedish_ci = MySQLCollation("ucs2_swedish_ci", "ucs2", "UnicodeBig", 136);
144     enum MySQLCollation ucs2_turkish_ci = MySQLCollation("ucs2_turkish_ci", "ucs2", "UnicodeBig", 137);
145     enum MySQLCollation ucs2_czech_ci = MySQLCollation("ucs2_czech_ci", "ucs2", "UnicodeBig", 138);
146     enum MySQLCollation ucs2_danish_ci = MySQLCollation("ucs2_danish_ci", "ucs2", "UnicodeBig", 139);
147     enum MySQLCollation ucs2_lithuanian_ci = MySQLCollation("ucs2_lithuanian_ci", "ucs2", "UnicodeBig", 140);
148     enum MySQLCollation ucs2_slovak_ci = MySQLCollation("ucs2_slovak_ci", "ucs2", "UnicodeBig", 141);
149     enum MySQLCollation ucs2_spanish2_ci = MySQLCollation("ucs2_spanish2_ci", "ucs2", "UnicodeBig", 142);
150     enum MySQLCollation ucs2_roman_ci = MySQLCollation("ucs2_roman_ci", "ucs2", "UnicodeBig", 143);
151     enum MySQLCollation ucs2_persian_ci = MySQLCollation("ucs2_persian_ci", "ucs2", "UnicodeBig", 144);
152     enum MySQLCollation ucs2_esperanto_ci = MySQLCollation("ucs2_esperanto_ci", "ucs2", "UnicodeBig", 145);
153     enum MySQLCollation ucs2_hungarian_ci = MySQLCollation("ucs2_hungarian_ci", "ucs2", "UnicodeBig", 146);
154     enum MySQLCollation ucs2_sinhala_ci = MySQLCollation("ucs2_sinhala_ci", "ucs2", "UnicodeBig", 147);
155     enum MySQLCollation ucs2_german2_ci = MySQLCollation("ucs2_german2_ci", "ucs2", "UnicodeBig", 148);
156     enum MySQLCollation ucs2_croatian_ci = MySQLCollation("ucs2_croatian_ci", "ucs2", "UnicodeBig", 149);
157     enum MySQLCollation ucs2_unicode_520_ci = MySQLCollation("ucs2_unicode_520_ci", "ucs2", "UnicodeBig", 150);
158     enum MySQLCollation ucs2_vietnamese_ci = MySQLCollation("ucs2_vietnamese_ci", "ucs2", "UnicodeBig", 151);
159     enum MySQLCollation ucs2_general_mysql500_ci = MySQLCollation("ucs2_general_mysql500_ci", "ucs2", "UnicodeBig", 159);
160     enum MySQLCollation utf32_unicode_ci = MySQLCollation("utf32_unicode_ci", "utf32", "UTF-32", 160);
161     enum MySQLCollation utf32_icelandic_ci = MySQLCollation("utf32_icelandic_ci", "utf32", "UTF-32", 161);
162     enum MySQLCollation utf32_latvian_ci = MySQLCollation("utf32_latvian_ci", "utf32", "UTF-32", 162);
163     enum MySQLCollation utf32_romanian_ci = MySQLCollation("utf32_romanian_ci", "utf32", "UTF-32", 163);
164     enum MySQLCollation utf32_slovenian_ci = MySQLCollation("utf32_slovenian_ci", "utf32", "UTF-32", 164);
165     enum MySQLCollation utf32_polish_ci = MySQLCollation("utf32_polish_ci", "utf32", "UTF-32", 165);
166     enum MySQLCollation utf32_estonian_ci = MySQLCollation("utf32_estonian_ci", "utf32", "UTF-32", 166);
167     enum MySQLCollation utf32_spanish_ci = MySQLCollation("utf32_spanish_ci", "utf32", "UTF-32", 167);
168     enum MySQLCollation utf32_swedish_ci = MySQLCollation("utf32_swedish_ci", "utf32", "UTF-32", 168);
169     enum MySQLCollation utf32_turkish_ci = MySQLCollation("utf32_turkish_ci", "utf32", "UTF-32", 169);
170     enum MySQLCollation utf32_czech_ci = MySQLCollation("utf32_czech_ci", "utf32", "UTF-32", 170);
171     enum MySQLCollation utf32_danish_ci = MySQLCollation("utf32_danish_ci", "utf32", "UTF-32", 171);
172     enum MySQLCollation utf32_lithuanian_ci = MySQLCollation("utf32_lithuanian_ci", "utf32", "UTF-32", 172);
173     enum MySQLCollation utf32_slovak_ci = MySQLCollation("utf32_slovak_ci", "utf32", "UTF-32", 173);
174     enum MySQLCollation utf32_spanish2_ci = MySQLCollation("utf32_spanish2_ci", "utf32", "UTF-32", 174);
175     enum MySQLCollation utf32_roman_ci = MySQLCollation("utf32_roman_ci", "utf32", "UTF-32", 175);
176     enum MySQLCollation utf32_persian_ci = MySQLCollation("utf32_persian_ci", "utf32", "UTF-32", 176);
177     enum MySQLCollation utf32_esperanto_ci = MySQLCollation("utf32_esperanto_ci", "utf32", "UTF-32", 177);
178     enum MySQLCollation utf32_hungarian_ci = MySQLCollation("utf32_hungarian_ci", "utf32", "UTF-32", 178);
179     enum MySQLCollation utf32_sinhala_ci = MySQLCollation("utf32_sinhala_ci", "utf32", "UTF-32", 179);
180     enum MySQLCollation utf32_german2_ci = MySQLCollation("utf32_german2_ci", "utf32", "UTF-32", 180);
181     enum MySQLCollation utf32_croatian_ci = MySQLCollation("utf32_croatian_ci", "utf32", "UTF-32", 181);
182     enum MySQLCollation utf32_unicode_520_ci = MySQLCollation("utf32_unicode_520_ci", "utf32", "UTF-32", 182);
183     enum MySQLCollation utf32_vietnamese_ci = MySQLCollation("utf32_vietnamese_ci", "utf32", "UTF-32", 183);
184     enum MySQLCollation utf8_unicode_ci = MySQLCollation("utf8_unicode_ci", "utf8", "UTF-8", 192);
185     enum MySQLCollation utf8_icelandic_ci = MySQLCollation("utf8_icelandic_ci", "utf8", "UTF-8", 193);
186     enum MySQLCollation utf8_latvian_ci = MySQLCollation("utf8_latvian_ci", "utf8", "UTF-8", 194);
187     enum MySQLCollation utf8_romanian_ci = MySQLCollation("utf8_romanian_ci", "utf8", "UTF-8", 195);
188     enum MySQLCollation utf8_slovenian_ci = MySQLCollation("utf8_slovenian_ci", "utf8", "UTF-8", 196);
189     enum MySQLCollation utf8_polish_ci = MySQLCollation("utf8_polish_ci", "utf8", "UTF-8", 197);
190     enum MySQLCollation utf8_estonian_ci = MySQLCollation("utf8_estonian_ci", "utf8", "UTF-8", 198);
191     enum MySQLCollation utf8_spanish_ci = MySQLCollation("utf8_spanish_ci", "utf8", "UTF-8", 199);
192     enum MySQLCollation utf8_swedish_ci = MySQLCollation("utf8_swedish_ci", "utf8", "UTF-8", 200);
193     enum MySQLCollation utf8_turkish_ci = MySQLCollation("utf8_turkish_ci", "utf8", "UTF-8", 201);
194     enum MySQLCollation utf8_czech_ci = MySQLCollation("utf8_czech_ci", "utf8", "UTF-8", 202);
195     enum MySQLCollation utf8_danish_ci = MySQLCollation("utf8_danish_ci", "utf8", "UTF-8", 203);
196     enum MySQLCollation utf8_lithuanian_ci = MySQLCollation("utf8_lithuanian_ci", "utf8", "UTF-8", 204);
197     enum MySQLCollation utf8_slovak_ci = MySQLCollation("utf8_slovak_ci", "utf8", "UTF-8", 205);
198     enum MySQLCollation utf8_spanish2_ci = MySQLCollation("utf8_spanish2_ci", "utf8", "UTF-8", 206);
199     enum MySQLCollation utf8_roman_ci = MySQLCollation("utf8_roman_ci", "utf8", "UTF-8", 207);
200     enum MySQLCollation utf8_persian_ci = MySQLCollation("utf8_persian_ci", "utf8", "UTF-8", 208);
201     enum MySQLCollation utf8_esperanto_ci = MySQLCollation("utf8_esperanto_ci", "utf8", "UTF-8", 209);
202     enum MySQLCollation utf8_hungarian_ci = MySQLCollation("utf8_hungarian_ci", "utf8", "UTF-8", 210);
203     enum MySQLCollation utf8_sinhala_ci = MySQLCollation("utf8_sinhala_ci", "utf8", "UTF-8", 211);
204     enum MySQLCollation utf8_german2_ci = MySQLCollation("utf8_german2_ci", "utf8", "UTF-8", 212);
205     enum MySQLCollation utf8_croatian_ci = MySQLCollation("utf8_croatian_ci", "utf8", "UTF-8", 213);
206     enum MySQLCollation utf8_unicode_520_ci = MySQLCollation("utf8_unicode_520_ci", "utf8", "UTF-8", 214);
207     enum MySQLCollation utf8_vietnamese_ci = MySQLCollation("utf8_vietnamese_ci", "utf8", "UTF-8", 215);
208     enum MySQLCollation utf8_general_mysql500_ci = MySQLCollation("utf8_general_mysql500_ci", "utf8", "UTF-8", 223);
209     enum MySQLCollation utf8mb4_unicode_ci = MySQLCollation("utf8mb4_unicode_ci", "utf8mb4", "UTF-8", 224);
210     enum MySQLCollation utf8mb4_icelandic_ci = MySQLCollation("utf8mb4_icelandic_ci", "utf8mb4", "UTF-8", 225);
211     enum MySQLCollation utf8mb4_latvian_ci = MySQLCollation("utf8mb4_latvian_ci", "utf8mb4", "UTF-8", 226);
212     enum MySQLCollation utf8mb4_romanian_ci = MySQLCollation("utf8mb4_romanian_ci", "utf8mb4", "UTF-8", 227);
213     enum MySQLCollation utf8mb4_slovenian_ci = MySQLCollation("utf8mb4_slovenian_ci", "utf8mb4", "UTF-8", 228);
214     enum MySQLCollation utf8mb4_polish_ci = MySQLCollation("utf8mb4_polish_ci", "utf8mb4", "UTF-8", 229);
215     enum MySQLCollation utf8mb4_estonian_ci = MySQLCollation("utf8mb4_estonian_ci", "utf8mb4", "UTF-8", 230);
216     enum MySQLCollation utf8mb4_spanish_ci = MySQLCollation("utf8mb4_spanish_ci", "utf8mb4", "UTF-8", 231);
217     enum MySQLCollation utf8mb4_swedish_ci = MySQLCollation("utf8mb4_swedish_ci", "utf8mb4", "UTF-8", 232);
218     enum MySQLCollation utf8mb4_turkish_ci = MySQLCollation("utf8mb4_turkish_ci", "utf8mb4", "UTF-8", 233);
219     enum MySQLCollation utf8mb4_czech_ci = MySQLCollation("utf8mb4_czech_ci", "utf8mb4", "UTF-8", 234);
220     enum MySQLCollation utf8mb4_danish_ci = MySQLCollation("utf8mb4_danish_ci", "utf8mb4", "UTF-8", 235);
221     enum MySQLCollation utf8mb4_lithuanian_ci = MySQLCollation("utf8mb4_lithuanian_ci", "utf8mb4", "UTF-8", 236);
222     enum MySQLCollation utf8mb4_slovak_ci = MySQLCollation("utf8mb4_slovak_ci", "utf8mb4", "UTF-8", 237);
223     enum MySQLCollation utf8mb4_spanish2_ci = MySQLCollation("utf8mb4_spanish2_ci", "utf8mb4", "UTF-8", 238);
224     enum MySQLCollation utf8mb4_roman_ci = MySQLCollation("utf8mb4_roman_ci", "utf8mb4", "UTF-8", 239);
225     enum MySQLCollation utf8mb4_persian_ci = MySQLCollation("utf8mb4_persian_ci", "utf8mb4", "UTF-8", 240);
226     enum MySQLCollation utf8mb4_esperanto_ci = MySQLCollation("utf8mb4_esperanto_ci", "utf8mb4", "UTF-8", 241);
227     enum MySQLCollation utf8mb4_hungarian_ci = MySQLCollation("utf8mb4_hungarian_ci", "utf8mb4", "UTF-8", 242);
228     enum MySQLCollation utf8mb4_sinhala_ci = MySQLCollation("utf8mb4_sinhala_ci", "utf8mb4", "UTF-8", 243);
229     enum MySQLCollation utf8mb4_german2_ci = MySQLCollation("utf8mb4_german2_ci", "utf8mb4", "UTF-8", 244);
230     enum MySQLCollation utf8mb4_croatian_ci = MySQLCollation("utf8mb4_croatian_ci", "utf8mb4", "UTF-8", 245);
231     enum MySQLCollation utf8mb4_unicode_520_ci = MySQLCollation("utf8mb4_unicode_520_ci", "utf8mb4", "UTF-8", 246);
232     enum MySQLCollation utf8mb4_vietnamese_ci = MySQLCollation("utf8mb4_vietnamese_ci", "utf8mb4", "UTF-8", 247);
233     enum MySQLCollation gb18030_chinese_ci = MySQLCollation("gb18030_chinese_ci", "gb18030", "GB18030", 248);
234     enum MySQLCollation gb18030_bin = MySQLCollation("gb18030_bin", "gb18030", "GB18030", 249);
235     enum MySQLCollation gb18030_unicode_520_ci = MySQLCollation("gb18030_unicode_520_ci", "gb18030", "GB18030", 250);
236 
237     enum string[string] charsetToDefaultCollationMapping = [
238         "big5" : "big5_chinese_ci",
239         "dec8" : "dec8_swedish_ci",
240         "cp850" : "cp850_general_ci",
241         "hp8" : "hp8_english_ci",
242         "koi8r" : "koi8r_general_ci",
243         "latin1" : "latin1_swedish_ci",
244         "latin2" : "latin2_general_ci",
245         "swe7" : "swe7_swedish_ci",
246         "ascii" : "ascii_general_ci",
247         "ujis" : "ujis_japanese_ci",
248         "sjis" : "sjis_japanese_ci",
249         "hebrew" : "hebrew_general_ci",
250         "tis620" : "tis620_thai_ci",
251         "euckr" : "euckr_korean_ci",
252         "koi8u" : "koi8u_general_ci",
253         "gb2312" : "gb2312_chinese_ci",
254         "greek" : "greek_general_ci",
255         "cp1250" : "cp1250_general_ci",
256         "gbk" : "gbk_chinese_ci",
257         "latin5" : "latin5_turkish_ci",
258         "armscii8" : "armscii8_general_ci",
259         "utf8" : "utf8_general_ci",
260         "ucs2" : "ucs2_general_ci",
261         "cp866" : "cp866_general_ci",
262         "keybcs2" : "keybcs2_general_ci",
263         "macce" : "macce_general_ci",
264         "macroman" : "macroman_general_ci",
265         "cp852" : "cp852_general_ci",
266         "latin7" : "latin7_general_ci",
267         "utf8mb4" : "utf8mb4_general_ci",
268         "cp1251" : "cp1251_general_ci",
269         "utf16" : "utf16_general_ci",
270         "utf16le" : "utf16le_general_ci",
271         "cp1256" : "cp1256_general_ci",
272         "cp1257" : "cp1257_general_ci",
273         "utf32" : "utf32_general_ci",
274         "binary" : "binary",
275         "geostd8" : "geostd8_general_ci",
276         "cp932" : "cp932_japanese_ci",
277         "eucjpms" : "eucjpms_japanese_ci",
278         "gb18030" : "gb18030_chinese_ci"
279     ];
280 
281 
282     mixin ValuesMemberTempate!MySQLCollation;
283 
284     private string _name;
285     private string _mysqlCharsetName;
286     private string _mappedCharsetName;
287     private int _collationId;
288 
289     this(string name, string mysqlCharsetName, string mappedCharsetName, int collationId) {
290         this._name = name;
291         this._mysqlCharsetName = mysqlCharsetName;
292         this._mappedCharsetName = mappedCharsetName;
293         this._collationId = collationId;
294     }
295 
296     static MySQLCollation valueOf(string collationName) {
297         auto itemPtr = collationName in namedValues();
298         if(itemPtr !is null) {
299             return *itemPtr;
300         }
301         
302         throw new IllegalArgumentException(collationName);
303     }
304     
305 
306     static MySQLCollation valueOfName(string collationName) {
307         try {
308             return MySQLCollation.valueOf(collationName);
309         } catch (IllegalArgumentException e) {
310             throw new IllegalArgumentException("Unknown MySQL collation: [" ~ collationName ~ "]");
311         }
312     }
313 
314     /**
315      * Get the MySQL collation with a correlative collation id.
316      *
317      * @param collationId id of the collation
318      * @return the collation
319      */
320     static MySQLCollation valueOfId(int collationId) {
321         switch (collationId) {
322             case 1:
323                 return big5_chinese_ci;
324             case 2:
325                 return latin2_czech_cs;
326             case 3:
327                 return dec8_swedish_ci;
328             case 4:
329                 return cp850_general_ci;
330             case 5:
331                 return latin1_german1_ci;
332             case 6:
333                 return hp8_english_ci;
334             case 7:
335                 return koi8r_general_ci;
336             case 8:
337                 return latin1_swedish_ci;
338             case 9:
339                 return latin2_general_ci;
340             case 10:
341                 return swe7_swedish_ci;
342             case 11:
343                 return ascii_general_ci;
344             case 12:
345                 return ujis_japanese_ci;
346             case 13:
347                 return sjis_japanese_ci;
348             case 14:
349                 return cp1251_bulgarian_ci;
350             case 15:
351                 return latin1_danish_ci;
352             case 16:
353                 return hebrew_general_ci;
354             case 18:
355                 return tis620_thai_ci;
356             case 19:
357                 return euckr_korean_ci;
358             case 20:
359                 return latin7_estonian_cs;
360             case 21:
361                 return latin2_hungarian_ci;
362             case 22:
363                 return koi8u_general_ci;
364             case 23:
365                 return cp1251_ukrainian_ci;
366             case 24:
367                 return gb2312_chinese_ci;
368             case 25:
369                 return greek_general_ci;
370             case 26:
371                 return cp1250_general_ci;
372             case 27:
373                 return latin2_croatian_ci;
374             case 28:
375                 return gbk_chinese_ci;
376             case 29:
377                 return cp1257_lithuanian_ci;
378             case 30:
379                 return latin5_turkish_ci;
380             case 31:
381                 return latin1_german2_ci;
382             case 32:
383                 return armscii8_general_ci;
384             case 33:
385                 return utf8_general_ci;
386             case 34:
387                 return cp1250_czech_cs;
388             case 35:
389                 return ucs2_general_ci;
390             case 36:
391                 return cp866_general_ci;
392             case 37:
393                 return keybcs2_general_ci;
394             case 38:
395                 return macce_general_ci;
396             case 39:
397                 return macroman_general_ci;
398             case 40:
399                 return cp852_general_ci;
400             case 41:
401                 return latin7_general_ci;
402             case 42:
403                 return latin7_general_cs;
404             case 43:
405                 return macce_bin;
406             case 44:
407                 return cp1250_croatian_ci;
408             case 45:
409                 return utf8mb4_general_ci;
410             case 46:
411                 return utf8mb4_bin;
412             case 47:
413                 return latin1_bin;
414             case 48:
415                 return latin1_general_ci;
416             case 49:
417                 return latin1_general_cs;
418             case 50:
419                 return cp1251_bin;
420             case 51:
421                 return cp1251_general_ci;
422             case 52:
423                 return cp1251_general_cs;
424             case 53:
425                 return macroman_bin;
426             case 54:
427                 return utf16_general_ci;
428             case 55:
429                 return utf16_bin;
430             case 56:
431                 return utf16le_general_ci;
432             case 57:
433                 return cp1256_general_ci;
434             case 58:
435                 return cp1257_bin;
436             case 59:
437                 return cp1257_general_ci;
438             case 60:
439                 return utf32_general_ci;
440             case 61:
441                 return utf32_bin;
442             case 62:
443                 return utf16le_bin;
444             case 63:
445                 return binary;
446             case 64:
447                 return armscii8_bin;
448             case 65:
449                 return ascii_bin;
450             case 66:
451                 return cp1250_bin;
452             case 67:
453                 return cp1256_bin;
454             case 68:
455                 return cp866_bin;
456             case 69:
457                 return dec8_bin;
458             case 70:
459                 return greek_bin;
460             case 71:
461                 return hebrew_bin;
462             case 72:
463                 return hp8_bin;
464             case 73:
465                 return keybcs2_bin;
466             case 74:
467                 return koi8r_bin;
468             case 75:
469                 return koi8u_bin;
470             case 77:
471                 return latin2_bin;
472             case 78:
473                 return latin5_bin;
474             case 79:
475                 return latin7_bin;
476             case 80:
477                 return cp850_bin;
478             case 81:
479                 return cp852_bin;
480             case 82:
481                 return swe7_bin;
482             case 83:
483                 return utf8_bin;
484             case 84:
485                 return big5_bin;
486             case 85:
487                 return euckr_bin;
488             case 86:
489                 return gb2312_bin;
490             case 87:
491                 return gbk_bin;
492             case 88:
493                 return sjis_bin;
494             case 89:
495                 return tis620_bin;
496             case 90:
497                 return ucs2_bin;
498             case 91:
499                 return ujis_bin;
500             case 92:
501                 return geostd8_general_ci;
502             case 93:
503                 return geostd8_bin;
504             case 94:
505                 return latin1_spanish_ci;
506             case 95:
507                 return cp932_japanese_ci;
508             case 96:
509                 return cp932_bin;
510             case 97:
511                 return eucjpms_japanese_ci;
512             case 98:
513                 return eucjpms_bin;
514             case 99:
515                 return cp1250_polish_ci;
516             case 101:
517                 return utf16_unicode_ci;
518             case 102:
519                 return utf16_icelandic_ci;
520             case 103:
521                 return utf16_latvian_ci;
522             case 104:
523                 return utf16_romanian_ci;
524             case 105:
525                 return utf16_slovenian_ci;
526             case 106:
527                 return utf16_polish_ci;
528             case 107:
529                 return utf16_estonian_ci;
530             case 108:
531                 return utf16_spanish_ci;
532             case 109:
533                 return utf16_swedish_ci;
534             case 110:
535                 return utf16_turkish_ci;
536             case 111:
537                 return utf16_czech_ci;
538             case 112:
539                 return utf16_danish_ci;
540             case 113:
541                 return utf16_lithuanian_ci;
542             case 114:
543                 return utf16_slovak_ci;
544             case 115:
545                 return utf16_spanish2_ci;
546             case 116:
547                 return utf16_roman_ci;
548             case 117:
549                 return utf16_persian_ci;
550             case 118:
551                 return utf16_esperanto_ci;
552             case 119:
553                 return utf16_hungarian_ci;
554             case 120:
555                 return utf16_sinhala_ci;
556             case 121:
557                 return utf16_german2_ci;
558             case 122:
559                 return utf16_croatian_ci;
560             case 123:
561                 return utf16_unicode_520_ci;
562             case 124:
563                 return utf16_vietnamese_ci;
564             case 128:
565                 return ucs2_unicode_ci;
566             case 129:
567                 return ucs2_icelandic_ci;
568             case 130:
569                 return ucs2_latvian_ci;
570             case 131:
571                 return ucs2_romanian_ci;
572             case 132:
573                 return ucs2_slovenian_ci;
574             case 133:
575                 return ucs2_polish_ci;
576             case 134:
577                 return ucs2_estonian_ci;
578             case 135:
579                 return ucs2_spanish_ci;
580             case 136:
581                 return ucs2_swedish_ci;
582             case 137:
583                 return ucs2_turkish_ci;
584             case 138:
585                 return ucs2_czech_ci;
586             case 139:
587                 return ucs2_danish_ci;
588             case 140:
589                 return ucs2_lithuanian_ci;
590             case 141:
591                 return ucs2_slovak_ci;
592             case 142:
593                 return ucs2_spanish2_ci;
594             case 143:
595                 return ucs2_roman_ci;
596             case 144:
597                 return ucs2_persian_ci;
598             case 145:
599                 return ucs2_esperanto_ci;
600             case 146:
601                 return ucs2_hungarian_ci;
602             case 147:
603                 return ucs2_sinhala_ci;
604             case 148:
605                 return ucs2_german2_ci;
606             case 149:
607                 return ucs2_croatian_ci;
608             case 150:
609                 return ucs2_unicode_520_ci;
610             case 151:
611                 return ucs2_vietnamese_ci;
612             case 159:
613                 return ucs2_general_mysql500_ci;
614             case 160:
615                 return utf32_unicode_ci;
616             case 161:
617                 return utf32_icelandic_ci;
618             case 162:
619                 return utf32_latvian_ci;
620             case 163:
621                 return utf32_romanian_ci;
622             case 164:
623                 return utf32_slovenian_ci;
624             case 165:
625                 return utf32_polish_ci;
626             case 166:
627                 return utf32_estonian_ci;
628             case 167:
629                 return utf32_spanish_ci;
630             case 168:
631                 return utf32_swedish_ci;
632             case 169:
633                 return utf32_turkish_ci;
634             case 170:
635                 return utf32_czech_ci;
636             case 171:
637                 return utf32_danish_ci;
638             case 172:
639                 return utf32_lithuanian_ci;
640             case 173:
641                 return utf32_slovak_ci;
642             case 174:
643                 return utf32_spanish2_ci;
644             case 175:
645                 return utf32_roman_ci;
646             case 176:
647                 return utf32_persian_ci;
648             case 177:
649                 return utf32_esperanto_ci;
650             case 178:
651                 return utf32_hungarian_ci;
652             case 179:
653                 return utf32_sinhala_ci;
654             case 180:
655                 return utf32_german2_ci;
656             case 181:
657                 return utf32_croatian_ci;
658             case 182:
659                 return utf32_unicode_520_ci;
660             case 183:
661                 return utf32_vietnamese_ci;
662             case 192:
663                 return utf8_unicode_ci;
664             case 193:
665                 return utf8_icelandic_ci;
666             case 194:
667                 return utf8_latvian_ci;
668             case 195:
669                 return utf8_romanian_ci;
670             case 196:
671                 return utf8_slovenian_ci;
672             case 197:
673                 return utf8_polish_ci;
674             case 198:
675                 return utf8_estonian_ci;
676             case 199:
677                 return utf8_spanish_ci;
678             case 200:
679                 return utf8_swedish_ci;
680             case 201:
681                 return utf8_turkish_ci;
682             case 202:
683                 return utf8_czech_ci;
684             case 203:
685                 return utf8_danish_ci;
686             case 204:
687                 return utf8_lithuanian_ci;
688             case 205:
689                 return utf8_slovak_ci;
690             case 206:
691                 return utf8_spanish2_ci;
692             case 207:
693                 return utf8_roman_ci;
694             case 208:
695                 return utf8_persian_ci;
696             case 209:
697                 return utf8_esperanto_ci;
698             case 210:
699                 return utf8_hungarian_ci;
700             case 211:
701                 return utf8_sinhala_ci;
702             case 212:
703                 return utf8_german2_ci;
704             case 213:
705                 return utf8_croatian_ci;
706             case 214:
707                 return utf8_unicode_520_ci;
708             case 215:
709                 return utf8_vietnamese_ci;
710             case 223:
711                 return utf8_general_mysql500_ci;
712             case 224:
713                 return utf8mb4_unicode_ci;
714             case 225:
715                 return utf8mb4_icelandic_ci;
716             case 226:
717                 return utf8mb4_latvian_ci;
718             case 227:
719                 return utf8mb4_romanian_ci;
720             case 228:
721                 return utf8mb4_slovenian_ci;
722             case 229:
723                 return utf8mb4_polish_ci;
724             case 230:
725                 return utf8mb4_estonian_ci;
726             case 231:
727                 return utf8mb4_spanish_ci;
728             case 232:
729                 return utf8mb4_swedish_ci;
730             case 233:
731                 return utf8mb4_turkish_ci;
732             case 234:
733                 return utf8mb4_czech_ci;
734             case 235:
735                 return utf8mb4_danish_ci;
736             case 236:
737                 return utf8mb4_lithuanian_ci;
738             case 237:
739                 return utf8mb4_slovak_ci;
740             case 238:
741                 return utf8mb4_spanish2_ci;
742             case 239:
743                 return utf8mb4_roman_ci;
744             case 240:
745                 return utf8mb4_persian_ci;
746             case 241:
747                 return utf8mb4_esperanto_ci;
748             case 242:
749                 return utf8mb4_hungarian_ci;
750             case 243:
751                 return utf8mb4_sinhala_ci;
752             case 244:
753                 return utf8mb4_german2_ci;
754             case 245:
755                 return utf8mb4_croatian_ci;
756             case 246:
757                 return utf8mb4_unicode_520_ci;
758             case 247:
759                 return utf8mb4_vietnamese_ci;
760             case 248:
761                 return gb18030_chinese_ci;
762             case 249:
763                 return gb18030_bin;
764             case 250:
765                 return gb18030_unicode_520_ci;
766             default:
767                 throw new UnsupportedOperationException("Collation of Id [" ~ 
768                     collationId.to!string() ~ "] is unknown to this client");
769         }
770     }
771 
772     static string getDefaultCollationFromCharsetName(string charset) {
773         string defaultCollationName = charsetToDefaultCollationMapping.get(charset, null);
774         if (defaultCollationName.empty()) {
775             throw new IllegalArgumentException("Unknown charset name: [" ~ charset ~ "]");
776         } else {
777             return defaultCollationName;
778         }
779     }
780 
781     string name() {
782         return _name;
783     }
784 
785     /**
786      * Get the binding MySQL charset name for this collation.
787      *
788      * @return the binding MySQL charset name
789      */
790     string mysqlCharsetName() {
791         return _mysqlCharsetName;
792     }
793 
794     /**
795      * Get the mapped charset name which is mapped from the collation.
796      *
797      * @return the mapped charset name
798      */
799     string mappedCharsetName() {
800         return _mappedCharsetName;
801     }
802 
803     /**
804      * Get the collation Id of this collation
805      *
806      * @return the collation Id
807      */
808     int collationId() {
809         return _collationId;
810     }
811 }