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


##########
c/driver/postgresql/connection.cc:
##########
@@ -68,6 +75,76 @@ AdbcStatusCode PostgresConnection::Commit(struct AdbcError* 
error) {
   return ADBC_STATUS_OK;
 }
 
+AdbcStatusCode PostgresConnectionGetInfoImpl(const uint32_t* info_codes,
+                                             size_t info_codes_length,
+                                             struct ArrowSchema* schema,
+                                             struct ArrowArray* array,
+                                             struct AdbcError* error) {
+  RAISE_ADBC(AdbcInitConnectionGetInfoSchema(info_codes, info_codes_length, 
schema, array,
+                                             error));
+
+  for (size_t i = 0; i < info_codes_length; i++) {
+    switch (info_codes[i]) {
+      case ADBC_INFO_VENDOR_NAME:
+        RAISE_ADBC(
+            AdbcConnectionGetInfoAppendString(array, info_codes[i], 
"PostgreSQL", error));
+        break;
+      case ADBC_INFO_VENDOR_VERSION:
+        RAISE_ADBC(AdbcConnectionGetInfoAppendString(
+            array, info_codes[i], std::to_string(PQlibVersion()).c_str(), 
error));
+        break;
+      case ADBC_INFO_DRIVER_NAME:
+        RAISE_ADBC(AdbcConnectionGetInfoAppendString(array, info_codes[i],
+                                                     "ADBC PostgreSQL Driver", 
error));
+        break;
+      case ADBC_INFO_DRIVER_VERSION:
+        // TODO(lidavidm): fill in driver version

Review Comment:
   I'm guessing this is something we can place in utils.c whenever read and 
just have all the drivers pull from it. Maybe even pre-populate it in the 
utils.c `AdbcInitConnectionGetInfoSchema` function



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to