'Executes the sql and returns a set of records.
:param sql: the sql statement to be executed (str) or a list of
sql statements to execute
:type sql: str or list
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable'

def get_records(self, sql, parameters=None):

    if (sys.version_info[0] < 3):
        sql = sql.encode('utf-8')
    with closing(self.get_conn()) as conn:
        with closing(conn.cursor()) as cur:
            if (parameters is not None):
                cur.execute(sql, parameters)
            else:
                cur.execute(sql)
            return cur.fetchall()
