Subir todos los cambios recientes a la rama principal

This commit is contained in:
arielit3
2026-01-16 13:39:55 -07:00
parent de5b6feef4
commit 99427cd48c
38 changed files with 15383 additions and 66 deletions

View File

@@ -0,0 +1,18 @@
import os
import asyncio
import asyncpg
def get_database_url():
# Replace 'postgresql+asyncpg' with 'postgresql' for asyncpg compatibility
return os.getenv("DATABASE_URL", "postgresql://servicemanager:servicemanager123@servicemanager-db:5432/servicemanager").replace("postgresql+asyncpg", "postgresql")
async def test_connection():
try:
conn = await asyncpg.connect(get_database_url())
print("Connection to the database was successful!")
await conn.close()
except Exception as e:
print(f"Failed to connect to the database: {e}")
if __name__ == "__main__":
asyncio.run(test_connection())