from typing import Any
from typing import Optional

from .. import util as util
from ..engine import Connection as _LegacyConnection
from ..engine import Engine as _LegacyEngine
from ..engine.base import OptionEngineMixin as OptionEngineMixin

NO_OPTIONS: Any

def create_engine(*arg: Any, **kw: Any): ...

class Connection(_LegacyConnection):
    def begin(self): ...
    def begin_nested(self): ...
    def commit(self) -> None: ...
    def rollback(self) -> None: ...
    def close(self) -> None: ...
    def execute(
        self,
        statement: Any,
        parameters: Optional[Any] = ...,
        execution_options: Optional[Any] = ...,
    ): ...
    def scalar(
        self,
        statement: Any,
        parameters: Optional[Any] = ...,
        execution_options: Optional[Any] = ...,
    ): ...

class Engine(_LegacyEngine):
    transaction: Any = ...
    run_callable: Any = ...
    execute: Any = ...
    scalar: Any = ...
    table_names: Any = ...
    has_table: Any = ...
    class _trans_ctx:
        conn: Any = ...
        def __init__(self, conn: Any) -> None: ...
        transaction: Any = ...
        def __enter__(self): ...
        def __exit__(self, type_: Any, value: Any, traceback: Any) -> None: ...
    def begin(self): ...
    def connect(self): ...

class OptionEngine(OptionEngineMixin, Engine): ...
