mirror of
https://github.com/flibusta-apps/services_manager_server.git
synced 2025-12-06 12:35:39 +01:00
Init
This commit is contained in:
15
src/core/db.py
Normal file
15
src/core/db.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from urllib.parse import quote
|
||||
from databases import Database
|
||||
|
||||
from sqlalchemy import MetaData
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
|
||||
DATABASE_URL = (
|
||||
f"postgresql://{env_config.POSTGRES_USER}:{quote(env_config.POSTGRES_PASSWORD)}@"
|
||||
f"{env_config.POSTGRES_HOST}:{env_config.POSTGRES_PORT}/{env_config.POSTGRES_DB}"
|
||||
)
|
||||
|
||||
metadata = MetaData()
|
||||
database = Database(DATABASE_URL)
|
||||
Reference in New Issue
Block a user