Encode a simple `{"key": count}` response (for insert confirmations).
(key: &str, count: usize)
| 78 | |
| 79 | /// Encode a simple `{"key": count}` response (for insert confirmations). |
| 80 | pub(in crate::data::executor) fn encode_count(key: &str, count: usize) -> crate::Result<Vec<u8>> { |
| 81 | let mut map = std::collections::BTreeMap::new(); |
| 82 | map.insert(key, count); |
| 83 | zerompk::to_msgpack_vec(&map).map_err(|e| crate::Error::Codec { |
| 84 | detail: format!("count response serialization: {e}"), |
| 85 | }) |
| 86 | } |
| 87 | |
| 88 | /// Decode a MessagePack or JSON payload to a JSON string for pgwire/HTTP output. |
| 89 | /// |