mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Better DictCursor.
This commit is contained in:
parent
127c14809c
commit
5ea2fa636f
|
@ -1,3 +1,8 @@
|
|||
2005-12-06 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* lib/extras.py: added .callproc() to DictCursor as suggested
|
||||
by Philip Semanchuk.
|
||||
|
||||
2005-11-29 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* MANIFEST.in: added docs/async.txt. (Closes: #75)
|
||||
|
|
8
LICENSE
8
LICENSE
|
@ -50,3 +50,11 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Proprietary licenses
|
||||
====================
|
||||
|
||||
A non-discriminatory license is available for companies that want to include
|
||||
psycopg in their proprietary products without respecting the spirit of the
|
||||
GPL. The price of the license is one day of development done by the author,
|
||||
at the consulting fee he applies to his usual customers at the day of the
|
||||
request.
|
||||
|
|
|
@ -38,6 +38,12 @@ class DictCursor(_cursor):
|
|||
self.__query_executed = 1
|
||||
return _cursor.execute(self, query, vars, async)
|
||||
|
||||
def callproc(self, procname, vars=None):
|
||||
self.row_factory = DictRow
|
||||
self.index = {}
|
||||
self.__query_executed = 1
|
||||
return _cursor.callproc(self, procname, vars)
|
||||
|
||||
def _build_index(self):
|
||||
if self.__query_executed == 1 and self.description:
|
||||
for i in range(len(self.description)):
|
||||
|
|
|
@ -881,7 +881,7 @@ psyco_curs_callproc(cursorObject *self, PyObject *args, PyObject *kwargs)
|
|||
|
||||
if (self->name != NULL) {
|
||||
PyErr_SetString(ProgrammingError,
|
||||
"can't call .executemany() on named cursors");
|
||||
"can't call .callproc() on named cursors");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -815,6 +815,7 @@ pq_fetch(cursorObject *curs)
|
|||
else
|
||||
#endif
|
||||
ex = _pq_copy_out(curs);
|
||||
curs->rowcount = -1;
|
||||
/* error caught by out glorious notice handler */
|
||||
if (PyErr_Occurred()) ex = -1;
|
||||
IFCLEARPGRES(curs->pgres);
|
||||
|
@ -828,6 +829,7 @@ pq_fetch(cursorObject *curs)
|
|||
else
|
||||
#endif
|
||||
ex = _pq_copy_in(curs);
|
||||
curs->rowcount = -1;
|
||||
/* error caught by out glorious notice handler */
|
||||
if (PyErr_Occurred()) ex = -1;
|
||||
IFCLEARPGRES(curs->pgres);
|
||||
|
|
Loading…
Reference in New Issue
Block a user