Build the SQL for `SHOW GRAPH STATS` for the native protocol. Collection and `as_of` are both optional; when absent the corresponding clause is omitted entirely.
(collection: Option<&str>, as_of: Option<i64>)
| 127 | /// and `as_of` are both optional; when absent the corresponding clause is |
| 128 | /// omitted entirely. |
| 129 | pub(crate) fn build_native_graph_stats_sql(collection: Option<&str>, as_of: Option<i64>) -> String { |
| 130 | let mut sql = "SHOW GRAPH STATS".to_string(); |
| 131 | if let Some(c) = collection { |
| 132 | sql.push(' '); |
| 133 | sql.push_str("e_string_literal(c)); |
| 134 | } |
| 135 | if let Some(ms) = as_of { |
| 136 | sql.push_str(&format!(" AS OF SYSTEM TIME {ms}")); |
| 137 | } |
| 138 | sql |
| 139 | } |
| 140 | |
| 141 | /// Parse a multi-row response from `SHOW GRAPH STATS` into a vec of |
| 142 | /// `GraphStats`. Empty rows produce an empty vec. Column-shape mismatches |