def _query_and_fetchone(self, query):
    'Creates a new connection, executes a query and fetches one result.\n        \n        :param query: query to execute\n        :return: the first result fetched by cursor.fetchone()\n        '
    with self._connect() as conn:
        cur = conn.cursor()
        cur.execute(query)
        result = cur.fetchone()
    return result
Creates a new connection, executes a query and fetches one result.

:param query: query to execute
:return: the first result fetched by cursor.fetchone()
def _query_and_fetchone(self, query):
    'Creates a new connection, executes a query and fetches one result.\n        \n        :param query: query to execute\n        :return: the first result fetched by cursor.fetchone()\n        '
    with self._connect() as conn:
        cur = conn.cursor()
        cur.execute(query)
        result = cur.fetchone()
    return result