Skip to content

Commit

Permalink
fix: make the source connection URI optional (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriceclementz authored May 13, 2022
1 parent 182462d commit 67c84c3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions replibyte/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl DatastoreGcpCloudStorageConfig {

#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
pub struct SourceConfig {
pub connection_uri: String,
pub connection_uri: Option<String>,
pub compression: Option<bool>,
pub transformers: Vec<TransformerConfig>,
pub skip: Option<Vec<SkipConfig>>,
Expand All @@ -168,7 +168,13 @@ pub struct SourceConfig {

impl SourceConfig {
pub fn connection_uri(&self) -> Result<ConnectionUri, Error> {
parse_connection_uri(self.connection_uri.as_str())
match &self.connection_uri {
Some(connection_uri) => parse_connection_uri(connection_uri.as_str()),
None => Err(Error::new(
ErrorKind::Other,
format!("missing <source.connection_uri> in the configuration file"),
)),
}
}
}

Expand Down

0 comments on commit 67c84c3

Please sign in to comment.