Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cursor_factory is not honored in connection object #31

Open
haizaar opened this issue Feb 24, 2014 · 0 comments
Open

cursor_factory is not honored in connection object #31

haizaar opened this issue Feb 24, 2014 · 0 comments

Comments

@haizaar
Copy link

haizaar commented Feb 24, 2014

Consider the following:

import psycopg2ct as psycopg2
from psycopg2ct import compat
compat.register()
from psycopg2.extras import RealDictCursor

conn = psycopg2.connect("dbname=haizaar user=haizaar password=password host=localhost port=5432", cursor_factory=RealDictCursor)
cursor = conn.cursor()
cursor.execute("SELECT 1 AS a")
print cursor.fetchall()
print type(cursor)

It prints:

[(1,)]
<class 'psycopg2ct._impl.cursor.Cursor'>

However I would expect a dictionary.

haizaar added a commit to zarmory/momoko that referenced this issue Feb 24, 2014
friedcell pushed a commit to friedcell/momoko that referenced this issue Feb 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant