Created
October 20, 2022 08:27
-
-
Save Glukhoff/24bdc34c2e75e7a97ffa0fd40edb554f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql = update(TrackedAccounts) \ | |
.where(TrackedAccounts.auth_key == deep_link_key) \ | |
.values( | |
is_active=True, | |
chat_id=chat_id, | |
auth_key=None, | |
updated_at=datetime.fromisoformat(datetime.now().isoformat()), | |
).returning(TrackedAccounts.id) | |
async with db_session() as session: | |
selection = await session.execute(sql) | |
returned_id = selection.scalar() | |
await session.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment