use super::super::super::result::DdlError;
pub(super) fn ddl_err(sqlstate: &str, message: impl Into<String>) -> DdlError {
DdlError {
sqlstate: sqlstate.to_string(),
message: message.into(),
}
}
pub(super) fn node_state_str(state: nodedb_cluster::NodeState) -> &'static str {
match state {
nodedb_cluster::NodeState::Joining => "joining",
nodedb_cluster::NodeState::Active => "active",
nodedb_cluster::NodeState::Draining => "draining",
nodedb_cluster::NodeState::Learner => "learner",
nodedb_cluster::NodeState::Decommissioned => "decommissioned",
}
}