from importlib.metadata import PackageNotFoundError, version

from buildaquery.compiler import (
    CockroachDbCompiler,
    CompiledQuery,
    DuckDbCompiler,
    MariaDbCompiler,
    MsSqlCompiler,
    MySqlCompiler,
    OracleCompiler,
    PostgresCompiler,
    SqliteCompiler,
)
from buildaquery.execution import (
    CockroachExecutor,
    ConnectionSettings,
    ConnectionTimeoutError,
    DeadlockError,
    DuckDbExecutor,
    ExecutionError,
    ExecutionEvent,
    InMemoryMetricsAdapter,
    InMemoryTracingAdapter,
    IntegrityConstraintError,
    LockTimeoutError,
    MariaDbExecutor,
    MetricPoint,
    MsSqlExecutor,
    MySqlExecutor,
    ObservabilitySettings,
    OracleExecutor,
    PostgresExecutor,
    ProgrammingExecutionError,
    QueryObservation,
    RetryPolicy,
    SerializationError,
    SqliteExecutor,
    TraceEvent,
    TraceSpan,
    TransientExecutionError,
    compose_event_observers,
    execution_event_to_dict,
    make_json_event_logger,
)

try:
    __version__ = version("buildaquery")
except PackageNotFoundError:
    __version__ = "0.0.0"

__all__ = [
    "__version__",
    "PostgresCompiler",
    "SqliteCompiler",
    "MySqlCompiler",
    "MariaDbCompiler",
    "CockroachDbCompiler",
    "DuckDbCompiler",
    "OracleCompiler",
    "MsSqlCompiler",
    "CompiledQuery",
    "PostgresExecutor",
    "SqliteExecutor",
    "MySqlExecutor",
    "MariaDbExecutor",
    "CockroachExecutor",
    "DuckDbExecutor",
    "OracleExecutor",
    "MsSqlExecutor",
    "RetryPolicy",
    "ConnectionSettings",
    "ObservabilitySettings",
    "QueryObservation",
    "ExecutionEvent",
    "TraceEvent",
    "TraceSpan",
    "MetricPoint",
    "InMemoryMetricsAdapter",
    "InMemoryTracingAdapter",
    "compose_event_observers",
    "execution_event_to_dict",
    "make_json_event_logger",
    "ExecutionError",
    "TransientExecutionError",
    "DeadlockError",
    "SerializationError",
    "LockTimeoutError",
    "ConnectionTimeoutError",
    "IntegrityConstraintError",
    "ProgrammingExecutionError",
]
