Skip to content

Add getOutputMessage() accessor to Statement#45

Merged
asfernandes merged 3 commits into
asfernandes:mainfrom
fdcastel:issue-42-req2
Mar 14, 2026
Merged

Add getOutputMessage() accessor to Statement#45
asfernandes merged 3 commits into
asfernandes:mainfrom
fdcastel:issue-42-req2

Conversation

@fdcastel
Copy link
Copy Markdown
Contributor

Based on #44

Adds a getOutputMessage() accessor to the Statement class, addressing REQ-2 from #42.

Problem

Statement exposes getInputMessage() for raw write access to the input parameter buffer, but there was no corresponding getOutputMessage() for the output result buffer (outMessage was private).

The ODBC driver needs raw access to the output message buffer for:

  1. Prefetch optimization: Copying raw fetched rows into a prefetch buffer after each fetchNext().
  2. Direct descriptor integration: Pointing OdbcConvert descriptor pointers at offsets within the output message, eliminating a separate buffer and one memcpy per row.

Changes

  • Statement: Added getOutputMessage() returning std::vector<std::byte>&, symmetrical with getInputMessage().
  • Tests: Added test verifying the buffer is non-empty after prepare and that the reference remains stable across accesses.

Impact

  • Backward compatible: No existing APIs or behavior changed.
  • Enables the ODBC driver to eliminate the separate Sqlda.buffer for output data and implement N-row prefetch using fb-cpp's buffer as the source.

Comment thread src/test/Statement.cpp Outdated
@asfernandes
Copy link
Copy Markdown
Owner

Please rebase.

Symmetrical with the existing getInputMessage(), provides direct access
to the raw output message buffer for consumers that need to read
fetched row data at the raw byte level.

Closes asfernandes#42 (REQ-2).
@fdcastel
Copy link
Copy Markdown
Contributor Author

Rebased onto latest main.

Comment thread src/test/Statement.cpp Outdated
@asfernandes asfernandes merged commit 8df5569 into asfernandes:main Mar 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants