При использовании .fetchall()
вы собираетесь получить несколько результатов, даже если запрос имеет один результат, это будет list of all results
.
Использование dictionary=True
даст список dict
с именами полей, например
[{'id': '123456', 'name': 'This is the supe song 1'},
{'id': '456789', 'name': 'This is the supe song 2'},
{'id': '789123', 'name': 'This is the supe song 3'}]
без dictionary=True
, вы просто получите список значений в виде кортежей
[('123456', 'This is the supe song 1'),
('456789', 'This is the supe song 2'),
('789123', 'This is the supe song 3')]
это True
так
isinstance(rows, list) # True
isinstance(rows[0], dict) # True