Skip to content

Refactor SqlStatement to use SqlResultCursor#456

Merged
Yaraslaut merged 2 commits intomasterfrom
copilot/refactor-sqlstatement-cursor
Mar 2, 2026
Merged

Refactor SqlStatement to use SqlResultCursor#456
Yaraslaut merged 2 commits intomasterfrom
copilot/refactor-sqlstatement-cursor

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

  • Explore repository structure and understand existing code
  • Modify SqlStatement.hpp:
    • Make all Execute*() variants return [[nodiscard]] SqlResultCursor
    • Move fetch methods (FetchRow, TryFetchRow, GetColumn*, CloseCursor, GetResultCursor, GetVariantRowCursor) to private
    • Add friend class SqlResultCursor to SqlStatement
    • Add BindOutputColumnsToRecord to SqlResultCursor
    • Update SqlRowIterator to use SqlResultCursor
    • Update ExecuteDirectScalar and MigrateDirect to use cursors internally
  • Modify SqlStatement.cpp: Update ExecuteDirect, ExecuteWithVariants, ExecuteBatch to return SqlResultCursor
  • Update SqlSchema.cpp to use SqlResultCursor
  • Update SqlMigrationLock.cpp to use SqlResultCursor
  • Update DataMapper/DataMapper.hpp to use SqlResultCursor
  • Update src/tools/LupMigrationsPlugin/TransitionGlue.cpp
  • Update test files (CoreTests.cpp, DataBinderTests.cpp, Utils.hpp, DataMapper/ReadTests.cpp, SqlBackup/*Tests.cpp)
  • Build and verify changes compile correctly
  • Run tests to validate changes
Original prompt

This section details on the original issue you should resolve

<issue_title>Refactor SqlStatement to force the use of SqlResultCursor</issue_title>
<issue_description>- All SqlStatement.Execute() variants need t oreturn the SqlResultCursor as nodiscard.

  • All of the fetch methods in SqlStatement need to be removed, as they're replaced by SqlResultCursor's members.
  • Adapt all the existing code to the API changes.</issue_description>

<agent_instructions>Stick to modern C++23 API and languages. Embrace ranges, std::format, etc.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot stopped work on behalf of christianparpart due to an error March 2, 2026 11:08
@github-actions github-actions bot added documentation Improvements or additions to documentation Data Mapper CLI command line interface tools ddl2cpp tests Core API labels Mar 2, 2026
@Yaraslaut Yaraslaut force-pushed the copilot/refactor-sqlstatement-cursor branch from 5ea392a to 6807b1f Compare March 2, 2026 16:59
@Yaraslaut Yaraslaut changed the title [WIP] Refactor SqlStatement to use SqlResultCursor Refactor SqlStatement to use SqlResultCursor Mar 2, 2026
@Yaraslaut Yaraslaut marked this pull request as ready for review March 2, 2026 17:02
@Yaraslaut Yaraslaut requested a review from a team as a code owner March 2, 2026 17:02
@Yaraslaut Yaraslaut force-pushed the copilot/refactor-sqlstatement-cursor branch from 6807b1f to c5f294d Compare March 2, 2026 17:36
@Yaraslaut Yaraslaut merged commit a74ec73 into master Mar 2, 2026
20 checks passed
@Yaraslaut Yaraslaut deleted the copilot/refactor-sqlstatement-cursor branch March 2, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI command line interface tools Core API Data Mapper ddl2cpp documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor SqlStatement to force the use of SqlResultCursor

3 participants