diff --git a/__pycache__/calculos.cpython-311.pyc b/__pycache__/calculos.cpython-311.pyc deleted file mode 100755 index 937015c..0000000 Binary files a/__pycache__/calculos.cpython-311.pyc and /dev/null differ diff --git a/__pycache__/database.cpython-311.pyc b/__pycache__/database.cpython-311.pyc deleted file mode 100755 index 8c522b9..0000000 Binary files a/__pycache__/database.cpython-311.pyc and /dev/null differ diff --git a/__pycache__/main.cpython-311.pyc b/__pycache__/main.cpython-311.pyc deleted file mode 100644 index bed6a87..0000000 Binary files a/__pycache__/main.cpython-311.pyc and /dev/null differ diff --git a/__pycache__/main.cpython-313.pyc b/__pycache__/main.cpython-313.pyc deleted file mode 100644 index c1b648f..0000000 Binary files a/__pycache__/main.cpython-313.pyc and /dev/null differ diff --git a/__pycache__/models.cpython-311.pyc b/__pycache__/models.cpython-311.pyc deleted file mode 100755 index c5ea1df..0000000 Binary files a/__pycache__/models.cpython-311.pyc and /dev/null differ diff --git a/__pycache__/processor.cpython-311.pyc b/__pycache__/processor.cpython-311.pyc deleted file mode 100644 index 1061f49..0000000 Binary files a/__pycache__/processor.cpython-311.pyc and /dev/null differ diff --git a/__pycache__/processor.cpython-313.pyc b/__pycache__/processor.cpython-313.pyc deleted file mode 100644 index 8186d9b..0000000 Binary files a/__pycache__/processor.cpython-313.pyc and /dev/null differ diff --git a/__pycache__/utils.cpython-311.pyc b/__pycache__/utils.cpython-311.pyc deleted file mode 100644 index 4dba972..0000000 Binary files a/__pycache__/utils.cpython-311.pyc and /dev/null differ diff --git a/__pycache__/utils.cpython-313.pyc b/__pycache__/utils.cpython-313.pyc deleted file mode 100644 index 2f5ef5c..0000000 Binary files a/__pycache__/utils.cpython-313.pyc and /dev/null differ diff --git a/app/database.py b/app/database.py index 8789577..4b34c60 100755 --- a/app/database.py +++ b/app/database.py @@ -1,15 +1,18 @@ -from sqlalchemy import create_engine from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine from sqlalchemy.orm import sessionmaker, declarative_base -from contextlib import contextmanager +from contextlib import asynccontextmanager +from dotenv import load_dotenv +import os -# database.py -DATABASE_URL = "postgresql+asyncpg://fatura:102030@ic-postgresql-FtOY:5432/producao" +load_dotenv() + +DATABASE_URL = os.getenv("DATABASE_URL") async_engine = create_async_engine(DATABASE_URL, echo=False, future=True) AsyncSessionLocal = sessionmaker(bind=async_engine, class_=AsyncSession, expire_on_commit=False) Base = declarative_base() +@asynccontextmanager async def get_session(): async with AsyncSessionLocal() as session: - yield session \ No newline at end of file + yield session diff --git a/layouts/__pycache__/equatorial_go.cpython-311.pyc b/layouts/__pycache__/equatorial_go.cpython-311.pyc deleted file mode 100755 index cf32fd2..0000000 Binary files a/layouts/__pycache__/equatorial_go.cpython-311.pyc and /dev/null differ