aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/python/pgsqldb.py
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2000-10-02 03:27:33 +0000
committerBruce Momjian <bruce@momjian.us>2000-10-02 03:27:33 +0000
commitf36e7ff0927bdae6ea477cb64be9088307e5bddd (patch)
tree6eb269b322a01669c3a62d4a881c30ec05f80898 /src/interfaces/python/pgsqldb.py
parent0bd84442f55725ff073338dee5afc4cf895b747b (diff)
downloadpostgresql-f36e7ff0927bdae6ea477cb64be9088307e5bddd.tar.gz
postgresql-f36e7ff0927bdae6ea477cb64be9088307e5bddd.zip
Update for PyGreSQL 3.0, from D'Arcy J.M. Cain
Diffstat (limited to 'src/interfaces/python/pgsqldb.py')
-rw-r--r--src/interfaces/python/pgsqldb.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/interfaces/python/pgsqldb.py b/src/interfaces/python/pgsqldb.py
deleted file mode 100644
index df768b68b2f..00000000000
--- a/src/interfaces/python/pgsqldb.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# pgsqldb.py
-# Written by D'Arcy J.M. Cain
-
-# This library implements the DB-SIG API
-# It includes the pg module and builds on it
-
-from _pg import *
-
-import string
-
-class _cursor:
- """For cursor object"""
-
- def __init__(self, conn):
- self.conn = conn
- self.cursor = None
- self.arraysize = 1
- self.description = None
- self.name = string.split(`self`)[3][:-1]
-
- def close(self):
- if self.conn == None: raise self.conn.error, "Cursor has been closed"
- if self.cursor == None: raise self.conn.error, "No cursor created"
- self.conn.query('CLOSE %s' % self.name)
- self.conn = None
-
- def __del__(self):
- if self.cursor != None and self.conn != None:
- self.conn.query('CLOSE %s' % self.name)
-
-
-class pgsqldb:
- """This class wraps the pg connection type in a DB-SIG API interface"""
-
- def __init__(self, *args, **kw):
- self.db = apply(connect, args, kw)
-
- # Create convience methods, in a way that is still overridable.
- for e in ('query', 'reset', 'close', 'getnotify', 'inserttable',
- 'putline', 'getline', 'endcopy',
- 'host', 'port', 'db', 'options',
- 'tty', 'error', 'status', 'user',
- 'locreate', 'getlo', 'loimport'):
- if not hasattr(self,e) and hasattr(self.db,e):
- exec 'self.%s = self.db.%s' % ( e, e )
-