tokio-rs / rdbc

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

Datatype for 64-bit integers (long long)? #42

Open golddranks opened 4 years ago

golddranks commented 4 years ago

Hi, there is DataType::Integer. I was wondering if it's meant to signify 32-bit integers, (int in MySQL and integer in Postgres). Is there a plan for having a data type for 64-bit integers?

It would also be very helpful if there were a correspondence table between the data types of this library, standard SQL and commonly used DB's such as Postgres, MySQL and Sqlite.

golddranks commented 4 years ago

Note: this is not because it would be impossible to get 64-bit integers from the database at the moment; get_i64 seems to work just fine. However, it's because when dealing with databases with unknown schemas, we want to be able to inspect the metadata to know the correct numeric ranges that might be stored in the DB.

andygrove commented 4 years ago

Yes, good point. I was just roughing out the DataTypes enum to get some basic tests working. I really want to study both the ODBC and JDBC specifications and learn from how they both modeled the data types.