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

Function convert_window_frame_bound

nodedb-sql/src/planner/window/frame.rs:68–80  ·  view source on GitHub ↗
(bound: &ast::WindowFrameBound)

Source from the content-addressed store, hash-verified

66}
67
68fn convert_window_frame_bound(bound: &ast::WindowFrameBound) -> Result<FrameBound> {
69 match bound {
70 ast::WindowFrameBound::CurrentRow => Ok(FrameBound::CurrentRow),
71 ast::WindowFrameBound::Preceding(None) => Ok(FrameBound::UnboundedPreceding),
72 ast::WindowFrameBound::Following(None) => Ok(FrameBound::UnboundedFollowing),
73 ast::WindowFrameBound::Preceding(Some(expr)) => {
74 Ok(FrameBound::Preceding(extract_frame_offset(expr)?))
75 }
76 ast::WindowFrameBound::Following(Some(expr)) => {
77 Ok(FrameBound::Following(extract_frame_offset(expr)?))
78 }
79 }
80}
81
82/// Parse a frame offset from a literal. Only non-negative integer literals that
83/// fit in a `u64` are accepted; anything else (expression, float, oversized

Callers 1

convert_window_frameFunction · 0.85

Calls 1

extract_frame_offsetFunction · 0.85

Tested by

no test coverage detected