From da8031c1aa101d6637efc78ba36eeba93c543b10 Mon Sep 17 00:00:00 2001 From: Chris Weaver <25087905+Weves@users.noreply.github.com> Date: Thu, 11 May 2023 22:49:44 -0700 Subject: [PATCH] Fix sync DB engine (#32) --- backend/danswer/db/engine.py | 3 ++- backend/requirements/default.txt | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/danswer/db/engine.py b/backend/danswer/db/engine.py index 7bcf8a562..de94e1609 100644 --- a/backend/danswer/db/engine.py +++ b/backend/danswer/db/engine.py @@ -10,6 +10,7 @@ from sqlalchemy.ext.asyncio import create_async_engine from sqlalchemy.orm import Session +SYNC_DB_API = "psycopg2" ASYNC_DB_API = "asyncpg" # below are intended to match the env variables names used by the official # postgres docker image https://hub.docker.com/_/postgres @@ -33,7 +34,7 @@ def build_connection_string( def build_engine() -> Engine: - connection_string = build_connection_string() + connection_string = build_connection_string(db_api=SYNC_DB_API) return create_engine(connection_string) diff --git a/backend/requirements/default.txt b/backend/requirements/default.txt index e3417e5db..13100e41a 100644 --- a/backend/requirements/default.txt +++ b/backend/requirements/default.txt @@ -14,6 +14,8 @@ httpx-oauth==0.11.2 Mako==1.2.4 openai==0.27.6 playwright==1.32.1 +psycopg2==2.9.6 +psycopg2-binary==2.9.6 pydantic==1.10.7 PyGithub==1.58.2 PyPDF2==3.0.1