Execute the statement and return a value in the first row. :param args: Query arguments. :param int column: Numeric index within the record of the value to return (defaults to 0). :param float timeout: Optional timeout value in seconds.
(self, *args, column=0, timeout=None)
| 179 | |
| 180 | @connresource.guarded |
| 181 | async def fetchval(self, *args, column=0, timeout=None): |
| 182 | """Execute the statement and return a value in the first row. |
| 183 | |
| 184 | :param args: Query arguments. |
| 185 | :param int column: Numeric index within the record of the value to |
| 186 | return (defaults to 0). |
| 187 | :param float timeout: Optional timeout value in seconds. |
| 188 | If not specified, defaults to the value of |
| 189 | ``command_timeout`` argument to the ``Connection`` |
| 190 | instance constructor. |
| 191 | |
| 192 | :return: The value of the specified column of the first record. |
| 193 | """ |
| 194 | data = await self.__bind_execute(args, 1, timeout) |
| 195 | if not data: |
| 196 | return None |
| 197 | return data[0][column] |
| 198 | |
| 199 | @connresource.guarded |
| 200 | async def fetchrow(self, *args, timeout=None): |