MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / fetchval

Method fetchval

asyncpg/pool.py:753–765  ·  view source on GitHub ↗

Run a query and return a value in the first row. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.fetchval() `. .. versionadded:: 0.10.0

(self, query, *args, column=0, timeout=None)

Source from the content-addressed store, hash-verified

751 )
752
753 async def fetchval(self, query, *args, column=0, timeout=None):
754 """Run a query and return a value in the first row.
755
756 Pool performs this operation using one of its connections. Other than
757 that, it behaves identically to
758 :meth:`Connection.fetchval()
759 <asyncpg.connection.Connection.fetchval>`.
760
761 .. versionadded:: 0.10.0
762 """
763 async with self.acquire() as con:
764 return await con.fetchval(
765 query, *args, column=column, timeout=timeout)
766
767 async def fetchrow(self, query, *args, timeout=None, record_class=None):
768 """Run a query and return the first row.

Callers 2

startMethod · 0.45
can_be_usedFunction · 0.45

Calls 1

acquireMethod · 0.95

Tested by

no test coverage detected