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 and others added 2 commits October 8, 2025 16:40
Add SQLGetInfo tests

Co-Authored-By: rscales <[email protected]>
@alinaliBQ
Copy link
Contributor Author

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

Copy link

github-actions bot commented Oct 8, 2025

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

const bool is_unicode = true;

if (!info_value_ptr && !string_length_ptr) {
return static_cast<SQLRETURN> SQL_ERROR;
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
return static_cast<SQLRETURN> SQL_ERROR;
return static_cast<SQLRETURN>(SQL_ERROR);

?

// 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)?

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

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