-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmutations.rs
More file actions
50 lines (45 loc) · 1.4 KB
/
mutations.rs
File metadata and controls
50 lines (45 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use crate::{
interpreter::{ContextArc, options::ChDigViews},
view::ViewProvider,
};
use cursive::Cursive;
use std::collections::HashMap;
pub struct MutationsViewProvider;
impl ViewProvider for MutationsViewProvider {
fn name(&self) -> &'static str {
"Mutations"
}
fn view_type(&self) -> ChDigViews {
ChDigViews::Mutations
}
fn show(&self, siv: &mut Cursive, context: ContextArc) {
let columns = vec![
"database",
"table",
"mutation_id",
"command",
"create_time",
"parts_to_do parts",
"is_done",
"latest_fail_reason",
"latest_fail_time",
];
// TODO:
// - on_submit show assigned merges (but first, need to expose enough info in system tables)
// - sort by create_time OR latest_fail_time
super::render_from_clickhouse_query(
siv,
super::RenderFromClickHouseQueryArguments {
context,
table: "mutations",
join: None,
filter: Some("is_done = 0"),
sort_by: "latest_fail_time",
columns,
columns_to_compare: vec!["database", "table", "mutation_id"],
on_submit: Some(super::query_result_show_row),
settings: HashMap::<&str, i32>::new(),
},
);
}
}