14 lines
418 B
Python
14 lines
418 B
Python
|
from sqlalchemy import create_engine
|
||
|
from sqlalchemy.orm import sessionmaker
|
||
|
from sqlalchemy.ext.declarative import declarative_base
|
||
|
|
||
|
from .config import get_settings
|
||
|
|
||
|
engine = create_engine(
|
||
|
get_settings().pg_dsn, # Get connection string from global settings
|
||
|
echo=get_settings().debug_mode # Get debugmode status from global settings
|
||
|
)
|
||
|
SessionLocal = sessionmaker(engine)
|
||
|
|
||
|
Base = declarative_base()
|