Versão em produção - código extraído do container

This commit is contained in:
root
2025-07-27 23:25:13 -03:00
commit 7ff259ef08
63 changed files with 7707 additions and 0 deletions

20
testar_fatura.py Executable file
View File

@@ -0,0 +1,20 @@
import asyncio
from sqlalchemy.ext.asyncio import create_async_engine
from sqlalchemy import text
DATABASE_URL = "postgresql+asyncpg://fatura:102030@ic-postgresql-FtOY:5432/app_faturas"
engine = create_async_engine(DATABASE_URL, echo=True)
async def testar_conexao():
try:
async with engine.connect() as conn:
result = await conn.execute(text("SELECT 1"))
row = await result.fetchone()
print("Resultado:", row)
except Exception as e:
print("Erro ao conectar no banco:", e)
if __name__ == "__main__":
asyncio.run(testar_conexao())