Extract a string from a field or expression result.
(doc: &[u8], field: &str, expr: Option<&crate::expr::SqlExpr>)
| 258 | |
| 259 | /// Extract a string from a field or expression result. |
| 260 | fn extract_str_val(doc: &[u8], field: &str, expr: Option<&crate::expr::SqlExpr>) -> Option<String> { |
| 261 | if let Some(expr) = expr { |
| 262 | return Some(value_ops::value_to_display_string(&eval_expr_on_doc( |
| 263 | doc, expr, |
| 264 | )?)); |
| 265 | } |
| 266 | let (start, _end) = extract_field(doc, 0, field)?; |
| 267 | read_str(doc, start).map(|s| s.to_string()) |
| 268 | } |
| 269 | |
| 270 | /// Extract a field as `Value`. Uses direct msgpack→Value for scalars; |
| 271 | /// falls back to full decode only for complex types. |
no test coverage detected