python-postgres / be

pg-python: Execute Python 3 code from PostgreSQL functions.
Other
5 stars 2 forks source link

Add namedtuples() execution method to Postgres.Statement #29

Open jwp opened 13 years ago

jwp commented 13 years ago

I think this may be the best route for supporting native Python objects from Statements. Rather than using a statement wrapper, just have the Statement.namedtuples() convert. It doesn't make much sense to pack Postgres types into as rows() suffices well enough.

Statement.namedtuples() -> iterator Statement.namedtuple() -> next(Statement.namedtuples(...)) or None