tokio-rs / rdbc

Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Apache License 2.0
566 stars 25 forks source link

Implement data type enum #7

Closed andygrove closed 4 years ago

andygrove commented 4 years ago

We need an enum describing all available/supported data types. It could be based on https://docs.oracle.com/javase/8/docs/api/java/sql/JDBCType.html

KenSuenobu commented 4 years ago

Are you wanting an enum that just defines the sizes, or do you want an enum that contains a store of sorts for each result?

rumatoest commented 4 years ago

Should consider that JDBC lack of some features like supporting JSON like column types. And it is also not so good for working with array types.

andygrove commented 4 years ago

Closing this for now since there is a basic enum in place.

/// RDBC Data Types
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum DataType {
    Bool,
    Byte,
    Char,
    Short,
    Integer,
    Float,
    Double,
    Decimal,
    Date,
    Time,
    Datetime,
    Utf8,
    Binary,
}