From: Billy G. A. <bal...@us...> - 2004-05-10 03:34:13
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8739/pyPgSQL Modified Files: PgSQL.py Log Message: 09MAY2003 bga Added a debug feature to the libpq.PgConnection object and to the PgSQL.Connection object to allow the query to be executed to be printed to STDOUT in either text or HTML format. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** PgSQL.py 7 Feb 2004 22:36:11 -0000 1.41 --- PgSQL.py 10 May 2004 03:34:03 -0000 1.42 *************** *** 30,33 **** --- 30,34 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 09MAY2004 bga - Added a 'debug' attribute to the Connection object. | # 18JAN2004 bga - Fixed problem with a SELECT ... INTO query. PgSQL | # will no longer use a portal for these queires. | *************** *** 302,305 **** --- 303,313 ---- the execute method. + cursor.debug + Setting this attribute to 'text' will cause the query that will + be executed to be displayed to STDOUT. If it is set to 'pre' or + 'div', the query will be displayed to STDOUT within a <pre> or + <dif> HTML block. If it is set to None (the default), the query + will not be displayed. + NOTE: In order to use a PostgreSQL portal (i.e. DECLARE ... CURSOR FOR ...), the word SELECT must be the first word in the query, *************** *** 2376,2379 **** --- 2384,2388 ---- self.__dict__["_isOpen"] = 1 self.__dict__["_cache"] = TypeCache(self) + self.__dict__["debug"] = self.conn.debug if noWeakRef: self.__dict__["cursors"] = [] *************** *** 2460,2463 **** --- 2469,2475 ---- elif name in ('unicode_results', 'client_encoding'): self.__dict__[name] = value + elif name == 'debug': + self.conn.debug = value + self.__dict__["debug"] = self.conn.debug elif self.__dict__.has_key(name): raise AttributeError, "%s is read-only." % name |