MySQL python DBAPI. How to get a dictionary instead of a tuple?

The Python DB API returns a list of tuples when fetchall is called on a executed cursor. If you are working with the _mysql module, fetch_row has a parameter howthat allows you to get a dictionary instead of a tuple. How can I achieve this with the cursor?

+5
source share
1 answer

Quote from the documentation

DictCursor
    Like Cursor except it returns rows as dictionaries.
+3
source

All Articles