|
1 | 1 | # ----------------------------------------------------------------------------- |
2 | | -# Copyright (c) 2021, 2024, Oracle and/or its affiliates. |
| 2 | +# Copyright (c) 2021, 2025, Oracle and/or its affiliates. |
3 | 3 | # |
4 | 4 | # This software is dual-licensed to you under the Universal Permissive License |
5 | 5 | # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License |
@@ -846,17 +846,17 @@ def scroll(self, value: int = 0, mode: str = "relative") -> None: |
846 | 846 | Scroll the cursor in the result set to a new position according to the |
847 | 847 | mode. |
848 | 848 |
|
849 | | - If mode is “relative” (the default value), the value is taken as an |
850 | | - offset to the current position in the result set. If set to “absolute”, |
851 | | - value states an absolute target position. If set to “first”, the cursor |
852 | | - is positioned at the first row and if set to “last”, the cursor is set |
| 849 | + If mode is "relative" (the default value), the value is taken as an |
| 850 | + offset to the current position in the result set. If set to "absolute", |
| 851 | + value states an absolute target position. If set to "first", the cursor |
| 852 | + is positioned at the first row and if set to "last", the cursor is set |
853 | 853 | to the last row in the result set. |
854 | 854 |
|
855 | | - An error is raised if the mode is “relative” or “absolute” and the |
| 855 | + An error is raised if the mode is "relative" or "absolute" and the |
856 | 856 | scroll operation would position the cursor outside of the result set. |
857 | 857 | """ |
858 | 858 | self._verify_open() |
859 | | - self._impl.scroll(self.connection, value, mode) |
| 859 | + self._impl.scroll(self, value, mode) |
860 | 860 |
|
861 | 861 |
|
862 | 862 | class AsyncCursor(BaseCursor): |
@@ -1081,3 +1081,20 @@ async def parse(self, statement: str) -> None: |
1081 | 1081 | self._verify_open() |
1082 | 1082 | self._prepare(statement) |
1083 | 1083 | await self._impl.parse(self) |
| 1084 | + |
| 1085 | + async def scroll(self, value: int = 0, mode: str = "relative") -> None: |
| 1086 | + """ |
| 1087 | + Scroll the cursor in the result set to a new position according to the |
| 1088 | + mode. |
| 1089 | +
|
| 1090 | + If mode is "relative" (the default value), the value is taken as an |
| 1091 | + offset to the current position in the result set. If set to "absolute", |
| 1092 | + value states an absolute target position. If set to "first", the cursor |
| 1093 | + is positioned at the first row and if set to "last", the cursor is set |
| 1094 | + to the last row in the result set. |
| 1095 | +
|
| 1096 | + An error is raised if the mode is "relative" or "absolute" and the |
| 1097 | + scroll operation would position the cursor outside of the result set. |
| 1098 | + """ |
| 1099 | + self._verify_open() |
| 1100 | + await self._impl.scroll(self, value, mode) |
0 commit comments