tokio-rs / rdbc

Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement data type enum

andygrove opened this issue · comments

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

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?

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.

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,
}