WillAyd commented on code in PR #725:
URL: https://github.com/apache/arrow-adbc/pull/725#discussion_r1214689873
##########
c/driver/postgresql/postgresql_test.cc:
##########
@@ -258,6 +258,131 @@ TEST_F(PostgresConnectionTest, GetObjectsGetDbSchemas) {
ASSERT_TRUE(seen_public) << "public schema does not exist";
}
+TEST_F(PostgresConnectionTest, GetObjectsGetAllFindsPrimaryKey) {
+ ASSERT_THAT(AdbcConnectionNew(&connection, &error), IsOkStatus(&error));
+ ASSERT_THAT(AdbcConnectionInit(&connection, &database, &error),
IsOkStatus(&error));
+
+ if (!quirks()->supports_get_objects()) {
+ GTEST_SKIP();
+ }
+
+ adbc_validation::StreamReader reader;
+ ASSERT_THAT(
+ AdbcConnectionGetObjects(&connection, ADBC_OBJECT_DEPTH_ALL, nullptr,
nullptr,
+ nullptr, nullptr, nullptr,
&reader.stream.value, &error),
+ IsOkStatus(&error));
+ ASSERT_NO_FATAL_FAILURE(reader.GetSchema());
+ ASSERT_NO_FATAL_FAILURE(reader.Next());
+ ASSERT_NE(nullptr, reader.array->release);
+ ASSERT_GT(reader.array->length, 0);
+
+ // should exist on public.adbc_test id column
+ bool seen_id_column = false;
+ bool seen_primary_key = false;
+
+ // TODO: these are in the PqObjectsHelper.GetObjects method; move to shared
location
Review Comment:
Thinking these eventually should belong in utils so they can be used by all
c/c++ driver implementations
--
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]