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

Function try_eval_simple_condition

nodedb/src/control/trigger/mod.rs:22–29  ·  view source on GitHub ↗

Evaluate a simple boolean condition without DataFusion. Returns `Some(true/false)` for constant conditions (TRUE, FALSE, 1, 0, NULL). Returns `None` for complex conditions that need DataFusion evaluation.

(condition: &str)

Source from the content-addressed store, hash-verified

20/// Returns `Some(true/false)` for constant conditions (TRUE, FALSE, 1, 0, NULL).
21/// Returns `None` for complex conditions that need DataFusion evaluation.
22pub fn try_eval_simple_condition(condition: &str) -> Option<bool> {
23 let trimmed = condition.trim().to_uppercase();
24 match trimmed.as_str() {
25 "TRUE" | "1" => Some(true),
26 "FALSE" | "0" | "NULL" => Some(false),
27 _ => None,
28 }
29}

Callers 2

evaluate_conditionFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected