mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-19 12:56:59 +08:00
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>
25 lines
479 B
C
25 lines
479 B
C
/*
|
|
* src/pl/plpython/plpy_cursorobject.h
|
|
*/
|
|
|
|
#ifndef PLPY_CURSOROBJECT_H
|
|
#define PLPY_CURSOROBJECT_H
|
|
|
|
#include "plpy_typeio.h"
|
|
|
|
|
|
typedef struct PLyCursorObject
|
|
{
|
|
PyObject_HEAD
|
|
char *portalname;
|
|
PLyTypeInfo result;
|
|
bool closed;
|
|
MemoryContext mcxt;
|
|
} PLyCursorObject;
|
|
|
|
extern void PLy_cursor_init_type(void);
|
|
extern PyObject *PLy_cursor(PyObject *self, PyObject *args);
|
|
extern PyObject *PLy_cursor_plan(PyObject *ob, PyObject *args);
|
|
|
|
#endif /* PLPY_CURSOROBJECT_H */
|