//! Hamelin facade crate
//!
//! This crate provides a unified entry point for the Hamelin ecosystem.
//! Start with [`parse`] to get an AST, then [`type_check`] to type-check it.
//! All functions return [`WithTranslationErrors`] which can be converted to
//! `Result` via `.result()`, or destructured to access `.output` and `.errors`.
//!
//! # Feature flags
//!
//! - `trino`: Trino backend support (re-exports `hamelin_trino` as `trino`)
//! - `datafusion`: DataFusion backend support (re-exports `hamelin_datafusion` as `datafusion`)
//! - `duckdb`: DuckDB backend support (re-exports `hamelin_duckdb` as `duckdb`)
//! - `error_rendering`: Enhanced error rendering with source context

// Re-export the core library
pub use hamelin_lib as lib;

// Top-level parse / type_check API
pub use hamelin_lib::{
    parse, parse_and_typecheck, parse_and_typecheck_with_options, parse_with_options, type_check,
    type_check_expression, type_check_with_options, type_check_with_provider,
    type_check_with_time_range,
};

// Key types callers need alongside the API functions
pub use hamelin_lib::err::{TranslationErrors, WithTranslationErrors};
pub use hamelin_lib::interner::Interner;
pub use hamelin_lib::time_range::TimeRange;
pub use hamelin_lib::tree::ast::query::Query;
pub use hamelin_lib::tree::options::{
    ExpressionTypeCheckOptions, ParseOptions, TranslateOptions, TypeCheckOptions,
};
pub use hamelin_lib::tree::typed_ast::query::TypedStatement;

// Backend modules behind feature flags
#[cfg(feature = "trino")]
pub use hamelin_trino as trino;

#[cfg(feature = "datafusion")]
pub use hamelin_datafusion as datafusion;

#[cfg(feature = "duckdb")]
pub use hamelin_duckdb as duckdb;

#[cfg(any(feature = "trino", feature = "duckdb", feature = "datafusion"))]
pub use hamelin_executor as executor;
