Resolve a `Value` into a `usize` if numeric-shaped. Accepts: - `Value::Number(n, _)` — the typed-parameter and explicit-literal path. - `Value::SingleQuotedString(s)` where `s` parses as `usize` — the UNKNOWN-param bind path (pgwire drivers that send `Type::UNKNOWN`). `Value::DoubleQuotedString` is NOT accepted: with the PostgreSQL dialect double-quoted tokens parse as `Expr::Identifier`, never
(value: &ast::Value)
| 45 | /// Does not perform saturating or wrapping coercion — values that |
| 46 | /// overflow `usize` are rejected, not silently truncated. |
| 47 | pub fn as_usize_literal(value: &ast::Value) -> Option<usize> { |
| 48 | match value { |
| 49 | ast::Value::Number(n, _) => n.parse::<usize>().ok(), |
| 50 | ast::Value::SingleQuotedString(s) => s.parse::<usize>().ok(), |
| 51 | _ => None, |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | /// Resolve an `Expr::Value` into a `usize` if numeric-shaped. Thin |
| 56 | /// wrapper that unpacks the `Expr` → `Value` layer so callers reading |
no test coverage detected