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 methods don't support back_as argument #39

Closed
Changaco opened this issue Jun 12, 2014 · 1 comment
Closed

Cursor methods don't support back_as argument #39

Changaco opened this issue Jun 12, 2014 · 1 comment
Assignees

Comments

@Changaco
Copy link
Member

Postgres.all() and Postgres.one() support the back_as argument, but the same methods on cursors don't, which for example prevents doing (cursor or db).all(..., back_as=dict).

@chadwhitacre
Copy link
Collaborator

Currently we're depending on psycopg2's different cursor types for the implementation of back_as. I supposed we'd need to unroll those in order to support a back_as argument to cursor.{one,all}. Python's namedtuples have an _asdict method that can be used to serialize to a dictionary. Maybe that is helpful here?

@Changaco Changaco self-assigned this Sep 29, 2019
@Changaco Changaco mentioned this issue Sep 29, 2019
Changaco added a commit that referenced this issue Sep 30, 2019
This branch adds a `back_as` argument to all cursor methods (#39) and further modifies those methods so that `back_as` trumps the unpacking of single-column rows (#42).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants