{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4081","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4081/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4081/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4081/events","html_url":"https://github.com/cockroachdb/cockroach/pull/4081","id":130731715,"number":4081,"title":"Add support for multiple results to SQL statements.","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-02-02T16:15:27Z","updated_at":"2016-02-05T18:19:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/4081","html_url":"https://github.com/cockroachdb/cockroach/pull/4081","diff_url":"https://github.com/cockroachdb/cockroach/pull/4081.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/4081.patch"},"body":"Use the new functionality in lib/pq to select the next set of results\nwhen multiple statements were executed.\n\nSwitch to using the \"postgres\" SQL driver in the cli tests.\n\nRemove runPrettyQueryWithFormat. It was only used in tests.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.svg\" height=\"40\" alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/4081)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/180480496","html_url":"https://github.com/cockroachdb/cockroach/pull/4081#issuecomment-180480496","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4081","id":180480496,"user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"created_at":"2016-02-05T18:19:59Z","updated_at":"2016-02-05T18:19:59Z","body":"But we also can't prevent people from entering two update statements (which should return two counts of affected rows to satisfy #3993) or a query and an update. The `sql.DB` interface is a poor fit for use in an interactive console because it requires you to programmatically know whether you're dealing with a query or other statement. Hacking in a \"NEXT\" command to Query() only solves part of the problem.\r\n\r\nWe'll need to either use a lower-level interface that can give us either a result set or a row count without us knowing in advance which to expect (can `pq.Conn` do this?) or parse the query to determine both how many statements are in it and whether those statements need to be passed to Query() or Execute()."}}