INNER CODE UNIT · Python
update_filtered
c0sogi/LLMChat · app/database/schemas/__init__.py:75
async def update_filtered(
cls: Type[TableGeneric],
*criteria: ExpressionElementRole[bool],
updated: dict,
autocommit: bool = False,
refresh: bool = False,
session: AsyncSession | None = None,
) -> TableGeneric:
stmt = update(cls).filter(*criteria).values(**updated)
return await db.run_in_session(db._execute)(
session,
autocommit=autocommit,
refresh=refresh,
stmt=stmt,
)
@classmethod
async def delete_filtered(