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


##########
c/driver/postgresql/connection.cc:
##########
@@ -216,6 +216,85 @@ AdbcStatusCode PostgresConnection::GetInfo(struct 
AdbcConnection* connection,
   return BatchToArrayStream(&array, &schema, out, error);
 }
 
+AdbcStatusCode PostgresConnectionGetSchemasImpl(PGconn* conn, int depth,
+                                                const char* db_name,
+                                                const char* db_schema,
+                                                struct ArrowArray* 
db_schemas_list,
+                                                struct AdbcError* error) {
+  struct ArrowArray* db_schema_items = db_schemas_list->children[0];
+  struct ArrowArray* db_schema_names = db_schema_items->children[0];
+  struct ArrowArray* db_schema_tables_list = db_schema_items->children[1];
+
+  // inefficient to place here but better localized until we do a class-based 
refactor
+  const char* curr_db;
+  PqResultHelper curr_db_helper = PqResultHelper{conn, "SELECT 
current_database()"};
+  if (curr_db_helper.Status() == PGRES_TUPLES_OK) {
+    assert(curr_db_helper.NumRows() == 1);
+    auto curr_iter = curr_db_helper.begin();
+    PqResultRow db_row = *curr_iter;
+    curr_db = db_row[0].data;
+  } else {
+    return ADBC_STATUS_NOT_IMPLEMENTED;

Review Comment:
   I changed to INTERNAL for now - I don't know if there is any valid reason 
why this call would fail



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to