use super::args::Commands;
use crate::commands::{admin, cloud, core, infrastructure};
pub(super) enum DbUrlRouting {
Direct,
ProfileDriven,
Unsupported,
}
impl Commands {
pub(super) const fn db_url_routing(&self) -> DbUrlRouting {
match self {
Self::Admin(
admin::AdminCommands::Setup(_)
| admin::AdminCommands::Bootstrap(_)
| admin::AdminCommands::Session(_),
) => DbUrlRouting::ProfileDriven,
Self::Core(core::CoreCommands::Content(_) | core::CoreCommands::Files(_))
| Self::Infra(
infrastructure::InfraCommands::Db(_) | infrastructure::InfraCommands::Logs(_),
)
| Self::Admin(admin::AdminCommands::Users(_))
| Self::Analytics(_)
| Self::Cloud(cloud::CloudCommands::Db(_)) => DbUrlRouting::Direct,
_ => DbUrlRouting::Unsupported,
}
}
}