//! SQL translations for math functions

use hamelin_lib::func::defs::{
    Abs, Cbrt, Ceil, Degrees, Euler, Exp, Floor, Ln, Log, Log10, Log2, Pi, Pow, Radians, Round1,
    Round2, Sign, Sqrt, Truncate, WidthBucket2, WidthBucket4,
};

use crate::utils::direct_function_translation;
use crate::TranslationRegistry;

/// Register all math function translations.
pub fn register(registry: &mut TranslationRegistry) {
    // All math functions use direct pass-through translation
    registry.register::<Abs>(direct_function_translation);
    registry.register::<Cbrt>(direct_function_translation);
    registry.register::<Ceil>(direct_function_translation);
    registry.register::<Degrees>(direct_function_translation);
    registry.register::<Euler>(direct_function_translation);
    registry.register::<Exp>(direct_function_translation);
    registry.register::<Floor>(direct_function_translation);
    registry.register::<Ln>(direct_function_translation);
    registry.register::<Log>(direct_function_translation);
    registry.register::<Log10>(direct_function_translation);
    registry.register::<Log2>(direct_function_translation);
    registry.register::<Pi>(direct_function_translation);
    registry.register::<Pow>(direct_function_translation);
    registry.register::<Radians>(direct_function_translation);
    registry.register::<Round1>(direct_function_translation);
    registry.register::<Round2>(direct_function_translation);
    registry.register::<Sign>(direct_function_translation);
    registry.register::<Sqrt>(direct_function_translation);
    registry.register::<Truncate>(direct_function_translation);
    registry.register::<WidthBucket4>(direct_function_translation);
    registry.register::<WidthBucket2>(direct_function_translation);
}
