not working shit

This commit is contained in:
2023-11-12 22:43:47 +03:00
commit 9f76abcfc4
10 changed files with 410 additions and 0 deletions

17
bot/app/db/settings.py Normal file
View File

@ -0,0 +1,17 @@
from dataclasses import dataclass
import os
@dataclass
class Settings:
dialect: str = os.getenv("DIALECT", "postgresql")
driver: str = os.getenv("DRIVER", "psycopg2")
user: str = os.getenv("USER", "user")
password: str = os.getenv("PASSWORD", "password")
db_name: str = os.getenv("DB_NAME", "db")
host: str = os.getenv("HOST", "postgres")
port: int = os.getenv("PORT", 5432)
@property
def uri(self) -> str:
return f"{self.dialect}+{self.driver}://{self.user}:{self.password}@{self.host}:{self.port}/{self.db_name}"