Execute a query. Returns the first row of the result set, or `None`.

def query_row(stmt, args=(), factory=None):
    """
    Execute a query. Returns the first row of the result set, or `None`.
    """
    for row in query(stmt, args, factory):
        return row
    return None