fundamentals.mysql.readquery¶
Given a mysql query, read the data from the database and return the results as a list of dictionaries (database rows)
- Author
David Young
Module Contents¶
Functions¶
Given a mysql query, read the data from the database and return the results as a list of dictionaries (database rows) |
API¶
- fundamentals.mysql.readquery.readquery(sqlQuery, dbConn, log, quiet=False)[source][source]¶
Given a mysql query, read the data from the database and return the results as a list of dictionaries (database rows)
Key Arguments
log– the logger.sqlQuery– the MySQL command to executedbConn– the db connectionquiet– ignore mysql warnings and errors and move on. Be careful when setting this to true - damaging errors can easily be missed. Default False.
Return
rows– the rows returned by the sql query
Usage
from fundamentals.mysql import readquery rows = readquery( log=log, sqlQuery=sqlQuery, dbConn=dbConn, quiet=False )