Commit bb780ab
Make Cursor.seek() return the number of rows it navigated over
Cursor.seek() now returns the number of rows seek navigated over to
reach the specified offset. For this to become useful, this commit
also adds support for relative 'FORWARD'/'BACKWARD' modes.
While currently implemented "RELATIVE" mode makes relative seeks possible,
it does not support exhaustive seek mode, i. e., "FORWARD ALL" and
"BACKWARD ALL". It is important to distinguish those modes from ABSOLUTE
seeks since ABSOLUTE seek always returns a single row, while relative
seeks return total number of rows. Thus, seek('ALL', 'FORWARD') is the
only way to obtain the total number of rows returned by the query
without actually iterating over it.1 parent 55c5b09 commit bb780ab
3 files changed
Lines changed: 61 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
| |||
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
296 | 302 | | |
297 | 303 | | |
298 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1092 | 1092 | | |
1093 | 1093 | | |
1094 | 1094 | | |
1095 | | - | |
1096 | | - | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
1097 | 1101 | | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
| 1102 | + | |
1102 | 1103 | | |
1103 | | - | |
1104 | | - | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1105 | 1117 | | |
1106 | | - | |
| 1118 | + | |
1107 | 1119 | | |
1108 | 1120 | | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1112 | 1129 | | |
1113 | 1130 | | |
1114 | 1131 | | |
| |||
1122 | 1139 | | |
1123 | 1140 | | |
1124 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1125 | 1152 | | |
1126 | 1153 | | |
1127 | 1154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
882 | 898 | | |
883 | 899 | | |
884 | 900 | | |
| |||
0 commit comments