async def scalar(query, as_tuple=False):
cursor = await _execute_query_async(query)<EOL>try:<EOL><INDENT>row = await cursor.fetchone()<EOL><DEDENT>finally:<EOL><INDENT>await cursor.release()<EOL><DEDENT>if row and not as_tuple:<EOL><INDENT>return row[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>return row<EOL><DEDENT>
Get single value from ``select()`` query, i.e. for aggregation.

    :return: result is the same as after sync ``query.scalar()`` call