diff options
| author | alex <[email protected]> | 2026-07-15 20:24:31 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2026-07-15 20:24:31 +0200 |
| commit | 8e12cb9bb66adc7adaf6d276133d6f235d294d23 (patch) | |
| tree | 31aa3f6a06407b39bb23d7cc724c70899795a788 /order-service/app/core | |
| download | order-inventory-system-8e12cb9bb66adc7adaf6d276133d6f235d294d23.tar.xz order-inventory-system-8e12cb9bb66adc7adaf6d276133d6f235d294d23.zip | |
init
Diffstat (limited to 'order-service/app/core')
| -rw-r--r-- | order-service/app/core/config.py | 14 | ||||
| -rw-r--r-- | order-service/app/core/database.py | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/order-service/app/core/config.py b/order-service/app/core/config.py new file mode 100644 index 0000000..013b356 --- /dev/null +++ b/order-service/app/core/config.py @@ -0,0 +1,14 @@ +from pydantic_settings import BaseSettings + + +class Settings(BaseSettings): + PROJECT_NAME: str = "Order Service API" + + DATABASE_URL: str + + class Config: + env_file = ".env" + env_file_encoding = "utf-8" + + +settings = Settings() diff --git a/order-service/app/core/database.py b/order-service/app/core/database.py new file mode 100644 index 0000000..55d3e82 --- /dev/null +++ b/order-service/app/core/database.py @@ -0,0 +1,8 @@ +from sqlalchemy import create_engine +from sqlalchemy.orm import declarative_base, sessionmaker +from app.core.config import settings + +engine = create_engine(settings.DATABASE_URL) +SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) + +Base = declarative_base()
\ No newline at end of file |
