From: Billy G. A. <bal...@us...> - 2001-10-13 20:58:25
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv12800/pyPgSQL Added Files: PgSQL.py __init__.py Log Message: 13OCT2001 bga Re-arranged how the PgSQL and libpq modules are accessed. There is now a pyPgSQL package the encapulates PgSQL and libpq. Also, libpq is now a package (of pyPgSQL) that contains the libpqmodule.so file. This was done so that support for pickling of the Pg* types/objects could be added. --- NEW FILE: PgSQL.py --- #ident "@(#) $Id: PgSQL.py,v 1.1 2001/10/13 20:58:22 ballie01 Exp $" # vi:set sw=4 ts=8 showmode ai: #--(H+)-----------------------------------------------------------------+ # Name: PgSQL.py | # | # Description: This file implements a Python DB-API 2.0 interface to | # PostgreSQL. | #=======================================================================| # Copyright 2000 by Billy G. Allie. | # All rights reserved. | # | # Permission to use, copy, modify, and distribute this software and its | # documentation for any purpose and without fee is hereby granted, pro- | # vided that the above copyright notice appear in all copies and that | # both that copyright notice and this permission notice appear in sup- | # porting documentation, and that the copyright owner's name not be | # used in advertising or publicity pertaining to distribution of the | # software without specific, written prior permission. | # | [...2257 lines suppressed...] if self.closed == 0: _nl = len(self.conn.notices) self.res = self.conn.conn.query("MOVE BACKWARD ALL IN %s" % self.name) self._rows_ = 0 if len(self.conn.notices) != _nl: _drop = self.conn.notices[-1] if _drop.find('transaction is aborted') > 0: raise Warning, self.conn.notices.pop() self.__dict__["rowcount"] = -1 self._idx_ = 0 def setinputsizes(self, sizes): if self.closed: raise InterfaceError, "setinputsize failed - the cursor is closed." def setoutputsize(self, size, column=None): if self.closed: raise InterfaceError, "setoutputsize failed - the cursor is closed." --- NEW FILE: __init__.py --- """ pyPgSQL - A Python DB-API 2.0 Compliant Interface to PostgreSQL ====================================================================== pyPgSQL is a package of two (2) modules that provide a Python DB-API 2.0 compliant interface to PostgreSQL databases. The first module, libpq, exports the PostgreSQL C API to Python. This module is written in C and can be compiled into Python or can be dynamically loaded on demand. The second module, PgSQL, provides the DB-API 2.0 compliant interface and support for various PostgreSQL data types, such as INT8, NUMERIC, MONEY, BOOL, ARRAYS, etc. This module is written in Python. This version works with PostgreSQL 7.0 or later and Python 2.0 or later. ====================================================================== Copyright 2000 by Billy G. Allie. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in sup- porting documentation, and that the copyright owner's name not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ __version__ = "1.7" |