PL/Python: Add cursor and execute methods to plan object
Peter Eisentraut <peter_e@gmx.net>
PL/Python: Add cursor and execute methods to plan object
Instead of
plan = plpy.prepare(...)
res = plpy.execute(plan, ...)
you can now write
plan = plpy.prepare(...)
res = plan.execute(...)
or even
res = plpy.prepare(...).execute(...)
and similarly for the cursor() method.
This is more in object oriented style, and makes the hybrid nature of
the existing execute() function less confusing.
Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/plpython.sgml | modified | +12 −2 |
| src/pl/plpython/expected/plpython_spi.out | modified | +16 −3 |
| src/pl/plpython/plpy_cursorobject.c | modified | +1 −2 |
| src/pl/plpython/plpy_cursorobject.h | modified | +1 −0 |
| src/pl/plpython/plpy_planobject.c | modified | +31 −0 |
| src/pl/plpython/plpy_spi.c | modified | +1 −2 |
| src/pl/plpython/plpy_spi.h | modified | +1 −0 |
| src/pl/plpython/sql/plpython_spi.sql | modified | +16 −2 |