"""
This type stub file was generated by pyright.
"""
from typing import Optional
from contextlib import asynccontextmanager
from .models import CrawlResult
DB_PATH = ...
DB_PATH = ...
class AsyncDatabaseManager:
def __init__(self, pool_size: int = ..., max_retries: int = ...) -> None:
...
async def initialize(self): # -> None:
"""Initialize the database and connection pool"""
...
async def cleanup(self): # -> None:
"""Cleanup connections when shutting down"""
...
@asynccontextmanager
async def get_connection(self): # -> Generator[Connection, Any, None]:
"""Connection pool manager with enhanced error handling"""
...
async def execute_with_retry(self, operation, *args): # -> None:
"""Execute database operations with retry logic"""
...
async def ainit_db(self): # -> None:
"""Initialize database schema"""
...
async def update_db_schema(self): # -> None:
"""Update database schema if needed"""
...
async def aalter_db_add_column(self, new_column: str, db): # -> None:
"""Add new column to the database"""
...
async def aget_cached_url(self, url: str) -> Optional[CrawlResult]:
"""Retrieve cached URL data as CrawlResult"""
...
async def acache_url(self, result: CrawlResult): # -> None:
"""Cache CrawlResult data"""
...
async def aget_total_count(self) -> int:
"""Get total number of cached URLs"""
...
async def aclear_db(self): # -> None:
"""Clear all data from the database"""
...
async def aflush_db(self): # -> None:
"""Drop the entire table"""
...
async_db_manager = ...