Repository navigation
Conversation
- If you query multiple statements, current lib does not support and it returns wrong results in result object. - Now it supports multiple statements and it returns "result" object as an array and this array has Result object for each statement that requested in query. - Example for multiple statement : SELECT * FROM users;select * from events;update users set id = 1 where id = 1 - If you set "multipleStatementResult" to "true" in connection configuration object, this feature will be enabled, otherwise nothing will change, same functionality of original one will be executed. - Tested with SELECT, UPDATE, DELETE and INSERT # Simple example - An example for multiple statements is available in "sample" folder.
Contributor
|
Hi! Thanks! Also, what if I have opened a connection with multi-result, but I only send a single query? What is the result then? |
Author
|
I'll try to add tests as soon as possible ( I'm busy recently ), and fix the lines. It'll work as usual and it'll return "result" object as an array with just 1 response for executed query. |
|
Any updates on this PR? |
|
I'm happy to test and provide feedback. |
Collaborator
|
This was implemented differently in pg 7: a query that produces multiple result sets resolves with an array. |
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.
Adjustment of result object for multiple statements
Simple example