mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
18 lines
286 B
Python
18 lines
286 B
Python
import os
|
|
from functools import lru_cache
|
|
|
|
from pydantic import PostgresDsn
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
asyncpg_url: PostgresDsn = os.getenv("SQL_URL")
|
|
|
|
|
|
@lru_cache
|
|
def get_settings():
|
|
return Settings()
|
|
|
|
|
|
settings = get_settings()
|