Files
postgres-web/pgweb/util/db.py
Jonathan S. Katz c884493494 Create Release Notes archive in the Documentation section.
This creates a consolidated area to reference all of the notes from
previous releases of PostgreSQL, as current releases only keep the
the notes for that specific major release of PostgreSQL.
2019-03-08 11:19:25 -08:00

8 lines
256 B
Python

from django.db import connection
def exec_to_dict(query, params=None):
curs = connection.cursor()
curs.execute(query, params)
columns = [col[0] for col in curs.description]
return [dict(list(zip(columns, row))) for row in curs.fetchall()]