summaryrefslogtreecommitdiff
path: root/api/database.py
diff options
context:
space:
mode:
authorLuiz Gustavo Monteiro <luizgu_mreis@hotmail.com>2025-10-28 20:25:17 -0300
committerLuiz Gustavo Monteiro <luizgu_mreis@hotmail.com>2025-10-28 20:25:17 -0300
commit6fed254c8033bf4c67b65328474df6807c3b7eb8 (patch)
treece57462722cdae066b706a78a06d586b5170951b /api/database.py
parent52a4fe2625b63683fcdcd74f704e49aa65cb0dd8 (diff)
refactor folders schema
Diffstat (limited to 'api/database.py')
-rw-r--r--api/database.py10
1 files changed, 10 insertions, 0 deletions
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()