chrthomsen / pygrametl

Official repository for pygrametl - ETL programming in Python
http://pygrametl.org
BSD 2-Clause "Simplified" License
289 stars 41 forks source link

It is recommended to add default columns names as SQLSource default metadata attributes #33

Closed qianxuanyon closed 3 years ago

qianxuanyon commented 3 years ago

I think it will be more convenient to add some metadata information to SQLSource

self.columns = [t[0] for t in self.cursor.description] self.columns_type = [t[1] for t in self.cursor.description]

https://www.python.org/dev/peps/pep-0249/#description

Each of these sequences contains information describing one result column: name、type_code、display_size、internal_size、precision、scale、null_ok The first two items (name and type_code) are mandatory, the other five are optional and are set to None if no meaningful values can be provided.