Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
BioSQL.Loader.DatabaseRemover Class Reference

List of all members.

Public Member Functions

def __init__
def remove

Public Attributes


Detailed Description

Complement the Loader functionality by fully removing a database.

This probably isn't really useful for normal purposes, since you
can just do a:
    DROP DATABASE db_name
and then recreate the database. But, it's really useful for testing

YB: now use the cascaded deletions

Definition at line 1042 of file

Constructor & Destructor Documentation

def BioSQL.Loader.DatabaseRemover.__init__ (   self,
Initialize with a database id and adaptor connection.

Definition at line 1053 of file

01054     def __init__(self, adaptor, dbid):
01055         """Initialize with a database id and adaptor connection.
01056         """
01057         self.adaptor = adaptor
01058         self.dbid = dbid

Member Function Documentation

Remove everything related to the given database id.

Definition at line 1059 of file

01060     def remove(self):
01061         """Remove everything related to the given database id.
01062         """
01063         sql = r"DELETE FROM bioentry WHERE biodatabase_id = %s"
01064         self.adaptor.execute(sql, (self.dbid,))
01065         sql = r"DELETE FROM biodatabase WHERE biodatabase_id = %s"
01066         self.adaptor.execute(sql, (self.dbid,))

Member Data Documentation

Definition at line 1056 of file

Definition at line 1057 of file

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