ic_db_cli/lib.rs
1//! Request types shared by the local DB console and its fixture canister.
2#![forbid(unsafe_code)]
3
4#[cfg(feature = "host")]
5pub mod host;
6
7/// Row predicates carried by the local query and retained-aggregate commands.
8#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
9pub struct RowFilters {
10 /// Lower bound, upper bound, prefix, suffix and substring on BinaryObject.payload.
11 pub payload: [Option<Vec<u8>>; 5],
12 /// Left field, comparison, right field.
13 pub compare: Option<[String; 3]>,
14 /// Field, comparison and length threshold.
15 pub length: Option<(String, String, u32)>,
16 /// Require a value in this optional field.
17 pub present: Option<String>,
18 /// Require absence in this optional field.
19 pub absent: Option<String>,
20 /// Field, comparison and exact UTF-8 literal.
21 pub text: Option<[String; 3]>,
22 /// Field and Boolean equality operand.
23 pub boolean: Option<(String, bool)>,
24 /// Field, inclusive lower field and inclusive upper field.
25 pub between_fields: Option<[String; 3]>,
26 /// Field, lower field and upper field for the strict outside-range comparison.
27 pub not_between_fields: Option<[String; 3]>,
28}
29
30/// Selection shared by the private retained fixture when starting and resuming a job.
31pub type RetainedSelection = (
32 String,
33 String,
34 (Option<u64>, Option<u64>, Option<u64>),
35 u32,
36 (Option<String>, Option<String>),
37 Option<String>,
38 RowFilters,
39 (Vec<String>, bool),
40);