-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
275 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...db-plugins/chat2db-mysql/src/main/java/ai/chat2db/plugin/mysql/type/MysqlCharsetEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package ai.chat2db.plugin.mysql.type; | ||
|
||
import ai.chat2db.spi.model.Charset; | ||
import org.checkerframework.checker.units.qual.C; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public enum MysqlCharsetEnum { | ||
|
||
UTF8("utf8", "utf8_general_ci"), | ||
BIG5("big5", "big5_chinese_ci"), | ||
DEC8("dec8", "dec8_swedish_ci"), | ||
CP850("cp850", "cp850_general_ci"), | ||
HP8("hp8", "hp8_english_ci"), | ||
KOI8R("koi8r", "koi8r_general_ci"), | ||
LATIN1("latin1", "latin1_swedish_ci"), | ||
LATIN2("latin2", "latin2_general_ci"), | ||
SWE7("swe7", "swe7_swedish_ci"), | ||
ASCII("ascii", "ascii_general_ci"), | ||
UJIS("ujis", "ujis_japanese_ci"), | ||
SJIS("sjis", "sjis_japanese_ci"), | ||
HEBREW("hebrew", "hebrew_general_ci"), | ||
TIS620("tis620", "tis620_thai_ci"), | ||
EUCKR("euckr", "euckr_korean_ci"), | ||
KOI8U("koi8u", "koi8u_general_ci"), | ||
GB2312("gb2312", "gb2312_chinese_ci"), | ||
GREEK("greek", "greek_general_ci"), | ||
CP1250("cp1250", "cp1250_general_ci"), | ||
GBK("gbk", "gbk_chinese_ci"), | ||
LATIN5("latin5", "latin5_turkish_ci"), | ||
ARMSCII8("armscii8", "armscii8_general_ci"), | ||
UCS2("ucs2", "ucs2_general_ci"), | ||
CP866("cp866", "cp866_general_ci"), | ||
KEYBCS2("keybcs2", "keybcs2_general_ci"), | ||
MACCE("macce", "macce_general_ci"), | ||
MACROMAN("macroman", "macroman_general_ci"), | ||
CP852("cp852", "cp852_general_ci"), | ||
LATIN7("latin7", "latin7_general_ci"), | ||
UTF8MB4("utf8mb4", "utf8mb4_general_ci"), | ||
CP1251("cp1251", "cp1251_general_ci"), | ||
UTF16("utf16", "utf16_general_ci"), | ||
UTF16LE("utf16le", "utf16le_general_ci"), | ||
CP1256("cp1256", "cp1256_general_ci"), | ||
CP1257("cp1257", "cp1257_general_ci"), | ||
UTF32("utf32", "utf32_general_ci"), | ||
BINARY("binary", "binary"), | ||
GEOSTD8("geostd8", "geostd8_general_ci"), | ||
CP932("cp932", "cp932_japanese_ci"), | ||
EUCJPMS("eucjpms", "eucjpms_japanese_ci"), | ||
GB18030("gb18030", "gb18030_chinese_ci"); | ||
private Charset charset; | ||
|
||
MysqlCharsetEnum(String charsetName, String defaultCollationName) { | ||
this.charset = new Charset(charsetName, defaultCollationName); | ||
} | ||
|
||
|
||
public Charset getCharset() { | ||
return charset; | ||
} | ||
|
||
public static List<Charset> getCharsets() { | ||
return Arrays.stream(MysqlCharsetEnum.values()).map(MysqlCharsetEnum::getCharset).collect(java.util.stream.Collectors.toList()); | ||
} | ||
|
||
} |
69 changes: 69 additions & 0 deletions
69
...-plugins/chat2db-mysql/src/main/java/ai/chat2db/plugin/mysql/type/MysqlCollationEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package ai.chat2db.plugin.mysql.type; | ||
|
||
import ai.chat2db.spi.model.Collation; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public enum MysqlCollationEnum { | ||
|
||
UTF8_GENERAL_CI("utf8_general_ci"), | ||
|
||
UTF8MB4_GENERAL_CI("utf8mb4_general_ci"), | ||
|
||
BIG5_CHINESE_CI("big5_chinese_ci"), | ||
DEC8_SWEDISH_CI("dec8_swedish_ci"), | ||
|
||
HP8_ENGLISH_CI("hp8_english_ci"), | ||
KOI8R_GENERAL_CI("koi8r_general_ci"), | ||
LATIN1_SWEDISH_CI("latin1_swedish_ci"), | ||
LATIN2_GENERAL_CI("latin2_general_ci"), | ||
SWE7_SWEDISH_CI("swe7_swedish_ci"), | ||
ASCII_GENERAL_CI("ascii_general_ci"), | ||
UJIS_JAPANESE_CI("ujis_japanese_ci"), | ||
SJIS_JAPANESE_CI("sjis_japanese_ci"), | ||
HEBREW_GENERAL_CI("hebrew_general_ci"), | ||
TIS620_THAI_CI("tis620_thai_ci"), | ||
EUCKR_KOREAN_CI("euckr_korean_ci"), | ||
KOI8U_GENERAL_CI("koi8u_general_ci"), | ||
GB2312_CHINESE_CI("gb2312_chinese_ci"), | ||
GREEK_GENERAL_CI("greek_general_ci"), | ||
CP1250_GENERAL_CI("cp1250_general_ci"), | ||
GBK_CHINESE_CI("gbk_chinese_ci"), | ||
LATIN5_TURKISH_CI("latin5_turkish_ci"), | ||
ARMSCII8_GENERAL_CI("armscii8_general_ci"), | ||
CP1250_CZECH_CS("cp1250_czech_cs"), | ||
UCS2_GENERAL_CI("ucs2_general_ci"), | ||
CP866_GENERAL_CI("cp866_general_ci"), | ||
KEYBCS2_GENERAL_CI("keybcs2_general_ci"), | ||
MACCE_GENERAL_CI("macce_general_ci"), | ||
MACROMAN_GENERAL_CI("macroman_general_ci"), | ||
CP852_GENERAL_CI("cp852_general_ci"), | ||
LATIN7_GENERAL_CI("latin7_general_ci"), | ||
CP1251_GENERAL_CI("cp1251_general_ci"), | ||
UTF16_GENERAL_CI("utf16_general_ci"), | ||
UTF16LE_GENERAL_CI("utf16le_general_ci"), | ||
CP1256_GENERAL_CI("cp1256_general_ci"), | ||
CP1257_GENERAL_CI("cp1257_general_ci"), | ||
UTF32_GENERAL_CI("utf32_general_ci"), | ||
BINARY("binary"), | ||
GEOSTD8_GENERAL_CI("geostd8_general_ci"), | ||
CP932_JAPANESE_CI("cp932_japanese_ci"), | ||
EUCJPMS_JAPANESE_CI("eucjpms_japanese_ci"), | ||
GB18030_CHINESE_CI("gb18030_chinese_ci"), | ||
; | ||
private Collation collation; | ||
|
||
MysqlCollationEnum(String collationName) { | ||
this.collation = new Collation(collationName); | ||
} | ||
|
||
public Collation getCollation() { | ||
return collation; | ||
} | ||
|
||
public static List<Collation> getCollations() { | ||
return Arrays.asList(MysqlCollationEnum.values()).stream().map(MysqlCollationEnum::getCollation).collect(java.util.stream.Collectors.toList()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.