func (p *Postgresql) derivePgDatatype(value interface{}) string {
	if p.UseUint8 {
		if _, ok := value.(uint64); ok {
			return PgUint8
		}
	}

	switch value.(type) {
	case bool:
		return PgBool
	case uint64:
		return PgNumeric
	case int64, int, uint, uint32:
		return PgBigInt
	case int32:
		return PgInteger
	case int16, int8:
		return PgSmallInt
	case float64:
		return PgDoublePrecision
	case float32:
		return PgReal
	case string:
		return PgText
	case time.Time:
		return PgTimestampWithoutTimeZone
	default:
		return PgText
	}
}
// DerivePgDatatype returns the appropriate PostgreSQL data type
// that could hold the value.
DerivePgDatatype returns the appropriate PostgreSQL data type
that could hold the value.
// DerivePgDatatype returns the appropriate PostgreSQL data type // that could hold the value .
func (p *Postgresql) derivePgDatatype(value interface{}) string {
	if p.UseUint8 {
		if _, ok := value.(uint64); ok {
			return PgUint8
		}
	}
	switch value.(type) {
	case bool:
		return PgBool
	case uint64:
		return PgNumeric
	case int64, int, uint, uint32:
		return PgBigInt
	case int32:
		return PgInteger
	case int16, int8:
		return PgSmallInt
	case float64:
		return PgDoublePrecision
	case float32:
		return PgReal
	case string:
		return PgText
	case time.Time:
		return PgTimestampWithoutTimeZone
	default:
		return PgText
	}
}
func ( p * Postgresql ) derivePgDatatype ( value interface { } ) string { if p . UseUint8 { if _ , ok := value . ( uint64 ) ; ok { return PgUint8 } } switch value . ( type ) { case bool : return PgBool case uint64 : return PgNumeric case int64 , int , uint , uint32 : return PgBigInt case int32 : return PgInteger case int16 , int8 : return PgSmallInt case float64 : return PgDoublePrecision case float32 : return PgReal case string : return PgText case time . Time : return PgTimestampWithoutTimeZone default : return PgText } }
DerivePgDatatype returns the appropriate PostgreSQL data type
that could hold the value.
DerivePgDatatype returns the appropriate PostgreSQL data type that could hold the value .