fix db connection
Browse files- src/repository/common.py +2 -2
src/repository/common.py
CHANGED
|
@@ -12,8 +12,8 @@ def get_connection() -> Generator[psycopg.Connection, None, None]:
|
|
| 12 |
DATABASE_URL = os.getenv("DATABASE_URL")
|
| 13 |
if not DATABASE_URL:
|
| 14 |
raise ValueError("DATABASE_URL is not set in environment variables")
|
| 15 |
-
|
| 16 |
-
conn = psycopg.connect(conninfo=DATABASE_URL)
|
| 17 |
|
| 18 |
try:
|
| 19 |
yield conn
|
|
|
|
| 12 |
DATABASE_URL = os.getenv("DATABASE_URL")
|
| 13 |
if not DATABASE_URL:
|
| 14 |
raise ValueError("DATABASE_URL is not set in environment variables")
|
| 15 |
+
|
| 16 |
+
conn = psycopg.connect(conninfo=DATABASE_URL.replace("+psycopg", ""))
|
| 17 |
|
| 18 |
try:
|
| 19 |
yield conn
|