I would like to get the result of the fetchall operation in a list instead of tuple of tuple or tuple of dictionaries. For example,
cursor = connection.cur
And what about list comprehensions? If result is ((123,), (234,), (345,)):
((123,), (234,), (345,))
>>> row = [item[0] for item in cursor.fetchall()] >>> row [123, 234, 345]
If result is ({'id': 123}, {'id': 234}, {'id': 345}):
({'id': 123}, {'id': 234}, {'id': 345})
>>> row = [item['id'] for item in cursor.fetchall()] >>> row [123, 234, 345]