Repository navigation
feat: add wsSQL2 service and related functionality - #4648
Open
GordonSmith wants to merge 1 commit into
Open
GordonSmith wants to merge 1 commit into
GordonSmith wants to merge 1 commit into
Conversation
- Introduced wsSQL2 service with methods for executing queries, fetching result sets, and handling logical file metadata. - Added SQL2Service class extending Service to manage SQL operations. - Implemented SplitQuery functionality to handle multi-statement SQL scripts. - Created comprehensive tests for SQLConnection and wsSQL2 service to ensure correct behavior and error handling. - Updated index files to export new wsSQL2 service and related types.
jeclrsg
requested changes
Oct 21, 2026
jeclrsg
left a comment
Contributor
There was a problem hiding this comment.
@GordonSmith Only a few things that jumped out at me. And GH had a flagged some of the tests about that ver_ being 0.00 instead of 1.00.
| if (typeof response.Rows !== "string") { | ||
| throw new Error("WsSQL2 response is missing Rows"); | ||
| } | ||
| const rows: unknown = JSON.parse(response.Rows); |
Contributor
There was a problem hiding this comment.
Is it possible for Rows to ever be invalid JSON? If so, might be good to have some context instead of just the default exception, like you did with these others.
| const response = await this.service.SplitQuery({ SqlText: sql }); | ||
| checkExceptions(response); | ||
| const statements = response.Statements?.Statement; | ||
| if (statements === undefined && response.Statements === undefined) return []; |
Contributor
There was a problem hiding this comment.
I think this should be something like:
const statements = response.Statements?.Statement ?? [];
if (statements.length === 0) return [];Currently, if Statements were an empty object (is that possible?), this would skip the early return and throw.
This branch has not been deployed
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.
Checklist:
Testing: