Back to index

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

List of all members.

Public Member Functions

def next_id
def last_id
def tname
def execute
def autocommit

Detailed Description

Base class for any PostgreSQL adaptor.

Definition at line 65 of file DBUtils.py.


Member Function Documentation

def BioSQL.DBUtils.Generic_dbutils.autocommit (   self,
  conn,
  y = 1 
) [inherited]

Reimplemented in BioSQL.DBUtils.Pgdb_dbutils, and BioSQL.DBUtils.Psycopg2_dbutils.

Definition at line 35 of file DBUtils.py.

00035 
00036     def autocommit(self, conn, y = 1):
00037         # Let's hope it was not really needed
00038         pass
00039 

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 
)

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 
)

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: