# Type stubs for vibesql module

# DB-API 2.0 module-level attributes
apilevel: str
threadsafety: int
paramstyle: str

# Module-level exceptions
class Warning(Exception):
    """Base class for all database warnings."""
    ...

class Error(Exception):
    """Base class for all database errors."""
    ...

class InterfaceError(Error):
    """Exception for interface-related errors."""
    ...

class DatabaseError(Error):
    """Exception for database-related errors."""
    ...

class DataError(DatabaseError):
    """Exception for data errors."""
    ...

class OperationalError(DatabaseError):
    """Exception for operational errors."""
    ...

class IntegrityError(DatabaseError):
    """Exception for integrity errors."""
    ...

class InternalError(DatabaseError):
    """Exception for internal errors."""
    ...

class ProgrammingError(DatabaseError):
    """Exception for programming errors."""
    ...

class NotSupportedError(DatabaseError):
    """Exception for unsupported features."""
    ...

# Connection class
class Database:
    def cursor(self) -> Cursor: ...
    def close(self) -> None: ...
    def commit(self) -> None: ...
    def version(self) -> str: ...
    def save(self, path: str) -> None: ...
    @staticmethod
    def load(path: str) -> "Database": ...

# Cursor class
class Cursor:
    def execute(self, sql: str, params=None) -> None: ...
    def executemany(self, sql: str, seq_of_params) -> None: ...
    def fetchone(self): ...
    def fetchmany(self, size: int): ...
    def fetchall(self): ...
    def close(self) -> None: ...
    
    @property
    def description(self): ...
    
    @property
    def rowcount(self) -> int: ...
    
    def cache_stats(self): ...
    def schema_cache_stats(self): ...
    def clear_cache(self) -> None: ...

# Factory function
def connect() -> Database: ...

# Profiling functions
def enable_profiling() -> None: ...
def disable_profiling() -> None: ...
