MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / value_to_coord_literal

Function value_to_coord_literal

nodedb-sql/src/planner/array_fn/helpers.rs:123–132  ·  view source on GitHub ↗
(v: &Value, dim: &str)

Source from the content-addressed store, hash-verified

121}
122
123pub(super) fn value_to_coord_literal(v: &Value, dim: &str) -> Result<ArrayCoordLiteral> {
124 match v {
125 Value::Integer(i) => Ok(ArrayCoordLiteral::Int64(*i)),
126 Value::Float(f) => Ok(ArrayCoordLiteral::Float64(*f)),
127 Value::String(s) => Ok(ArrayCoordLiteral::String(s.clone())),
128 other => Err(SqlError::TypeMismatch {
129 detail: format!("ARRAY_SLICE dim '{dim}' bound: unsupported value kind {other:?}"),
130 }),
131 }
132}

Callers 1

plan_sliceFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected