From fa9d40f6a765704fe6b243348d1734ef98372fc0 Mon Sep 17 00:00:00 2001 From: Mark Murnane Date: Tue, 15 Oct 2024 19:52:58 -0400 Subject: [PATCH] Using psycopg3 --- backend/tests/conftest.py | 6 +++--- terraform/main.tf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index 04697da..6ff63c3 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -14,14 +14,14 @@ def csrf(client): def tuber(postgresql, redis=False): os.environ['FLASK_DEBUG'] = "true" os.environ['REDIS_URL'] = "" - os.environ['DATABASE_URL'] = f"postgresql://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}" + os.environ['DATABASE_URL'] = f"postgresql+psycopg://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}" os.environ['CIRCUITBREAKER_TIMEOUT'] = "5" os.environ['ENABLE_CIRCUITBREAKER'] = "true" mod = importlib.import_module('tuber') tuber.backgroundjobs = importlib.import_module('tuber.backgroundjobs') settings_override = { 'TESTING': True, - 'SQLALCHEMY_DATABASE_URI': f"postgresql://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}" + 'SQLALCHEMY_DATABASE_URI': f"postgresql+psycopg://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}" } mod.app.config.update(settings_override) if redis: @@ -123,7 +123,7 @@ def delete(*args, handle_async=True, **kwargs): @pytest.fixture def prod_client(postgresql): os.environ['REDIS_URL'] = "" - os.environ['DATABASE_URL'] = f"postgresql://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}" + os.environ['DATABASE_URL'] = f"postgresql+psycopg://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}" os.environ['CIRCUITBREAKER_TIMEOUT'] = "5" os.environ['FLASK_DEBUG'] = "false" tuber = importlib.import_module('tuber') diff --git a/terraform/main.tf b/terraform/main.tf index 7908bd4..1902c63 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -430,7 +430,7 @@ resource "aws_ecs_task_definition" "tuber" { }, { "name": "DATABASE_URL", - "value": "postgresql://tuber:${random_password.tuber_db.result}@${aws_db_instance.tuber.endpoint}/tuber" + "value": "postgresql+psycopg://tuber:${random_password.tuber_db.result}@${aws_db_instance.tuber.endpoint}/tuber" }, { "name": "GENDER_MAP",