• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

getdozer / dozer / 3977575075

pending completion
3977575075

push

github

GitHub
Chore/apply flags config (#664)

139 of 139 new or added lines in 10 files covered. (100.0%)

22504 of 34428 relevant lines covered (65.37%)

72228.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

28.57
/dozer-types/src/models/source.rs
1
use super::connection::Connection;
2
use serde::{ser::SerializeStruct, Deserialize, Serialize};
3

4
#[derive(Deserialize, Eq, PartialEq, Clone, ::prost::Message)]
62✔
5
pub struct Source {
6
    #[serde(skip_serializing_if = "Option::is_none")]
7
    #[prost(string, optional, tag = "1")]
8
    pub id: Option<String>,
9
    #[serde(skip_serializing_if = "Option::is_none")]
10
    #[prost(string, optional, tag = "2")]
11
    pub app_id: Option<String>,
12
    #[prost(string, tag = "3")]
13
    /// name of the source - to distinguish between multiple sources; Type: String
14
    pub name: String,
15
    #[prost(string, tag = "4")]
16
    /// name of the table in source database; Type: String
17
    pub table_name: String,
18
    #[prost(string, repeated, tag = "5")]
19
    /// list of columns gonna be used in the source table; Type: String[]
20
    pub columns: Vec<String>,
21
    #[prost(message, tag = "6")]
22
    #[serde(skip_deserializing)]
23
    /// reference to pre-defined connection name - syntax: `!Ref <connection_name>`; Type: `Ref!` tag
24
    pub connection: Option<Connection>,
25
    #[prost(oneof = "RefreshConfig", tags = "7")]
26
    #[serde(default = "default_refresh_config")]
27
    /// setting for how to refresh the data; Default: RealTime
28
    pub refresh_config: Option<RefreshConfig>,
29
}
30
fn default_refresh_config() -> Option<RefreshConfig> {
1✔
31
    Some(RefreshConfig::default())
1✔
32
}
1✔
33
impl Serialize for Source {
34
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
×
35
    where
×
36
        S: serde::Serializer,
×
37
    {
×
38
        let mut state = serializer.serialize_struct("Source", 5)?;
×
39
        state.serialize_field("name", &self.name)?;
×
40
        state.serialize_field("table_name", &self.table_name)?;
×
41
        state.serialize_field("columns", &self.columns)?;
×
42
        state.serialize_field(
×
43
            "connection",
×
44
            &Value::Ref(self.connection.to_owned().unwrap_or_default().name),
×
45
        )?;
×
46
        state.serialize_field("refresh_config", &self.refresh_config)?;
×
47
        state.end()
×
48
    }
×
49
}
50
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone)]
4✔
51
pub enum Value {
52
    Ref(String),
53
}
54

55
#[derive(Serialize, Deserialize, Eq, PartialEq, Clone, Debug)]
×
56
pub enum HistoryType {
57
    Master(MasterHistoryConfig),
58
    Transactional(TransactionalHistoryConfig),
59
}
60
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone)]
×
61
pub enum MasterHistoryConfig {
62
    AppendOnly {
63
        unique_key_field: String,
64
        open_date_field: String,
65
        closed_date_field: String,
66
    },
67
    Overwrite,
68
}
69

70
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone)]
×
71
pub enum TransactionalHistoryConfig {
72
    RetainPartial {
73
        timestamp_field: String,
74
        retention_period: u32,
75
    },
76
}
77
#[derive(Serialize, Deserialize, Eq, PartialEq, Clone, ::prost::Oneof)]
×
78
pub enum RefreshConfig {
79
    // Hour { minute: u32 },
80
    // Day { time: String },
81
    // CronExpression { expression: String },
82
    #[prost(message, tag = "7")]
83
    RealTime(RealTimeConfig),
84
}
85
impl Default for RefreshConfig {
86
    fn default() -> Self {
89✔
87
        RefreshConfig::RealTime(RealTimeConfig {})
89✔
88
    }
89✔
89
}
90
#[derive(Serialize, Deserialize, Eq, PartialEq, Clone, ::prost::Message)]
×
91
pub struct RealTimeConfig {}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc