Skip to content

Instantly share code, notes, and snippets.

@unbit
Last active December 15, 2015 01:09
Show Gist options
  • Save unbit/5177880 to your computer and use it in GitHub Desktop.
Save unbit/5177880 to your computer and use it in GitHub Desktop.
psygogreen test
import psycopg2
import gevent_psycopg2
gevent_psycopg2.monkey_patch()
def application(e, s):
conn = psycopg2.connect("dbname='foobar' user='postgres'")
print conn
cur = conn.cursor()
cur.execute("""SELECT * FROM foo""")
rows = cur.fetchall()
s('200 OK',[('Content-Type','text/plain')])
return str(rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment