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


##########
c/driver/postgresql/connection.cc:
##########
@@ -126,6 +126,181 @@ class PqResultHelper {
   std::string query_;
 };
 
+class PqGetObjectsHelper {
+ public:
+  PqGetObjectsHelper(PGconn* conn, int depth, const char* catalog, const char* 
db_schema,
+                     const char* table_name, const char** table_types,
+                     const char* column_name, struct ArrowSchema* schema,
+                     struct ArrowArray* array, struct AdbcError* error)
+      : conn_(conn),
+        depth_(depth),
+        catalog_(catalog),
+        db_schema_(db_schema),
+        table_name_(table_name),
+        table_types_(table_types),
+        column_name_(column_name),
+        schema_(schema),
+        array_(array),
+        error_(error) {}
+
+  AdbcStatusCode GetObjects() {
+    RAISE_ADBC(AdbcInitConnectionObjectsSchema(schema_, error_));
+
+    na_error_ = {0};
+    CHECK_NA_DETAIL(INTERNAL, ArrowArrayInitFromSchema(array_, schema_, 
&na_error_),
+                    &na_error_, error_);
+    CHECK_NA(INTERNAL, ArrowArrayStartAppending(array_), error_);
+
+    catalog_name_col_ = array_->children[0];
+    catalog_db_schemas_col_ = array_->children[1];
+
+    catalog_db_schemas_items_ = catalog_db_schemas_col_->children[0];
+    db_schema_name_col_ = catalog_db_schemas_items_->children[0];
+    db_schema_tables_col_ = catalog_db_schemas_items_->children[1];
+
+    PqResultHelper curr_db_helper = PqResultHelper{conn_, "SELECT 
current_database()"};

Review Comment:
   I don't know if its even possible to list the databases without first being 
connected to one; if it is, then this arguably needs to be placed somewhere else



-- 
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