Back to index

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

List of all members.

Public Member Functions

def __init__
def tname
def last_id
def execute
def autocommit

Detailed Description

Default database utilities.

Definition at line 13 of file DBUtils.py.


Constructor & Destructor Documentation

Definition at line 15 of file DBUtils.py.

00015 
00016     def __init__(self):
00017         pass


Member Function Documentation

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

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 
)
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.Generic_dbutils.last_id (   self,
  cursor,
  table 
)

Reimplemented in BioSQL.DBUtils._PostgreSQL_dbutils, and BioSQL.DBUtils.Mysql_dbutils.

Definition at line 22 of file DBUtils.py.

00022 
00023     def last_id(self, cursor, table):
00024         # XXX: Unsafe without transactions isolation
00025         table = self.tname(table)
00026         sql = r"select max(%s_id) from %s" % (table, table)
00027         cursor.execute(sql)
00028         rv = cursor.fetchone()
00029         return rv[0]
    

Here is the call graph for this function:

def BioSQL.DBUtils.Generic_dbutils.tname (   self,
  table 
)

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: