#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum InspectorFeature {
    Info,
    Columns,
    Indexes,
    ForeignKeys,
    Rls,
    Triggers,
    Ddl,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DatabaseCapabilities {
    supports_explain: bool,
    supported_inspector_features: Vec<InspectorFeature>,
}

impl DatabaseCapabilities {
    pub fn new(
        supports_explain: bool,
        supported_inspector_features: Vec<InspectorFeature>,
    ) -> Self {
        assert!(
            !supported_inspector_features.is_empty(),
            "DatabaseCapabilities requires at least one supported inspector feature"
        );
        Self {
            supports_explain,
            supported_inspector_features,
        }
    }

    pub fn supports_explain(&self) -> bool {
        self.supports_explain
    }

    pub fn supported_inspector_features(&self) -> &[InspectorFeature] {
        &self.supported_inspector_features
    }
}

pub trait DatabaseCapabilityProvider {
    fn capabilities(&self) -> DatabaseCapabilities;
}
