Add source

This commit is contained in:
2025-12-04 00:12:56 +03:00
parent b75875df5e
commit 0cb7045e7a
75 changed files with 9055 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
"""
Database module (ORM)
"""

View File

@@ -0,0 +1,7 @@
"""
ORM models for bot (imported from shared)
"""
from shared.database.models import User, Task, Download
__all__ = ["User", "Task", "Download"]

View File

@@ -0,0 +1,22 @@
"""
Database session management (wrapper over shared module)
Uses unified module from shared/database/session.py
"""
from shared.database.session import (
init_db,
get_async_session_local,
get_engine
)
# For backward compatibility - get session factory
def get_AsyncSessionLocal():
"""Get session factory (for backward compatibility)"""
return get_async_session_local()
# Create object for backward compatibility
AsyncSessionLocal = get_async_session_local()
engine = get_engine()
# Export functions
__all__ = ['init_db', 'AsyncSessionLocal', 'engine']