def make_dicts_from_result_proxy(proxy):
res = proxy.fetchall()
if res:
keys = res[0].keys()
res = [dict(zip(keys, i.values())) for i in res]
return res
make_dicts_from_result_proxy(engine.execute("SELECT * FROM example"))
Last active
February 11, 2016 15:49
-
-
Save danishabdullah/6261ba20b40d8b4ecb85 to your computer and use it in GitHub Desktop.
Get dicts for sqlalchemy core query
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment