Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove FlowSyncMode from nexus #1468

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions nexus/pt/src/flow_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,6 @@ pub struct FlowJobTableMapping {
pub exclude: Vec<String>,
}

#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
pub enum FlowSyncMode {
Avro,
SQL,
}

impl FlowSyncMode {
pub fn parse_string(s: &str) -> Result<FlowSyncMode, String> {
match s {
"avro" => Ok(FlowSyncMode::Avro),
"sql" => Ok(FlowSyncMode::SQL),
_ => Err(format!("{} is not a valid FlowSyncMode", s)),
}
}
}

impl std::str::FromStr for FlowSyncMode {
type Err = String;

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"avro" => Ok(FlowSyncMode::Avro),
"default" => Ok(FlowSyncMode::SQL),
_ => Err(format!("{} is not a valid FlowSyncMode", s)),
}
}
}

impl ToString for FlowSyncMode {
fn to_string(&self) -> String {
match self {
FlowSyncMode::Avro => "avro".to_string(),
FlowSyncMode::SQL => "default".to_string(),
}
}
}

#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
pub struct FlowJob {
pub name: String,
Expand Down
Loading