<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def scalar(self, query, *multiparams, **params):
 """Executes a SQL query and returns a scalar value."""

        res = await self.execute(query, *multiparams, **params)
        return (await res.scalar())