How to update a table relationship in the database?
async def update_user(self, telegram_id: str, **kwargs) -> None: async with self.session(bind=self.engine) as session: query = (update(User) .where(User.telegram_id == telegram_id) .values(kwargs)) await session.execute(query) await session.commit() I call this function from the Database class in this way: new_interval = int(callback.data.replace(‘set_interval_’, ”)) user_id = callback.from_user.id user = await db.get_user(user_id) user.options.interval = new_interval await db.update_user(user_id, options=user.options) I use sqlalchemy+aiosqlite […]