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

getdozer / dozer / 4007818786

pending completion
4007818786

Pull #733

github

GitHub
Merge baf5c38aa into 6c0ac2b2c
Pull Request #733: Bump diesel from 2.0.2 to 2.0.3

23389 of 34432 relevant lines covered (67.93%)

40326.78 hits per line

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

94.21
/dozer-cache/src/cache/test_utils.rs
1
use dozer_types::types::{
2
    FieldDefinition, IndexDefinition, Schema, SchemaIdentifier, SourceDefinition,
3
};
×
4

×
5
pub fn schema_0() -> (Schema, Vec<IndexDefinition>) {
5✔
6
    (
5✔
7
        Schema {
5✔
8
            identifier: Some(SchemaIdentifier { id: 0, version: 1 }),
5✔
9
            fields: vec![FieldDefinition {
5✔
10
                name: "foo".to_string(),
5✔
11
                typ: dozer_types::types::FieldType::String,
5✔
12
                nullable: true,
5✔
13
                source: SourceDefinition::Dynamic,
5✔
14
            }],
5✔
15
            primary_index: vec![0],
5✔
16
        },
5✔
17
        vec![IndexDefinition::SortedInverted(vec![0])],
5✔
18
    )
5✔
19
}
5✔
20

×
21
pub fn schema_1() -> (Schema, Vec<IndexDefinition>) {
18✔
22
    (
18✔
23
        Schema {
18✔
24
            identifier: Some(SchemaIdentifier { id: 1, version: 1 }),
18✔
25
            fields: vec![
18✔
26
                FieldDefinition {
18✔
27
                    name: "a".to_string(),
18✔
28
                    typ: dozer_types::types::FieldType::Int,
18✔
29
                    nullable: true,
18✔
30
                    source: SourceDefinition::Dynamic,
18✔
31
                },
18✔
32
                FieldDefinition {
18✔
33
                    name: "b".to_string(),
18✔
34
                    typ: dozer_types::types::FieldType::String,
18✔
35
                    nullable: true,
18✔
36
                    source: SourceDefinition::Dynamic,
18✔
37
                },
18✔
38
                FieldDefinition {
18✔
39
                    name: "c".to_string(),
18✔
40
                    typ: dozer_types::types::FieldType::Int,
18✔
41
                    nullable: true,
18✔
42
                    source: SourceDefinition::Dynamic,
18✔
43
                },
18✔
44
            ],
18✔
45
            primary_index: vec![0],
18✔
46
        },
18✔
47
        vec![
18✔
48
            IndexDefinition::SortedInverted(vec![0]),
18✔
49
            IndexDefinition::SortedInverted(vec![1]),
18✔
50
            IndexDefinition::SortedInverted(vec![2]),
18✔
51
            // composite index
18✔
52
            IndexDefinition::SortedInverted(vec![0, 1]),
18✔
53
        ],
18✔
54
    )
18✔
55
}
18✔
56

×
57
pub fn schema_full_text() -> (Schema, Vec<IndexDefinition>) {
1✔
58
    (
1✔
59
        Schema {
1✔
60
            identifier: Some(SchemaIdentifier { id: 2, version: 1 }),
1✔
61
            fields: vec![
1✔
62
                FieldDefinition {
1✔
63
                    name: "foo".to_string(),
1✔
64
                    typ: dozer_types::types::FieldType::String,
1✔
65
                    nullable: false,
1✔
66
                    source: SourceDefinition::Dynamic,
1✔
67
                },
1✔
68
                FieldDefinition {
1✔
69
                    name: "bar".to_string(),
1✔
70
                    typ: dozer_types::types::FieldType::Text,
1✔
71
                    nullable: false,
1✔
72
                    source: SourceDefinition::Dynamic,
1✔
73
                },
1✔
74
            ],
1✔
75
            primary_index: vec![0],
1✔
76
        },
1✔
77
        vec![IndexDefinition::FullText(0), IndexDefinition::FullText(1)],
1✔
78
    )
1✔
79
}
1✔
80

×
81
// This is for testing appending only schema, which doesn't need a primary index, for example, eth logs.
×
82
pub fn schema_empty_primary_index() -> (Schema, Vec<IndexDefinition>) {
1✔
83
    (
1✔
84
        Schema {
1✔
85
            identifier: Some(SchemaIdentifier { id: 3, version: 1 }),
1✔
86
            fields: vec![FieldDefinition {
1✔
87
                name: "foo".to_string(),
1✔
88
                typ: dozer_types::types::FieldType::String,
1✔
89
                nullable: false,
1✔
90
                source: SourceDefinition::Dynamic,
1✔
91
            }],
1✔
92
            primary_index: vec![],
1✔
93
        },
1✔
94
        vec![IndexDefinition::SortedInverted(vec![0])],
1✔
95
    )
1✔
96
}
1✔
97

×
98
pub fn schema_multi_indices() -> (Schema, Vec<IndexDefinition>) {
1✔
99
    (
1✔
100
        Schema {
1✔
101
            identifier: Some(SchemaIdentifier { id: 4, version: 1 }),
1✔
102
            fields: vec![
1✔
103
                FieldDefinition {
1✔
104
                    name: "id".to_string(),
1✔
105
                    typ: dozer_types::types::FieldType::Int,
1✔
106
                    nullable: false,
1✔
107
                    source: SourceDefinition::Dynamic,
1✔
108
                },
1✔
109
                FieldDefinition {
1✔
110
                    name: "text".to_string(),
1✔
111
                    typ: dozer_types::types::FieldType::String,
1✔
112
                    nullable: false,
1✔
113
                    source: SourceDefinition::Dynamic,
1✔
114
                },
1✔
115
            ],
1✔
116
            primary_index: vec![0],
1✔
117
        },
1✔
118
        vec![
1✔
119
            IndexDefinition::SortedInverted(vec![0]),
1✔
120
            IndexDefinition::FullText(1),
1✔
121
        ],
1✔
122
    )
1✔
123
}
1✔
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