Handle MOVE [FORWARD | BACKWARD] n IN cursor_name.
(
&self,
addr: &std::net::SocketAddr,
upper: &str,
)
| 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 | |
| 79 | enum FetchDirection { |
no test coverage detected