This commit is contained in:
Alain Jobart 2017-02-01 09:00:44 -08:00
Родитель 6325bf9aa7
Коммит 3a8719c40b
1 изменённых файлов: 0 добавлений и 84 удалений

Просмотреть файл

@ -39,90 +39,6 @@ func init() {
sqldb.RegisterDefault(Connect)
}
const (
// typeDecimal is a deprecated type.
// Value is 0.
typeDecimal = C.MYSQL_TYPE_DECIMAL
// TypeTiny specifies a TINYINT type.
// Value is 1.
TypeTiny = C.MYSQL_TYPE_TINY
// TypeShort specifies a SMALLINT type.
// Value is 2.
TypeShort = C.MYSQL_TYPE_SHORT
// TypeLong specifies a INTEGER type.
// Value is 3.
TypeLong = C.MYSQL_TYPE_LONG
// TypeFloat specifies a FLOAT type.
// Value is 4.
TypeFloat = C.MYSQL_TYPE_FLOAT
// TypeDouble specifies a DOUBLE or REAL type.
// Value is 5.
TypeDouble = C.MYSQL_TYPE_DOUBLE
// TypeNull specifies a NULL type.
// Value is 6.
TypeNull = C.MYSQL_TYPE_NULL
// TypeTimestamp specifies a TIMESTAMP type.
// Value is 7. NOT SUPPORTED.
TypeTimestamp = C.MYSQL_TYPE_TIMESTAMP
// TypeLonglong specifies a BIGINT type.
// Value is 8.
TypeLonglong = C.MYSQL_TYPE_LONGLONG
// TypeInt24 specifies a MEDIUMINT type.
// Value is 9.
TypeInt24 = C.MYSQL_TYPE_INT24
// TypeDate specifies a DATE type.
// Value is 10.
TypeDate = C.MYSQL_TYPE_DATE
// TypeTime specifies a TIME type.
// Value is 11.
TypeTime = C.MYSQL_TYPE_TIME
// TypeDatetime specifies a DATETIME type.
// Value is 12.
TypeDatetime = C.MYSQL_TYPE_DATETIME
// TypeYear specifies a YEAR type.
// Value is 13.
TypeYear = C.MYSQL_TYPE_YEAR
// TypeBit specifies a BIT type.
// Value is 16.
TypeBit = C.MYSQL_TYPE_BIT
// TypeNewDecimal specifies a DECIMAL or NUMERIC type.
// Value is 246.
TypeNewDecimal = C.MYSQL_TYPE_NEWDECIMAL
// TypeBlob specifies a BLOB or TEXT type.
// Value is 252.
TypeBlob = C.MYSQL_TYPE_BLOB
// TypeVarString specifies a VARCHAR or VARBINARY type.
// Value is 253.
TypeVarString = C.MYSQL_TYPE_VAR_STRING
// TypeString specifies a CHAR or BINARY type.
// Value is 254.
TypeString = C.MYSQL_TYPE_STRING
// TypeGeometry specifies a Spatial field.
// Value is 255. NOT SUPPORTED.
TypeGeometry = C.MYSQL_TYPE_GEOMETRY
)
const (
// FlagUnsigned specifies if the value is an unsigned.
// Value is 32 (0x20).
FlagUnsigned = C.UNSIGNED_FLAG
// FlagBinary specifies if the data is binary.
// Value is 128 (0x80).
FlagBinary = C.BINARY_FLAG
// FlagEnum specifies if the value is an enum.
// Value is 256 (0x100).
FlagEnum = C.ENUM_FLAG
// FlagSet specifies if the value is a set.
// Value is 2048 (0x800).
FlagSet = C.SET_FLAG
// RelevantFlags is used to mask out irrelevant flags.
RelevantFlags = FlagUnsigned |
FlagBinary |
FlagEnum |
FlagSet
)
func handleError(err *error) {
if x := recover(); x != nil {
terr := x.(*sqldb.SQLError)