From 6fed254c8033bf4c67b65328474df6807c3b7eb8 Mon Sep 17 00:00:00 2001 From: Luiz Gustavo Monteiro Date: Tue, 28 Oct 2025 20:25:17 -0300 Subject: refactor folders schema --- api/database.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 api/database.py (limited to 'api/database.py') diff --git a/api/database.py b/api/database.py new file mode 100644 index 0000000..c0691a1 --- /dev/null +++ b/api/database.py @@ -0,0 +1,10 @@ +from sqlalchemy import create_engine +from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy.orm import sessionmaker +import os + +DATABASE_URL = os.getenv("DATABASE_URL", "postgresql://root:public@postgres:5432/control_station") + +engine = create_engine(DATABASE_URL) +SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) +Base = declarative_base() -- cgit v1.2.3