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

Function eval_constant_expr

nodedb-sql/src/planner/select/helpers.rs:91–93  ·  view source on GitHub ↗

Evaluate a constant SqlExpr to a SqlValue. Delegates to the shared `const_fold::fold_constant` helper so that zero-arg scalar functions like `now()` and `current_timestamp` go through the same evaluator as the runtime expression path.

(expr: &SqlExpr, functions: &FunctionRegistry)

Source from the content-addressed store, hash-verified

89/// like `now()` and `current_timestamp` go through the same evaluator
90/// as the runtime expression path.
91pub(super) fn eval_constant_expr(expr: &SqlExpr, functions: &FunctionRegistry) -> SqlValue {
92 crate::planner::const_fold::fold_constant(expr, functions).unwrap_or(SqlValue::Null)
93}
94
95/// Extract a geometry argument: handles ST_Point(lon, lat), ST_GeomFromGeoJSON('...'),
96/// or a raw string literal containing GeoJSON.

Callers 1

plan_selectFunction · 0.85

Calls 1

fold_constantFunction · 0.85

Tested by

no test coverage detected