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

Function extract_string_literal

nodedb-sql/src/planner/select/helpers.rs:153–165  ·  view source on GitHub ↗
(expr: &ast::Expr)

Source from the content-addressed store, hash-verified

151}
152
153pub fn extract_string_literal(expr: &ast::Expr) -> Result<String> {
154 match expr {
155 ast::Expr::Value(v) => match &v.value {
156 ast::Value::SingleQuotedString(s) => Ok(s.clone()),
157 _ => Err(SqlError::Unsupported {
158 detail: format!("expected string literal, got: {expr}"),
159 }),
160 },
161 _ => Err(SqlError::Unsupported {
162 detail: format!("expected string literal, got: {expr}"),
163 }),
164 }
165}
166
167pub fn extract_float(expr: &ast::Expr) -> Result<f64> {
168 match expr {

Callers 7

plan_text_from_whereFunction · 0.70
extract_geometry_argFunction · 0.70
extract_text_argFunction · 0.50
extract_graph_score_argsFunction · 0.50
try_extract_sort_searchFunction · 0.50

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected