Есть ли способ получить значение столбца результата SQL, используя имя столбца вместо индекса столбца в Python? Я использую Python 3 с mySQL. Синтаксис, который я ищу, во многом похож на конструкцию Java:
Object id = rs.get("CUSTOMER_ID");
У меня есть таблица с довольно большим количеством столбцов, и это настоящая боль, чтобы постоянно разрабатывать индекс для каждого столбца, который мне нужен. Кроме того, индекс делает мой код трудным для чтения.
Спасибо!