Package BioSQL :: Module BioSeqDatabase :: Class Adaptor
[hide private]
[frames] | no frames]

Class Adaptor

source code

object --+
         |
        Adaptor
Known Subclasses:

High level wrapper for a database connection and cursor

Most database calls in BioSQL are done indirectly though this adaptor class. This provides helper methods for fetching data and executing sql.

Instance Methods [hide private]
 
__init__(self, conn, dbutils, wrap_cursor=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
last_id(self, table) source code
 
autocommit(self, y=True)
Set the autocommit mode. True values enable; False value disable.
source code
 
commit(self)
Commits the current transaction.
source code
 
rollback(self)
Rolls backs the current transaction.
source code
 
close(self)
Close the connection. No further activity possible.
source code
 
fetch_dbid_by_dbname(self, dbname) source code
 
fetch_seqid_by_display_id(self, dbid, name) source code
 
fetch_seqid_by_accession(self, dbid, name) source code
 
fetch_seqids_by_accession(self, dbid, name) source code
 
fetch_seqid_by_version(self, dbid, name) source code
 
fetch_seqid_by_identifier(self, dbid, identifier) source code
 
list_biodatabase_names(self) source code
 
list_bioentry_ids(self, dbid) source code
 
list_bioentry_display_ids(self, dbid) source code
 
list_any_ids(self, sql, args)
Return ids given a SQL statement to select for them.
source code
 
execute_one(self, sql, args=None)
Execute sql that returns 1 record, and return the record
source code
 
execute(self, sql, args=None)
Just execute an sql command.
source code
 
executemany(self, sql, args)
Execute many sql commands.
source code
 
get_subseq_as_string(self, seqid, start, end) source code
 
execute_and_fetch_col0(self, sql, args=None)
Return a list of values from the first column in the row
source code
 
execute_and_fetchall(self, sql, args=None)
Return a list of tuples of all rows
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, conn, dbutils, wrap_cursor=False)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

list_any_ids(self, sql, args)

source code 

Return ids given a SQL statement to select for them.

This assumes that the given SQL does a SELECT statement that returns a list of items. This parses them out of the 2D list they come as and just returns them in a list.