Skip to content

Conversation

@alinaliBQ
Copy link
Contributor

@alinaliBQ alinaliBQ commented Oct 8, 2025

Rationale for this change

ODBC needs to give BI tools information about the driver itself and the data source it is connected to.

What changes are included in this PR?

  • Implementation of SQLGetinfo to return driver and data source information
  • Add default values for SQLGetInfo in get_info_cache.cc
  • Tests

Are these changes tested?

Will be tested in CI when PR is ready for review

Are there any user-facing changes?

No

@alinaliBQ
Copy link
Contributor Author

@lidavidm @kou Please review this draft ODBC API PR. The testing folder structure will be in a separate PR

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

⚠️ GitHub issue #47709 has been automatically assigned in GitHub to PR creator.

// Driver Information

TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoActiveEnvironments) {
this->Connect();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the connect/disconnect be put in a SetUp/TearDown?

Also it might not be wise to add the tests directly to FlightSQLODBCTestBase; could we create a fixture for this test suite specifically (by subclassing)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, added separate test fixture ConnectionInfoTest

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Oct 9, 2025
TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoDriverName) {
this->Connect();

Validate(this->conn, SQL_DRIVER_NAME, (SQLWCHAR*)L"Arrow Flight ODBC Driver");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use static_cast?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, fixed

Copy link
Contributor Author

@alinaliBQ alinaliBQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked on code review comments

// Driver Information

TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoActiveEnvironments) {
this->Connect();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, added separate test fixture ConnectionInfoTest

TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoDriverName) {
this->Connect();

Validate(this->conn, SQL_DRIVER_NAME, (SQLWCHAR*)L"Arrow Flight ODBC Driver");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, fixed

@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Oct 20, 2025
@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels Oct 21, 2025
Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase!

Comment on lines 29 to 33
template <typename T>
class ConnectionInfoTest : public T {
public:
using List = std::list<T>;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
template <typename T>
class ConnectionInfoTest : public T {
public:
using List = std::list<T>;
};
template <typename T>
class ConnectionInfoTest : public T {
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, rebased and removed using List

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Oct 22, 2025
Co-Authored-By: rscales <[email protected]>

Create connection_info_test.cc

Add SQLGetInfo tests

Co-authored-by: justing-bq <[email protected]>
Co-Authored-By: rscales <[email protected]>

Address code review comments

Co-authored-by: justing-bq <[email protected]>

Work on code review comments

Fix build issues with tests
* fix build issues
@alinaliBQ alinaliBQ force-pushed the gh-47709-sql-get-info branch from 5452bfd to f7a7386 Compare October 22, 2025 18:50
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Oct 22, 2025
@alinaliBQ alinaliBQ requested a review from lidavidm October 22, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants