db issue 1.0

This commit is contained in:
2025-09-20 14:28:31 +03:00
parent 58419b0e14
commit 639bc3c1a9
3 changed files with 11 additions and 8 deletions

View File

@@ -43,7 +43,6 @@ async def CreateUser(user_info):
session.add(new_user)
await session.commit()
await session.refresh(new_user)
print(new_user.id)
async def GetUser(id):
async with AsyncSessionLocal() as session:
result = await session.execute(select(User).where(User.id==id))
@@ -80,10 +79,8 @@ async def LoginUser(user_info):
return None
async def main():
await init_db()
await CreateUser()
await get_all_rows()
#await CreateUser()
# await get_all_rows()
# await UpdateUser(1)
# await GetUser(1)
# await DeleteUser(1)
if __name__ == "__main__":
asyncio.run(main())
# await DeleteUser(1)