Back to index

python-biopython  1.60
Public Member Functions
BioSQL.DBUtils.Pgdb_dbutils Class Reference
Inheritance diagram for BioSQL.DBUtils.Pgdb_dbutils:
Inheritance graph
[legend]
Collaboration diagram for BioSQL.DBUtils.Pgdb_dbutils:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def autocommit
def next_id
def last_id
def tname
def execute

Detailed Description

Custom database utilities for Pgdb (aka PyGreSQL, for PostgreSQL).

Definition at line 92 of file DBUtils.py.


Member Function Documentation

def BioSQL.DBUtils.Pgdb_dbutils.autocommit (   self,
  conn,
  y = True 
)

Reimplemented from BioSQL.DBUtils.Generic_dbutils.

Definition at line 94 of file DBUtils.py.

00094 
00095     def autocommit(self, conn, y = True):
00096         raise NotImplementedError("pgdb does not support this!")
00097 
00098 _dbutils["pgdb"] = Pgdb_dbutils
00099 

def BioSQL.DBUtils.Generic_dbutils.execute (   self,
  cursor,
  sql,
  args = None 
) [inherited]
Just execute an sql command.

Reimplemented in BioSQL.DBUtils.Sqlite_dbutils.

Definition at line 30 of file DBUtils.py.

00030 
00031     def execute(self, cursor, sql, args=None):
00032         """Just execute an sql command.
00033         """
00034         cursor.execute(sql, args or ())

Here is the caller graph for this function:

def BioSQL.DBUtils._PostgreSQL_dbutils.last_id (   self,
  cursor,
  table 
) [inherited]

Reimplemented from BioSQL.DBUtils.Generic_dbutils.

Definition at line 74 of file DBUtils.py.

00074 
00075     def last_id(self, cursor, table):
00076         table = self.tname(table)
00077         sql = r"select currval('%s_pk_seq')" % table
00078         cursor.execute(sql)
00079         rv = cursor.fetchone()
00080         return rv[0]

Here is the call graph for this function:

def BioSQL.DBUtils._PostgreSQL_dbutils.next_id (   self,
  cursor,
  table 
) [inherited]

Definition at line 67 of file DBUtils.py.

00067 
00068     def next_id(self, cursor, table):
00069         table = self.tname(table)
00070         sql = r"select nextval('%s_pk_seq')" % table
00071         cursor.execute(sql)
00072         rv = cursor.fetchone()
00073         return rv[0]
        

Here is the call graph for this function:

def BioSQL.DBUtils.Generic_dbutils.tname (   self,
  table 
) [inherited]

Definition at line 18 of file DBUtils.py.

00018 
00019     def tname(self, table):
00020         if table != 'biosequence': return table
00021         else: return 'bioentry'

Here is the caller graph for this function:


The documentation for this class was generated from the following file: