Add scrollable cursor support to StatementOptions#28
Merged
asfernandes merged 2 commits intoasfernandes:mainfrom Feb 19, 2026
Merged
Add scrollable cursor support to StatementOptions#28asfernandes merged 2 commits intoasfernandes:mainfrom
asfernandes merged 2 commits intoasfernandes:mainfrom
Conversation
Add CursorType enum (FORWARD_ONLY, SCROLLABLE) and expose it through StatementOptions::setCursorType(). When SCROLLABLE is set, openCursor() passes IStatement::CURSOR_TYPE_SCROLLABLE so that fetchPrior, fetchFirst, fetchLast, fetchAbsolute and fetchRelative work correctly. The default remains FORWARD_ONLY, preserving existing behavior. Fixes asfernandes#25
asfernandes
requested changes
Feb 18, 2026
Contributor
Author
|
Just pushed a new commit with the requested fixes. 👍🏻 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add scrollable cursor support to StatementOptions
Fixes #25
Summary
Statementnow supports opening scrollable cursors via a newCursorTypeoption inStatementOptions. Previously, cursors were always opened with flag0(forward-only), which meant the scrollable fetch methods (fetchPrior,fetchFirst,fetchLast,fetchAbsolute,fetchRelative) would silently fail even though they were already exposed in the API.Changes
Statement.hCursorTypeenum withFORWARD_ONLY(default) andSCROLLABLEvalues.StatementOptionsgainsgetCursorType()/setCursorType()with fluent API.Statementstores acursorFlagsmember, initialized fromStatementOptionsin the constructor. The move constructor transfers it.Statement.cppCursorType::SCROLLABLEis set, storesIStatement::CURSOR_TYPE_SCROLLABLEincursorFlags.execute(): passescursorFlags(instead of hard-coded0) toopenCursor().src/test/ScrollableCursor.cpp(new)Seven test cases:
FORWARD_ONLYfetchFirstfetchLastfetchPriorfetchAbsolutefetchRelativeUsage
Backward Compatibility
This is a non-breaking, additive change. The default cursor type is
FORWARD_ONLY, preserving existing behavior. No existing API signatures are modified.