SyntaxFix
Write A Post
Hire A Developer
Questions
if you're connecting to a postgres database, the following works:
result = cursor.execute(query) if result.returns_rows: # we got rows! return [{k:v for k,v in zip(result.keys(), r)} for r in result.rows] else: return None