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

Function default_arg

nodedb-query/src/window/offset.rs:30–38  ·  view source on GitHub ↗
(spec: &WindowFuncSpec, idx: usize)

Source from the content-addressed store, hash-verified

28}
29
30fn default_arg(spec: &WindowFuncSpec, idx: usize) -> serde_json::Value {
31 spec.args
32 .get(idx)
33 .and_then(|e| match e {
34 SqlExpr::Literal(v) => Some(serde_json::Value::from(v.clone())),
35 _ => None,
36 })
37 .unwrap_or(serde_json::Value::Null)
38}
39
40pub(super) fn apply_lag(
41 rows: &mut [(String, serde_json::Value)],

Callers 2

apply_lagFunction · 0.85
apply_leadFunction · 0.85

Calls 2

getMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected