I am connecting to snowfalke database and fetch only 1 record. This record will have 21 columns. After i read them in python using connection, they return a tuple object.
I want to access the elements of tuple object with a name.
Preferrably i want to access these tuple elemts with the same name as column name from database.
In PL/SQL, we have something called as record type. And the elements in record can be accessed with a name
How do i do this in python?
Pseudocode ex:
tup_obj = connection.execute('select name, age, height, weight from table')
I want to access the tuple object like with names like this,
tup_obj.name == 'Harish'?
The above is only an example of the requiment. The below is the simulated data with same structure for my use case:
print(type(tup_obj))
print(tup_obj)
<class 'tuple'>
(101010, 5, 1, 200, 'text', 'text', 'text', 'text', 18075, 'text', 'text', 'text', 37, 2, 57, 'Y', 'S', 'S', 'text', 123, 'text')