You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "WillAyd (via GitHub)" <gi...@apache.org> on 2023/05/12 19:00:19 UTC

[GitHub] [arrow-adbc] WillAyd commented on a diff in pull request #683: refactor(c/driver/postgres): Implement InputIterator for ResultHelper

WillAyd commented on code in PR #683:
URL: https://github.com/apache/arrow-adbc/pull/683#discussion_r1192708283


##########
c/driver/postgresql/connection.cc:
##########
@@ -170,13 +271,11 @@ AdbcStatusCode PostgresConnectionGetObjectsImpl(
 
     PqResultHelper result_helper = PqResultHelper{conn, query.buffer};
     StringBuilderReset(&query);
-    pg_result* result = result_helper.Execute();
 
-    ExecStatusType pq_status = PQresultStatus(result);
-    if (pq_status == PGRES_TUPLES_OK) {
-      int num_rows = PQntuples(result);
-      for (int row = 0; row < num_rows; row++) {
-        const char* db_name = PQgetvalue(result, row, 0);
+    result_helper.Execute();

Review Comment:
   Not sold on the current state management, but essentially it is required to call `Execute` prior to iteration. If we see this class evolving to serve commands that don't return result rows, then that may be OK. Otherwise we might be able to move the `Execute` call into the `begin` method



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org