Update a Platform session's updated_at timestamp and optionally display_name.
(
self,
session_id: str,
display_name: str | None = None,
)
| 1780 | return sessions_with_projects, total |
| 1781 | |
| 1782 | async def update_platform_session( |
| 1783 | self, |
| 1784 | session_id: str, |
| 1785 | display_name: str | None = None, |
| 1786 | ) -> None: |
| 1787 | """Update a Platform session's updated_at timestamp and optionally display_name.""" |
| 1788 | async with self.get_db() as session: |
| 1789 | session: AsyncSession |
| 1790 | async with session.begin(): |
| 1791 | values: dict[str, T.Any] = {"updated_at": datetime.now(timezone.utc)} |
| 1792 | if display_name is not None: |
| 1793 | values["display_name"] = display_name |
| 1794 | |
| 1795 | await session.execute( |
| 1796 | update(PlatformSession) |
| 1797 | .where(col(PlatformSession.session_id) == session_id) |
| 1798 | .values(**values), |
| 1799 | ) |
| 1800 | |
| 1801 | async def delete_platform_session(self, session_id: str) -> None: |
| 1802 | """Delete a Platform session by its ID.""" |