Has there been any work done on adding NextResultSet? I'd like to try out pgx but this is a requirement. I'm willing to work on adding it myself but would like to avoid duplicating work. I looked at using the Batch interface, but Batch sends individual messages and I need to send multiple statements in the same string. Batches don't work for me because my backing system, cockroachdb, can automatically retry failed transactions of single strings.
Update: I forgot some of my use case. What I really need is a thing that is ambiguous about result types. If I send the string: select 1; set time zone default; select 3, 4; drop table a; select * from blah, I want an interface that can provide either command tags or results from each statement. The problem with the Go 1.8 NextResultSet is that it only works with things that return results, since it's defined on the Row type.
Some of us had a longer discussion about this in lib/pq#601, but restricting ourselves to the database/sql API made it fairly difficult to implement. With pgx the problems listed in that issue could be resolved by an explicit option on QueryExOptions to enable this multi mode. I'm really interested in doing this work because lib/pq is getting difficult to work with. But I want to make sure you'd accept it and it's done with a good design.
Has there been any work done on adding NextResultSet? I'd like to try out pgx but this is a requirement. I'm willing to work on adding it myself but would like to avoid duplicating work. I looked at using the Batch interface, but Batch sends individual messages and I need to send multiple statements in the same string. Batches don't work for me because my backing system, cockroachdb, can automatically retry failed transactions of single strings.
Update: I forgot some of my use case. What I really need is a thing that is ambiguous about result types. If I send the string:
select 1; set time zone default; select 3, 4; drop table a; select * from blah, I want an interface that can provide either command tags or results from each statement. The problem with the Go 1.8 NextResultSet is that it only works with things that return results, since it's defined on the Row type.Some of us had a longer discussion about this in lib/pq#601, but restricting ourselves to the database/sql API made it fairly difficult to implement. With pgx the problems listed in that issue could be resolved by an explicit option on QueryExOptions to enable this multi mode. I'm really interested in doing this work because lib/pq is getting difficult to work with. But I want to make sure you'd accept it and it's done with a good design.