question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for multiple result objects

See original GitHub issue

It would be really nice if after sending a single SQL request with 2 or more SQL statements separated by semi-colons, the query callback contained an array of result objects rather than a single object. Currently, something like this returns in a single result object with rows from both SQL statements present in result.rows

SELECT * FROM users WHERE id = 1;
SELECT * FROM conversations WHERE user_id = 1;

Thanks!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
brianccommented, Jun 16, 2017

I’ve added a proper fix to this to the pg@7.0 milestone. Should be out within the month. Sorry for the long delay!!

0reactions
wayneblosscommented, Feb 5, 2018

@charmander That’s a good point.

I hadn’t looked at the code yet, I probably should have because it’s pretty straightforward. I can see the implementation here which simply checks what’s coming back from the server to create the array of results. The commit that added support for this was tiny.

Thanks for your help all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Multiple Resultsets - Dapper .NET
It may happen that you are interested in executing a batch of SQL commands whose results produce not only one resultset, but more...
Read more >
Multiple Result Sets With .Net Core and SQL Server
Before attempting to use multiple result sets in your project, first, make sure that your SQL Server version can support it.
Read more >
Stored Procedures with Multiple Result Sets - EF6
This article will show you two ways that you can use to access more than one result set from a stored procedure in...
Read more >
Dapper.NET and stored proc with multiple result sets
QueryMultiple supports the ability to deal with multiple result sets. The only design restriction we added was totally disabling buffering ...
Read more >
How to: Execute Stored Procedures Returning Multiple ...
The current version of the Telerik Data Access ADO API does not directly support working with multiple result sets. To solve this problem,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found