It would be nice to have a column_names. Similar to table_names.
Or if you could get one or all of the following syntax to work for both Database and Table that might be even better:
Style 1
if 'table1' in db
if 'col1' in db['table1']
Style 2
if 'table1' in db.tables
if 'col1' in db['table1'].columns
maybe the table ones actually work but I'm too lazy to check. I just know that I have to do:
[c.name for c in db['table1'].columns]
Edit: This is possible with columns_dict. I have actually used that before but I forgot about it. Feel free to close, but I do think accessing this data could be more consistent and intuitive.
It would be nice to have a
column_names
. Similar totable_names
.Or if you could get one or all of the following syntax to work for both Database and Table that might be even better:
Style 1
if 'table1' in db
if 'col1' in db['table1']
Style 2
if 'table1' in db.tables
if 'col1' in db['table1'].columns
maybe the table ones actually work but I'm too lazy to check. I just know that I have to do:
[c.name for c in db['table1'].columns]
Edit: This is possible with
columns_dict
. I have actually used that before but I forgot about it. Feel free to close, but I do think accessing this data could be more consistent and intuitive.