fn dbtype_to_rust_type(&self, db_type: &str) -> (Vec<String>, Type) {
        match db_type {
            "boolean" => (vec![], Type::Bool),
            "char" => (vec![], Type::I8),
            "smallint" | "smallserial" => (vec![], Type::I16),
            "integer" | "int" | "serial" => (vec![], Type::I32),
            "oid" => (vec![], Type::U32),
            "bigint" | "bigserial" => (vec![], Type::I64),
            "real" => (vec![], Type::F32),
            "numeric" => {
                (vec![], Type::F64)
                // panic!("No support for numeric yet, please use real or double precision")
            }
            "double precision" => (vec![], Type::F64),
            "name" |
            "character" |
            "character varying" |
            "text" |
            "citext" |
            "bpchar" => (vec![], Type::String),
            "bytea" => (vec![], Type::VecU8),
            "json" | "jsonb" => (vec!["rustc_serialize::json::Json".to_owned()], Type::Json),
            "uuid" => (vec!["uuid::Uuid".to_owned()], Type::Uuid),
            "timestamp with time zone" => {
                (vec!["chrono::datetime::DateTime".to_owned(),
                      "chrono::offset::utc::UTC".to_owned()],
                 Type::DateTime)
            }
            "time with time zone" => {
                (vec!["chrono::datetime::DateTime".to_owned(),
                      "chrono::offset::utc::UTC".to_owned()],
                 Type::DateTime)
            },
            "interval" => (vec![], Type::U32),
            "inet[]" => (vec![], Type::String),
            "tsvector" | "inet" => (vec![], Type::String),//or everything else should be string
            _ => panic!("Unable to get the equivalent data type for {}", db_type),
        }
    }
/// get the rust data type names from database data type names
/// will be used in source code generation
get the rust data type names from database data type names
will be used in source code generation
get the rust data type names from database data type names will be used in source code generation
fn dbtype_to_rust_type(&self, db_type: &str) -> (Vec<String>, Type) {
        match db_type {
            "boolean" => (vec![], Type::Bool),
            "char" => (vec![], Type::I8),
            "smallint" | "smallserial" => (vec![], Type::I16),
            "integer" | "int" | "serial" => (vec![], Type::I32),
            "oid" => (vec![], Type::U32),
            "bigint" | "bigserial" => (vec![], Type::I64),
            "real" => (vec![], Type::F32),
            "numeric" => {
                (vec![], Type::F64)
                // panic!("No support for numeric yet, please use real or double precision")
            }
            "double precision" => (vec![], Type::F64),
            "name" |
            "character" |
            "character varying" |
            "text" |
            "citext" |
            "bpchar" => (vec![], Type::String),
            "bytea" => (vec![], Type::VecU8),
            "json" | "jsonb" => (vec!["rustc_serialize::json::Json".to_owned()], Type::Json),
            "uuid" => (vec!["uuid::Uuid".to_owned()], Type::Uuid),
            "timestamp with time zone" => {
                (vec!["chrono::datetime::DateTime".to_owned(),
                      "chrono::offset::utc::UTC".to_owned()],
                 Type::DateTime)
            }
            "time with time zone" => {
                (vec!["chrono::datetime::DateTime".to_owned(),
                      "chrono::offset::utc::UTC".to_owned()],
                 Type::DateTime)
            },
            "interval" => (vec![], Type::U32),
            "inet[]" => (vec![], Type::String),
            "tsvector" | "inet" => (vec![], Type::String),//or everything else should be string
            _ => panic!("Unable to get the equivalent data type for {}", db_type),
        }
    }
fn dbtype_to_rust_type ( & self , db_type : & str ) -> ( Vec < String > , Type ) { match db_type { " " => ( vec ! [ ] , Type :: Bool ) , " " => ( vec ! [ ] , Type :: I8 ) , " " | " " => ( vec ! [ ] , Type :: I16 ) , " " | " " | " " => ( vec ! [ ] , Type :: I32 ) , " " => ( vec ! [ ] , Type :: U32 ) , " " | " " => ( vec ! [ ] , Type :: I64 ) , " " => ( vec ! [ ] , Type :: F32 ) , " " => { ( vec ! [ ] , Type :: F64 ) // panic!("No support for numeric yet, please use real or double precision") } " " => ( vec ! [ ] , Type :: F64 ) , " " | " " | " " | " " | " " | " " => ( vec ! [ ] , Type :: String ) , " " => ( vec ! [ ] , Type :: VecU8 ) , " " | " " => ( vec ! [ " " to_owned ( ) ] , Type :: Json ) , " " => ( vec ! [ " " to_owned ( ) ] , Type :: Uuid ) , " " => { ( vec ! [ " " to_owned ( ) " " to_owned ( ) ] , Type :: DateTime ) } " " => { ( vec ! [ " " to_owned ( ) " " to_owned ( ) ] , Type :: DateTime ) } , " " => ( vec ! [ ] , Type :: U32 ) , " " => ( vec ! [ ] , Type :: String ) , " " | " " => ( vec ! [ ] , Type :: String ) , //or everything else should be string _ => panic ! ( " " db_type ) , } }
get the rust data type names from database data type names
will be used in source code generation
get the rust data type names from database data type names will be used in source code generation
&self
db_type
&str
&self
db_type
&str