Closed njdullea closed 6 months ago
I'm am checking in with my company to confirm I can sign for the CLA, and will return.
If there is anything else missing from the PR I can provide please let me know.
thx for the PR!
Do we need a separate test case for the message loop version of a query?
Thank you for the feedback! I am working on the suggested changes.
I'm unsure what a message loop version of a query is and was wondering if you could clarify?
I also moved the state management to a Rows
method as you suggested, but ran into some challenges I described in the thread above. Let me know if I can provide any more info, thanks!
the message loop version of a query is tested here https://github.com/microsoft/go-mssqldb/blob/ada30cbaf031d81144e5c5487ddefd4f3dac0ef5/queries_go19_test.go#L1255
Thank you for the message loop query test reference, I will add a test case for this.
I did not understand that a query in golang may result in an error, but that error will not be returned from the query method, rather it must be checked via rows.Err()
after closing the error. Sorry for the distraction.
In
processQueryResponse
if a token is an array ofcolumnStruct
, it would break the loop and fail to process the following tokens. These tokens should be processed since they may contain errors from the query that should be returned.There is a test included which sets up a table, and performs an insert query with output variables. The first token returned in process query response is an array of column struct, relating to the output variables, and second token is an error indicating you cannot insert a value for an identity column. Previously, it would return with no error and an empty set of rows, and now it catches the error and returns it from the query.