@lD.log((logBase + '.getSingleDataIterator'))
def getSingleDataIterator(logger, query, values=None, dbName=None):
    'Create an iterator from a largish query\n    \n    This is a generator that returns values in chunks of chunksize 1.\n    \n    Parameters\n    ----------\n    logger : {logging.logger}\n        logging element \n    query : {str}\n        The query to be made to the databse\n    values : {tuple or list-like}, optional\n        Additional values to be passed to the query (the default \n        is None)\n    dbName : {str or None}, optional\n        The name of the database to use. If this is None, the function will \n        attempt to read the name from the ``defaultDB`` item within the \n        file ``../config/db.json``. \n    \n    Yields\n    ------\n    list of tuples\n        A list of tuples from the query, with a maximum of ``chunks`` tuples returned\n        at one time. \n    '
    try:
        db = jsonref.load(open('../config/db.json'))
        if ((dbName is None) and ('defaultDB' in db)):
            dbName = db['defaultDB']
        if (dbName is None):
            logger.error('A database name has not been specified.')
            return None
        conn = sqlite3.connect(db[dbName]['connection'])
        cur = conn.cursor()
    except Exception as e:
        logger.error('Unable to connect to the database')
        logger.error(str(e))
        return
    try:
        if (values is None):
            cur.execute(query)
        else:
            cur.execute(query, values)
        while True:
            vals = cur.fetchone()
            if (vals is None):
                break
            (yield vals)
    except Exception as e:
        logger.error('Unable to obtain data from the database for:\n query: {}\nvalues'.format(query, values))
        logger.error(str(e))
    try:
        conn.close()
    except Exception as e:
        logger.error('Unable to disconnect to the database')
        logger.error(str(e))
        return
    return
Create an iterator from a largish query

This is a generator that returns values in chunks of chunksize 1.

Parameters
----------
logger : {logging.logger}
    logging element 
query : {str}
    The query to be made to the databse
values : {tuple or list-like}, optional
    Additional values to be passed to the query (the default 
    is None)
dbName : {str or None}, optional
    The name of the database to use. If this is None, the function will 
    attempt to read the name from the ``defaultDB`` item within the 
    file ``../config/db.json``. 

Yields
------
list of tuples
    A list of tuples from the query, with a maximum of ``chunks`` tuples returned
    at one time.
@lD.log((logBase + '.getSingleDataIterator'))
def getSingleDataIterator(logger, query, values=None, dbName=None):
    'Create an iterator from a largish query\n    \n    This is a generator that returns values in chunks of chunksize 1.\n    \n    Parameters\n    ----------\n    logger : {logging.logger}\n        logging element \n    query : {str}\n        The query to be made to the databse\n    values : {tuple or list-like}, optional\n        Additional values to be passed to the query (the default \n        is None)\n    dbName : {str or None}, optional\n        The name of the database to use. If this is None, the function will \n        attempt to read the name from the ``defaultDB`` item within the \n        file ``../config/db.json``. \n    \n    Yields\n    ------\n    list of tuples\n        A list of tuples from the query, with a maximum of ``chunks`` tuples returned\n        at one time. \n    '
    try:
        db = jsonref.load(open('../config/db.json'))
        if ((dbName is None) and ('defaultDB' in db)):
            dbName = db['defaultDB']
        if (dbName is None):
            logger.error('A database name has not been specified.')
            return None
        conn = sqlite3.connect(db[dbName]['connection'])
        cur = conn.cursor()
    except Exception as e:
        logger.error('Unable to connect to the database')
        logger.error(str(e))
        return
    try:
        if (values is None):
            cur.execute(query)
        else:
            cur.execute(query, values)
        while True:
            vals = cur.fetchone()
            if (vals is None):
                break
            (yield vals)
    except Exception as e:
        logger.error('Unable to obtain data from the database for:\n query: {}\nvalues'.format(query, values))
        logger.error(str(e))
    try:
        conn.close()
    except Exception as e:
        logger.error('Unable to disconnect to the database')
        logger.error(str(e))
        return
    return