1 module hunt.database.driver.mysql.impl.codec.DataType; 2 3 // import io.netty.util.collection.IntObjectHashMap; 4 // import io.netty.util.collection.IntObjectMap; 5 // import io.vertx.core.buffer.Buffer; 6 // import hunt.database.base.Numeric; 7 8 // import java.time.Duration; 9 // import java.time.LocalDate; 10 // import java.time.LocalDateTime; 11 12 enum DataType { 13 BIT = ColumnType.MYSQL_TYPE_BIT, 14 INT1 = ColumnType.MYSQL_TYPE_TINY, 15 INT2 = ColumnType.MYSQL_TYPE_SHORT, 16 INT3 = ColumnType.MYSQL_TYPE_INT24, 17 INT4 = ColumnType.MYSQL_TYPE_LONG, 18 INT8 = ColumnType.MYSQL_TYPE_LONGLONG, 19 DOUBLE = ColumnType.MYSQL_TYPE_DOUBLE, 20 FLOAT = ColumnType.MYSQL_TYPE_FLOAT, 21 NUMERIC = ColumnType.MYSQL_TYPE_NEWDECIMAL, 22 STRING = ColumnType.MYSQL_TYPE_STRING, 23 VARSTRING = ColumnType.MYSQL_TYPE_VAR_STRING, 24 TINYBLOB = ColumnType.MYSQL_TYPE_TINY_BLOB, 25 BLOB = ColumnType.MYSQL_TYPE_BLOB, 26 MEDIUMBLOB = ColumnType.MYSQL_TYPE_MEDIUM_BLOB, 27 LONGBLOB = ColumnType.MYSQL_TYPE_LONG_BLOB, 28 DATE = ColumnType.MYSQL_TYPE_DATE, 29 TIME = ColumnType.MYSQL_TYPE_TIME, 30 DATETIME = ColumnType.MYSQL_TYPE_DATETIME, 31 YEAR = ColumnType.MYSQL_TYPE_YEAR, 32 TIMESTAMP = ColumnType.MYSQL_TYPE_TIMESTAMP, 33 NULL = ColumnType.MYSQL_TYPE_NULL 34 } 35 36 37 /* 38 Type of column definition 39 https://dev.mysql.com/doc/dev/mysql-server/latest/binary__log__types_8h.html#aab0df4798e24c673e7686afce436aa85 40 */ 41 enum ColumnType : int { 42 MYSQL_TYPE_DECIMAL = 0x00, 43 MYSQL_TYPE_TINY = 0x01, 44 MYSQL_TYPE_SHORT = 0x02, 45 MYSQL_TYPE_LONG = 0x03, 46 MYSQL_TYPE_FLOAT = 0x04, 47 MYSQL_TYPE_DOUBLE = 0x05, 48 MYSQL_TYPE_NULL = 0x06, 49 MYSQL_TYPE_TIMESTAMP = 0x07, 50 MYSQL_TYPE_LONGLONG = 0x08, 51 MYSQL_TYPE_INT24 = 0x09, 52 MYSQL_TYPE_DATE = 0x0A, 53 MYSQL_TYPE_TIME = 0x0B, 54 MYSQL_TYPE_DATETIME = 0x0C, 55 MYSQL_TYPE_YEAR = 0x0D, 56 MYSQL_TYPE_VARCHAR = 0x0F, 57 MYSQL_TYPE_BIT = 0x10, 58 MYSQL_TYPE_JSON = 0xF5, 59 MYSQL_TYPE_NEWDECIMAL = 0xF6, 60 MYSQL_TYPE_ENUM = 0xF7, 61 MYSQL_TYPE_SET = 0xF8, 62 MYSQL_TYPE_TINY_BLOB = 0xF9, 63 MYSQL_TYPE_MEDIUM_BLOB = 0xFA, 64 MYSQL_TYPE_LONG_BLOB = 0xFB, 65 MYSQL_TYPE_BLOB = 0xFC, 66 MYSQL_TYPE_VAR_STRING = 0xFD, 67 MYSQL_TYPE_STRING = 0xFE, 68 MYSQL_TYPE_GEOMETRY = 0xFF, 69 70 /* 71 Internal to MySQL Server 72 */ 73 MYSQL_TYPE_NEWDATE = 0x0E, 74 MYSQL_TYPE_TIMESTAMP2 = 0x11, 75 MYSQL_TYPE_DATETIME2 = 0x12, 76 MYSQL_TYPE_TIME2 = 0x13 77 }