Skip to content

Instantly share code, notes, and snippets.

@anilkay
Last active August 16, 2020 20:22
Show Gist options
  • Save anilkay/6e6ac52341d8d79c83aaf2b02cbd0358 to your computer and use it in GitHub Desktop.
Save anilkay/6e6ac52341d8d79c83aaf2b02cbd0358 to your computer and use it in GitHub Desktop.
from psycopg2.extras import NamedTupleCursor
import psycopg2
conn = psycopg2.connect()
cur = conn.cursor(cursor_factory=NamedTupleCursor)
cur.execute("Fancy SQL Quary")
data=cur.fetchall()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment