Skip to content

Multiple-statement Support - #1110

Closed
abacigil wants to merge 2 commits into
brianc:masterfrom
abacigil:multiple-statement-results
Closed

abacigil wants to merge 2 commits into
brianc:masterfrom
abacigil:multiple-statement-results

Conversation

@abacigil

Copy link
Copy Markdown

Adjustment of result object for multiple statements

    - 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.

abacigil and others added 2 commits August 13, 2016 20:27
	- 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.
@joskuijpers

Copy link
Copy Markdown
Contributor

Hi! Thanks!
Could you add tests, fix the linting errors and remove all those changed lines where only a space was added? It makes the diff unreadable 😄

Also, what if I have opened a connection with multi-result, but I only send a single query? What is the result then?

@abacigil

Copy link
Copy Markdown
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.

@shilch

shilch commented Jan 29, 2017

Copy link
Copy Markdown

Any updates on this PR?

@rightaway

Copy link
Copy Markdown

I'm happy to test and provide feedback.

@charmander

Copy link
Copy Markdown
Collaborator

This was implemented differently in pg 7: a query that produces multiple result sets resolves with an array.

@charmander charmander closed this Aug 11, 2017
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.

5 participants