This is not an answer to python; I don’t really know if the Python data drivers have such things. But perhaps this information will help.
ANSI SQL-92 and SQL-99 require the INFORMATION_SCHEMA schema , which stores information about tables in a directory.
The metadata you are looking for can be obtained with a request for views in this schema.
eg:
select column_name, is_nullable, data_type, character_maximum_length as maxlen
from information_schema.columns
where table_name = 'Products'
Not all databases implement this part of the standard. Oracle, for example, is not.
, , , .
Microsoft SQL Server Information_Schema, , SQL Server, . [CatalogName].dbo.sysobjects [CatalogName].dbo.sysolumns. , . :
select * from [CatalogName].dbo.syscolumns
where id =
(Select id from [CatalogName].dbo.sysobjects where name = 'Products')
Oracle ALL_TAB_COLUMNS :
select column_name, data_type, data_length, data_precision, data_scale
from ALL_TAB_COLUMNS
where table_name = 'EMP';
, , db, ODBC - db, , .