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

Class MysqlConnectorAdaptor

source code

object --+    
         |    
   Adaptor --+
             |
            MysqlConnectorAdaptor

A BioSQL Adaptor class with fixes for the MySQL interface.

BioSQL was failing due to returns of bytearray objects from the mysql-connector-python database connector. This adaptor class scrubs returns of bytearrays and of byte strings converting them to string objects instead. This adaptor class was made in response to backwards incompatible changes added to mysql-connector-python in release 2.0.0 of the package.

Instance Methods [hide private]
 
execute_one(self, sql, args=None)
Execute sql that returns 1 record, and return the record.
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 Adaptor: __init__, autocommit, close, commit, execute, executemany, fetch_dbid_by_dbname, fetch_seqid_by_accession, fetch_seqid_by_display_id, fetch_seqid_by_identifier, fetch_seqid_by_version, fetch_seqids_by_accession, get_subseq_as_string, last_id, list_any_ids, list_biodatabase_names, list_bioentry_display_ids, list_bioentry_ids, rollback

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]

execute_one(self, sql, args=None)

source code 
Execute sql that returns 1 record, and return the record.
Overrides: Adaptor.execute_one

execute_and_fetch_col0(self, sql, args=None)

source code 
Return a list of values from the first column in the row.
Overrides: Adaptor.execute_and_fetch_col0

execute_and_fetchall(self, sql, args=None)

source code 
Return a list of tuples of all rows.
Overrides: Adaptor.execute_and_fetchall