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

Method handle_move

nodedb/src/control/server/pgwire/handler/cursor_cmds.rs:58–76  ·  view source on GitHub ↗

Handle MOVE [FORWARD | BACKWARD] n IN cursor_name.

(
        &self,
        addr: &std::net::SocketAddr,
        upper: &str,
    )

Source from the content-addressed store, hash-verified

56
57 /// Handle MOVE [FORWARD | BACKWARD] n IN cursor_name.
58 pub(super) fn handle_move(
59 &self,
60 addr: &std::net::SocketAddr,
61 upper: &str,
62 ) -> PgWireResult<Vec<Response>> {
63 let parts: Vec<&str> = upper.split_whitespace().collect();
64
65 // MOVE FORWARD n IN cursor_name
66 // MOVE BACKWARD n IN cursor_name
67 // MOVE n IN cursor_name
68 let (forward, count, cursor_name) = parse_move(&parts)?;
69
70 let moved = self
71 .sessions
72 .move_cursor(addr, &cursor_name, forward, count)
73 .map_err(|e| cursor_error(&e.to_string()))?;
74
75 Ok(vec![Response::Execution(Tag::new("MOVE").with_rows(moved))])
76 }
77}
78
79enum FetchDirection {

Callers 1

execute_single_sqlMethod · 0.80

Calls 5

parse_moveFunction · 0.85
cursor_errorFunction · 0.85
collectMethod · 0.80
move_cursorMethod · 0.80
to_stringMethod · 0.80

Tested by

no test coverage detected