WillAyd commented on code in PR #711:
URL: https://github.com/apache/arrow-adbc/pull/711#discussion_r1206054345
##########
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_));
Review Comment:
Not sure if this should stay here, move to the init with an abort, or even
be contained within the class
##########
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];
Review Comment:
Wasn't sure if these were best made as member variables or even getters;
just went with this because it is less verbose
--
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]