From 30587991675368a2da3064bfc584e5a549f25abb Mon Sep 17 00:00:00 2001 From: Imanuel Febie Date: Thu, 14 Nov 2024 02:51:09 +0100 Subject: [PATCH] (backend): Fixed imports --- langkah-api/langkah/lib/config/settings.py | 3 ++- langkah-api/langkah/lib/dependencies/db.py | 4 ++-- langkah-api/langkah/types/models.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/langkah-api/langkah/lib/config/settings.py b/langkah-api/langkah/lib/config/settings.py index b0e44af..fe9dc11 100644 --- a/langkah-api/langkah/lib/config/settings.py +++ b/langkah-api/langkah/lib/config/settings.py @@ -5,5 +5,6 @@ load_dotenv(dotenv_path) -SUPABASE_URL = config("SUPABASE_URL") +SUPABASE_PROJECT_URL = config("SUPABASE_PROJECT_URL") +SUPABASE_DB_URL = config("SUPABASE_DB_URL") SUPABASE_KEY = config("SUPABASE_KEY") diff --git a/langkah-api/langkah/lib/dependencies/db.py b/langkah-api/langkah/lib/dependencies/db.py index d65e423..14a1e27 100644 --- a/langkah-api/langkah/lib/dependencies/db.py +++ b/langkah-api/langkah/lib/dependencies/db.py @@ -2,9 +2,9 @@ from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine -from o4a.lib.config.settings import pg_settings +from langkah.lib.config.settings import SUPABASE_DB_URL -DB_URL = f"postgresql+asyncpg://{pg_settings.postgres_user}:{pg_settings.postgres_password}@{pg_settings.postgres_host}:{pg_settings.postgres_port}/{pg_settings.postgres_db}" +DB_URL = f"{SUPABASE_DB_URL}" engine = create_async_engine(DB_URL) session_maker = async_sessionmaker(engine, expire_on_commit=False) diff --git a/langkah-api/langkah/types/models.py b/langkah-api/langkah/types/models.py index abd0e69..3b8abfc 100644 --- a/langkah-api/langkah/types/models.py +++ b/langkah-api/langkah/types/models.py @@ -15,7 +15,7 @@ from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import Mapped, mapped_column, relationship -from o4a.types.enums import ActivityLevel, Goal, Sex +from langkah.types.enums import ActivityLevel, Goal, Sex Base = declarative_base()