(msg: &CommandCompleteMessage)
| 119 | } |
| 120 | |
| 121 | fn retrieve_row_count(msg: &CommandCompleteMessage) -> usize { |
| 122 | let parts: Vec<&str> = msg.text.split(' ').collect(); |
| 123 | match parts.first().copied() { |
| 124 | Some("INSERT") => parts.get(2).and_then(|v| v.parse().ok()).unwrap_or(0), |
| 125 | Some("UPDATE") | Some("DELETE") | Some("COPY") | Some("MERGE") => { |
| 126 | parts.get(1).and_then(|v| v.parse().ok()).unwrap_or(0) |
| 127 | } |
| 128 | _ => 0, |
| 129 | } |
| 130 | } |