trino-python-client icon indicating copy to clipboard operation
trino-python-client copied to clipboard

capture queryset with column names

Open soheildsh opened this issue 4 years ago • 4 comments

I think there should be a way to fetch the query results as an array of dictionaries, which the keys are column names. this has a great use for me and maybe many others. is there any solution for this? And if there is not would it be ok if I try to contribute something like this to the project?

soheildsh avatar Aug 21 '21 08:08 soheildsh

Looks good idea and we are welcome your contribution! As you may already know, some DB-API libraries' have such extension. Please keep in mind the backward compatibility when developing the feature. https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursordict.html https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.row_factory

ebyhr avatar Aug 21 '21 11:08 ebyhr

is this related to this issue #34 ?

gscteam avatar Sep 21 '21 19:09 gscteam

@gscteam No, this is enhancement for query results regardless of the type.

ebyhr avatar Sep 21 '21 23:09 ebyhr

@soheildsh how did you manage to get around this limitation for time being?

scalame avatar Feb 14 '23 04:02 scalame