-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add support for retrieving multiple results. #1
Conversation
Connection pinning concerns still stand. I'd really like to see this functionality wrapped up into a function that takes care of all the shenanigans. Reviewed 2 of 2 files at r1. conn.go, line 624 [r1] (raw file): conn.go, line 638 [r1] (raw file): conn.go, line 1470 [r1] (raw file): conn.go, line 1641 [r1] (raw file): Comments from the review on Reviewable.io |
@@ -200,7 +204,7 @@ func (c *conn) handlePgpass(o values) { | |||
} | |||
} | |||
return append(fs, string(f)) | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're upstreaming this (or trying to) it probably makes sense to factor out the drive-by changes in a separate commit.
b.string(q) | ||
cn.send(b) | ||
querySent := false | ||
nextResult := q == "NEXT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pull out magic constant into named const variable?
8b0d5d6
to
943e575
Compare
Moved the drive-by change to a separate commit. Review status: all files reviewed at latest revision, 4 unresolved discussions. conn.go, line 624 [r1] (raw file): conn.go, line 638 [r1] (raw file): conn.go, line 1470 [r1] (raw file): conn.go, line 1641 [r1] (raw file): Comments from the review on Reviewable.io |
Reviewed 2 of 2 files at r3. conn.go, line 1470 [r1] (raw file): conn.go, line 1641 [r1] (raw file): Comments from the review on Reviewable.io |
943e575
to
07298f2
Compare
Review status: all files reviewed at latest revision, 5 unresolved discussions. conn.go, line 624 [r1] (raw file): conn.go, line 1470 [r1] (raw file): conn.go, line 1641 [r1] (raw file): conn_test.go, line 363 [r1] (raw file): Comments from the review on Reviewable.io |
@tamird Do you have a suggestion for how to wrap up this functionality into a function to take care of the shenanigans? Review status: 1 of 2 files reviewed at latest revision, 5 unresolved discussions. Comments from the review on Reviewable.io |
07298f2
to
73fc92e
Compare
Reviewed 1 of 1 files at r4. conn.go, line 1470 [r1] (raw file): I don't think this change will be accepted upstream in a single PR, which is why I think it should be separated. conn.go, line 1641 [r1] (raw file): Comments from the review on Reviewable.io |
Review status: 1 of 2 files reviewed at latest revision, 5 unresolved discussions. conn.go, line 1470 [r1] (raw file): But let's focus on whether the code is correct first and worry about how to get it pushed upstream second. It looks very likely that the handling of multiple results will not be accepted upstream. That's fine, that's what forks are for. conn.go, line 1641 [r1] (raw file): Comments from the review on Reviewable.io |
73fc92e
to
95bc43c
Compare
Reviewed 1 of 1 files at r5. conn.go, line 1470 [r1] (raw file):
Maybe no value doing it now, but had it been in its own commit from the start, you would've explained this in your commit message. Instead, Tamir and I independently tried to understand this change without explanation, which costs time. conn.go, line 1339 [r3] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r6. conn.go, line 1470 [r1] (raw file): Comments from the review on Reviewable.io |
Reworked how the msg-ready command (`Z`) is processed. Previously execution of a query would look for the msg-ready command before completing the operation. Now, when executing a query, the driver places the connection into a state where it knows there may be more results. If another query is subsequently executed, the driver waits for the msg-ready command to arrive, discarding any other commands, before sending the new query.
95bc43c
to
cca0657
Compare
If the special `NEXT` query is executed, the driver looks for another set of results on the connection. If no such results are found, ErrNoMoreResults is returned.
cca0657
to
4bc2416
Compare
Review status: all files reviewed at latest revision, 3 unresolved discussions. conn.go, line 1470 [r1] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r4, 1 of 1 files at r6. Comments from the review on Reviewable.io |
Anything else to do here? Review status: 1 of 2 files reviewed at latest revision, 3 unresolved discussions. conn.go, line 1339 [r3] (raw file): Comments from the review on Reviewable.io |
LGTM Reviewed 1 of 1 files at r7. Comments from the review on Reviewable.io |
Add support for retrieving multiple results.
Reworked how the msg-ready command (
Z
) is processed. Previouslyexecution of a query would look for the msg-ready command before
completing the operation. Now, when executing a query, the driver places
the connection into a state where it knows there may be more results. If
another query is subsequently executed, the driver waits for the
msg-ready command to arrive, discarding any other commands, before
sending the new query. But if the special
NEXT
query is executed, thedriver looks for another set of results on the connection. If no such
results are found, ErrNoMoreResults is returned.