"""Database session management."""
from .models import Database
from agentpaas.config import settings

_db: Database = None

def get_db() -> Database:
    global _db
    if _db is None:
        _db = Database(settings.database_url)
    return _db
