Implement TDS cursor streaming (sp_cursoropen/sp_cursorfetch/sp_cursorclose) for Repo.stream support#184
Open
zerobatu wants to merge 3 commits into
Open
Implement TDS cursor streaming (sp_cursoropen/sp_cursorfetch/sp_cursorclose) for Repo.stream support#184zerobatu wants to merge 3 commits into
zerobatu wants to merge 3 commits into
Conversation
added 2 commits
May 18, 2026 22:33
add documentation
4577ac2 to
2cfa0d6
Compare
GitHub Actions runners have a pre-existing /etc/apt/sources.list.d/microsoft-prod.list that references signed-by=/usr/share/keyrings/microsoft-prod.gpg. Adding the same repo without signed-by causes a conflicting values error. Fix by removing the pre-existing source list, using gpg --dearmor, and adding signed-by consistently.
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.
Summary
Implements the DBConnection cursor callbacks (handle_declare/4, handle_fetch/4, handle_deallocate/4) in Tds.Protocol using SQL Server's cursor stored procedures, enabling Repo.stream/2 and DBConnection.stream/4 support.
Changes
Core Implementation
lib/tds/protocol.ex: Replaced stub implementations of handle_declare/4, handle_fetch/4, and handle_deallocate/4 with working cursor operations:
lib/tds/messages.ex:
lib/tds/result.ex: Added params field to Tds.Result struct for storing RPC output/return value parameters.
lib/tds/tokens.ex: Added support for TABNAME (0xA4) and COLINFO (0xA5) tokens sent by SQL Server in cursor result sets.
lib/tds.ex: Added Tds.stream/4 public API function delegating to DBConnection.stream/4.
Tests
Notes