# Mark it as deleted
await session.delete(object)
- async def _execute(self, stmt):
+ async def execute(self, stmt):
"""
Executes a statement and returns a result object
"""
"""
Fetches objects of the given type
"""
- result = await self._execute(stmt)
+ result = await self.execute(stmt)
# Process the result in batches
if batch_size:
yield object
async def fetch_one(self, stmt):
- result = await self._execute(stmt)
+ result = await self.execute(stmt)
# Return exactly one object or none, but fail otherwise
return result.scalar_one_or_none()
"""
Returns the raw result after a SELECT statement
"""
- result = await self._execute(stmt)
+ result = await self.execute(stmt)
# Process mappings
result = result.mappings()
"""
Returns exactly one row
"""
- result = await self._execute(stmt)
+ result = await self.execute(stmt)
# Process mappings
result = result.mappings()