Skip to content

Multiple-statement Support #1110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Multiple-statement Support #1110

wants to merge 2 commits into from

Conversation

abacigil
Copy link

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

shilch commented Jan 29, 2017

Any updates on this PR?

@rightaway
Copy link

I'm happy to test and provide feedback.

@charmander
Copy link
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