Back to index

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

List of all members.

Public Member Functions

def execute
def tname
def last_id
def autocommit

Detailed Description

Custom database utilities for SQLite.

Definition at line 40 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.Sqlite_dbutils.execute (   self,
  cursor,
  sql,
  args = None 
)
Execute SQL command, replacing %s with ? for variable substitution in sqlite3.

Reimplemented from BioSQL.DBUtils.Generic_dbutils.

Definition at line 42 of file DBUtils.py.

00042 
00043     def execute(self, cursor, sql, args=None):
00044         """Execute SQL command, replacing %s with ? for variable substitution in sqlite3.
00045         """
00046         cursor.execute(sql.replace("%s", "?"), args or ())
00047 
00048 _dbutils["sqlite3"] = Sqlite_dbutils
00049 

Here is the caller graph for this function:

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

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 
) [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: