DB row as dictionary

How do I cast a DB row as a dictionary?

Yes, I could do it by extracting all the values and setting all the keys of a new dictionary.
But I want to do something like

row_dict = dict(row)

since the thing is so much like a dictionary already.

I believe that what you have written above should work on the server.

On the client there is a gotcha: