Open padhia opened 8 years ago
I should add that the integral SQL data types are better represented by python int
(also long
in python2) and python float
to represent SQL real
data types instead of current implementation that uses decimal.Decimal
for all numeric data types.
Python DB API standards defines here what values a DB API compliant driver can return via
cursor.description
.From what I observed:
precision
andscale
are wrong. The actualscale
value is stored inprecision
andprecision
value is stored ininternal_size
.internal_size
attribute on other databases returns the amount of internal storage used by the column. So for example, column ofint
type would return 4,bigint
8 and so on.internal_size
actually has the values that are more appropriate fordisplay_size
attribute (which is alwaysnull
)type_code
fromcursor.description
returnsstr
but in reality an instance ofteradata.datatypes.Interval
is returned.str
is stored intype_code
, but the actual values are instances of pythondict
orlist
tdrest
module, none of the metadata exceptname
andtype_code
are returned. It would be nice to have access to the same information thattdodbc
module providestdrest
module doesn't supportxml
type at all whereastdodbc
has no problems returningxml
as pythonstr
Here is a small Python program to reproduce above observations: