This commit is contained in:
2025-12-27 17:24:30 +01:00
parent ea485bad29
commit f8dc6566bc
7 changed files with 542 additions and 0 deletions

14
db.py Normal file
View File

@@ -0,0 +1,14 @@
from dotenv import load_dotenv
import os, psycopg
load_dotenv()
def get_conn():
return psycopg.connect(
host=os.getenv("PG_HOST"),
port=int(os.getenv("PG_PORT", 5432)),
dbname=os.getenv("PG_DB"),
user=os.getenv("PG_USER"),
password=os.getenv("PG_PASS"),
connect_timeout=5,
)